mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 13:28:12 -05:00
ui: Honor --no-* options passed via $GUIX_BUILD_OPTIONS.
Reported by Alex Kost <alezost@gmail.com> at <http://lists.gnu.org/archive/html/guix-devel/2015-02/msg00702.html>. * guix/ui.scm (parse-command-line)[parse-options-from]: Add 'seeds' parameter. Thread the result of the first 'parse-options-from' call to the second.
This commit is contained in:
parent
b3f213893b
commit
cf6ce3e6ef
2 changed files with 16 additions and 3 deletions
10
guix/ui.scm
10
guix/ui.scm
|
@ -769,7 +769,7 @@ (define* (parse-command-line args options seeds
|
|||
|
||||
ARGUMENT-HANDLER is called for non-option arguments, like the 'operand-proc'
|
||||
parameter of 'args-fold'."
|
||||
(define (parse-options-from args)
|
||||
(define (parse-options-from args seeds)
|
||||
;; Actual parsing takes place here.
|
||||
(apply args-fold* args options
|
||||
(lambda (opt name arg . rest)
|
||||
|
@ -777,8 +777,12 @@ (define (parse-options-from args)
|
|||
argument-handler
|
||||
seeds))
|
||||
|
||||
(append (parse-options-from args)
|
||||
(parse-options-from (environment-build-options))))
|
||||
(call-with-values
|
||||
(lambda ()
|
||||
(parse-options-from (environment-build-options) seeds))
|
||||
(lambda seeds
|
||||
;; ARGS take precedence over what the environment variable specifies.
|
||||
(parse-options-from args seeds))))
|
||||
|
||||
(define (show-guix-usage)
|
||||
(format (current-error-port)
|
||||
|
|
|
@ -82,6 +82,15 @@ (define-syntax-rule (with-environment-variable variable value body ...)
|
|||
%standard-build-options
|
||||
(list '()))))
|
||||
|
||||
(test-equal "parse-command-line and --no options"
|
||||
'((argument . "foo")
|
||||
(substitutes? . #f)) ;takes precedence
|
||||
|
||||
(with-environment-variable "GUIX_BUILD_OPTIONS" "--no-substitutes"
|
||||
(parse-command-line '("foo")
|
||||
%standard-build-options
|
||||
(list '((substitutes? . #t))))))
|
||||
|
||||
(test-assert "fill-paragraph"
|
||||
(every (lambda (column)
|
||||
(every (lambda (width)
|
||||
|
|
Loading…
Reference in a new issue