From 4080446c501d09c91386e5f0619e007b9e5ed798 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 16 Nov 2012 11:20:32 -0700 Subject: [PATCH] skip ".git" or ".svn" in a collects directory Also, update the documentation for `raco setup' and its handling of command-line argument. --- collects/scribblings/raco/setup.scrbl | 21 +++++++++++++-------- collects/setup/setup-unit.rkt | 8 ++++++++ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/collects/scribblings/raco/setup.scrbl b/collects/scribblings/raco/setup.scrbl index b538def3f0..1ae0eb3eb6 100644 --- a/collects/scribblings/raco/setup.scrbl +++ b/collects/scribblings/raco/setup.scrbl @@ -60,10 +60,18 @@ The @exec{raco setup} command performs two main services: @itemize[ - @item{@bold{Compiling and setting up all (or some of the) - collections:} When @exec{raco setup} is run without any arguments, it - finds all of the current collections (see @secref[#:doc - ref-src]{collects}) and compiles libraries in each collection. + @item{@bold{Compiling and setting up all or some collections:} + When @exec{raco setup} is run without any arguments, it + finds all of the current collections---see @secref[#:doc + ref-src]{collects}---and compiles libraries in each collection. + (Directories that are named @filepath{.git} or @filepath{.svn} are + not treated as collections.) + + To restrict @exec{raco setup} to a set of collections, provide the + collection names as arguments. For example, @exec{raco setup + scribblings/raco} would only compile and render the documentation + for @exec{raco}, which is implemented in a + @filepath{scribblings/raco} collection. An optional @filepath{info.rkt} within the collection can indicate specifically how the collection's files are to be compiled and @@ -83,9 +91,6 @@ The @exec{raco setup} command performs two main services: @racket[(processor-count)], which typically uses all the machine's processing cores. - The @Flag{l} flag takes one or more collection names and restricts - @exec{raco setup}'s action to those collections. - The @DFlag{mode} @nonterm{mode} flag causes @exec{raco setup} to use a @filepath{.zo} compiler other than the default compiler, and to put the resulting @filepath{.zo} files in a subdirectory (of the usual @@ -107,7 +112,7 @@ The @exec{raco setup} command performs two main services: @item{@bold{Unpacking @filepath{.plt} files:} A @filepath{.plt} file is a platform-independent distribution archive for software based on Racket. When one or more file names are - provided as the command line arguments to @exec{raco setup}, the files + provided as the command line arguments to @exec{raco setup} with the @Flag{A} flag, the files contained in the @filepath{.plt} archive are unpacked (according to specifications embedded in the @filepath{.plt} file) and only collections specified by the @filepath{.plt} file are compiled and diff --git a/collects/setup/setup-unit.rkt b/collects/setup/setup-unit.rkt index c66b46f3f2..59da2eba9e 100644 --- a/collects/setup/setup-unit.rkt +++ b/collects/setup/setup-unit.rkt @@ -297,10 +297,16 @@ maj min))) + (define (skip-collection-directory? collection) + ;; Skiping ".git" or ".svn" makes it cleaner to use a git of subversion + ;; checkout as a collection directory + (regexp-match? #rx"[.](git|svn)$" (path->bytes collection))) + ;; Add in all non-planet collections: (for ([cp (current-library-collection-paths)] #:when (directory-exists? cp) [collection (directory-list cp)] + #:unless (skip-collection-directory? collection) #:when (directory-exists? (build-path cp collection))) (collection-cc! (list collection) #:path (build-path cp collection))) @@ -317,6 +323,7 @@ (for ([cp (in-list (links #:root? #t #:user? #f))] #:when (directory-exists? cp) [collection (directory-list cp)] + #:unless (skip-collection-directory? collection) #:when (directory-exists? (build-path cp collection))) (cc! (list collection) #:path (build-path cp collection)))) @@ -336,6 +343,7 @@ (for ([cp (in-list (links #:root? #t))] #:when (directory-exists? cp) [collection (directory-list cp)] + #:unless (skip-collection-directory? collection) #:when (directory-exists? (build-path cp collection))) (cc! (list collection) #:path (build-path cp collection))))