Hi!

I would like to be able to install into arbitrary directories with
"plt-r6rs --install".

Attached is a proposed patch that adds this feature, adding a
`--collects <dir>' command-line option. If this feature is deemed
worthwhile, I will try to add documentation to the patch.

diff --git a/collects/r6rs/run.rkt b/collects/r6rs/run.rkt
index 2b3b7c3..bd4b787 100644
--- a/collects/r6rs/run.rkt
+++ b/collects/r6rs/run.rkt
@@ -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
@@ -142,9 +145,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))
Regards, Rotty
-- 
Andreas Rottmann -- <http://rotty.yi.org/>
_________________________________________________
  For list-related administrative tasks:
  http://list.cs.brown.edu/mailman/listinfo/plt-dev

Reply via email to