>From d580937b4263c40234ea57c11ce18ca247db3a2f Mon Sep 17 00:00:00 2001 From: Mario Domenech Goulart Date: Sat, 11 Feb 2023 15:49:42 +0100 Subject: [PATCH 2/2] chicken-install: Add -location command line option The -location (short: -l) command line option is equivalent to the `location' form in setup.defaults. The command line option takes precedence over the form in setup.defaults. --- NEWS | 3 +++ chicken-install.scm | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/NEWS b/NEWS index a314faf3..ec7b4cb5 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,9 @@ collisions with source files on case-insensitive file systems like on MacOS (#1753, reported by Kon Lovett). - chicken-install now caches eggs installed from local locations. + - chicken-install now accepts the -location command line option + (short: -l) to specify local directories where to get egg sources + from. - Compiler - When emitting types files, the output list is now sorted, to ensure diff --git a/chicken-install.scm b/chicken-install.scm index 506f9771..4a6eb9b1 100644 --- a/chicken-install.scm +++ b/chicken-install.scm @@ -1081,6 +1081,9 @@ usage: chicken-install [OPTION ...] [NAME[:VERSION] ...] -force don't ask, install even if versions don't match -k -keep keep temporary files -s -sudo use external command to elevate privileges for filesystem operations + -l -location DIRECTORY get egg sources from DIRECTORY. May be provided multiple times. + Locations specified on the command line have precedence over the + ones specified in setup.defaults. -r -retrieve only retrieve egg into cache directory, don't install (giving `-r' more than once implies `-recursive') -recursive if `-retrieve' is given, retrieve also dependencies @@ -1177,6 +1180,13 @@ EOF ((member arg '("-s" "-sudo")) (set! sudo-install #t) (loop (cdr args))) + ((member arg '("-l" "-location")) + (when (null? (cdr args)) + (fprintf (current-error-port) "-l|-location: missing argument.~%") + (exit 1)) + (set! default-locations + (append (list (cadr args)) default-locations)) + (loop (cddr args))) ((member arg '("-n" "-no-install")) (set! no-install #t) (loop (cdr args))) -- 2.30.2