diff options
author | nebuli <nebu@kipple> | 2014-12-05 01:28:12 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2014-12-06 16:03:49 +0100 |
commit | 847391fe6229bc9b989939470b4a84bd82c75088 (patch) | |
tree | d88710603c81a30cf80fc8aa48d872bbf254822b /guix/scripts/environment.scm | |
parent | 6496de9bc2deb30306922ace8498afa237dee1b1 (diff) | |
download | gnu-guix-847391fe6229bc9b989939470b4a84bd82c75088.tar gnu-guix-847391fe6229bc9b989939470b4a84bd82c75088.tar.gz |
guix: scripts: Parse $GUIX_BUILD_OPTIONS separately.
Appending to "raw" args broke optional parameters in 'guix package -I'
and 'guix package -A', and possibly other places. Therefore, switch to
parsing each set of options on its own and append resulting alists
together afterwards.
* guix/scripts/archive.scm (parse-options-from): Rename from
(parse-options) and add explicit argument. New form of (parse-options)
using its old algorithm via -from function.
* guix/scripts/build.scm: Ditto.
* guix/scripts/environment.scm: Ditto.
* guix/scripts/package.scm: Ditto.
* guix/scripts/system.scm: Ditto.
* tests/guix-package.sh: Add test.
* doc/guix.texi (Invoking guix build): Make it clear that the options
are parsed independently.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'guix/scripts/environment.scm')
-rw-r--r-- | guix/scripts/environment.scm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index a309dfa362..c388b0c52c 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -213,8 +213,13 @@ packages." ;; Entry point. (define (guix-environment . args) (define (parse-options) - (args-fold* (append args (environment-build-options)) - %options + ;; Return the alist of option values. + (append (parse-options-from args) + (parse-options-from (environment-build-options)))) + + (define (parse-options-from args) + ;; Actual parsing takes place here. + (args-fold* args %options (lambda (opt name arg result) (leave (_ "~A: unrecognized option~%") name)) (lambda (arg result) |