Allow installation into arbitrary directories with "plt-r6rs --install"
Hi! Here's an updated version of the patch, which also mentions the added option in the docs; also the specified directory is added to the collection paths, since compilation will fail otherwise. From: Andreas Rottmann <a.rottmann@gmx.at> Subject: Allow installation into arbitrary directories with "plt-r6rs --install" Added a `--collections' option to plt-r6rs which allows to specify the directory where libraries are installed into.
This commit is contained in:
parent
6f0e79feff
commit
53cbe874e0
|
@ -12,6 +12,7 @@
|
|||
(define install-mode (make-parameter #f))
|
||||
(define compile-mode (make-parameter #f))
|
||||
(define install-all-users (make-parameter #f))
|
||||
(define install-dir (make-parameter #f))
|
||||
(define install-force (make-parameter #f))
|
||||
(define extra-collection-dirs (make-parameter null))
|
||||
|
||||
|
@ -22,9 +23,11 @@
|
|||
(install-mode #t)]
|
||||
[("--compile") "compile <file> and all dependencies"
|
||||
(compile-mode #t)]
|
||||
#:once-each
|
||||
#:once-any
|
||||
[("--all-users") "install into main installation"
|
||||
(install-all-users #t)]
|
||||
[("--collections") dir "install into <dir>"
|
||||
(install-dir (path->complete-path dir))]
|
||||
[("--force") "overwrite existing libraries"
|
||||
(install-force #t)]
|
||||
#:multi
|
||||
|
@ -39,9 +42,11 @@
|
|||
|
||||
(current-command-line-arguments (apply vector-immutable args))
|
||||
|
||||
(unless (null? (extra-collection-dirs))
|
||||
(current-library-collection-paths (append (extra-collection-dirs)
|
||||
(current-library-collection-paths))))
|
||||
(current-library-collection-paths (append (extra-collection-dirs)
|
||||
(if (install-dir)
|
||||
(list (install-dir))
|
||||
'())
|
||||
(current-library-collection-paths)))
|
||||
|
||||
(define r6rs-read-syntax
|
||||
(case-lambda
|
||||
|
@ -142,9 +147,12 @@
|
|||
(cddr name))]
|
||||
[else name]))])
|
||||
(apply build-path
|
||||
(if (install-all-users)
|
||||
(find-collects-dir)
|
||||
(find-user-collects-dir))
|
||||
(cond [(install-dir)
|
||||
=> values]
|
||||
[(install-all-users)
|
||||
(find-collects-dir)]
|
||||
[else
|
||||
(find-user-collects-dir)])
|
||||
(let loop ([name name])
|
||||
(cond
|
||||
[(and (pair? (cdr name))
|
||||
|
|
|
@ -165,6 +165,11 @@ instead (see @racket[find-collects-dir]):
|
|||
|
||||
@commandline{plt-r6rs --install --all-users @nonterm{libraries-file}}
|
||||
|
||||
You may as well specify an arbitrary collections directory by using
|
||||
the @DFlag{collections} flag:
|
||||
|
||||
@commandline{plt-r6rs --install --collections @nonterm{directory} @nonterm{libraries-file}}
|
||||
|
||||
See @secref["libpaths"] for information on how @|r6rs| library names
|
||||
are turned into collection-based module paths, which determines where
|
||||
the files are written. Libraries installed by @exec{plt-r6rs
|
||||
|
|
Loading…
Reference in New Issue
Block a user