guix system: Honor the build options in 'delete-generations'.
Until now, 'guix system delete-generations' would ignore OPTS; for example, it would not enable #:print-extended-build-trace? & co., leading to suboptimal output. * guix/scripts/system.scm (process-command)[with-store*]: New macro. Use it for 'delete-generations', 'switch-generation', and 'roll-back'.
This commit is contained in:
parent
223cb7c6ef
commit
89bbcc80d7
1 changed files with 9 additions and 5 deletions
|
@ -1189,6 +1189,11 @@ resulting from command-line parsing."
|
||||||
(define (process-command command args opts)
|
(define (process-command command args opts)
|
||||||
"Process COMMAND, one of the 'guix system' sub-commands. ARGS is its
|
"Process COMMAND, one of the 'guix system' sub-commands. ARGS is its
|
||||||
argument list and OPTS is the option alist."
|
argument list and OPTS is the option alist."
|
||||||
|
(define-syntax-rule (with-store* store exp ...)
|
||||||
|
(with-store store
|
||||||
|
(set-build-options-from-command-line store opts)
|
||||||
|
exp ...))
|
||||||
|
|
||||||
(case command
|
(case command
|
||||||
;; The following commands do not need to use the store, and they do not need
|
;; The following commands do not need to use the store, and they do not need
|
||||||
;; an operating system configuration file.
|
;; an operating system configuration file.
|
||||||
|
@ -1213,22 +1218,20 @@ argument list and OPTS is the option alist."
|
||||||
(() #f)
|
(() #f)
|
||||||
((pattern) pattern)
|
((pattern) pattern)
|
||||||
(x (leave (G_ "wrong number of arguments~%"))))))
|
(x (leave (G_ "wrong number of arguments~%"))))))
|
||||||
(with-store store
|
(with-store* store
|
||||||
(delete-matching-generations store %system-profile pattern)
|
(delete-matching-generations store %system-profile pattern)
|
||||||
(reinstall-bootloader store (generation-number %system-profile)))))
|
(reinstall-bootloader store (generation-number %system-profile)))))
|
||||||
((switch-generation)
|
((switch-generation)
|
||||||
(let ((pattern (match args
|
(let ((pattern (match args
|
||||||
((pattern) pattern)
|
((pattern) pattern)
|
||||||
(x (leave (G_ "wrong number of arguments~%"))))))
|
(x (leave (G_ "wrong number of arguments~%"))))))
|
||||||
(with-store store
|
(with-store* store
|
||||||
(set-build-options-from-command-line store opts)
|
|
||||||
(switch-to-system-generation store pattern))))
|
(switch-to-system-generation store pattern))))
|
||||||
((roll-back)
|
((roll-back)
|
||||||
(let ((pattern (match args
|
(let ((pattern (match args
|
||||||
(() "")
|
(() "")
|
||||||
(x (leave (G_ "wrong number of arguments~%"))))))
|
(x (leave (G_ "wrong number of arguments~%"))))))
|
||||||
(with-store store
|
(with-store* store
|
||||||
(set-build-options-from-command-line store opts)
|
|
||||||
(roll-back-system store))))
|
(roll-back-system store))))
|
||||||
;; The following commands need to use the store, and they also
|
;; The following commands need to use the store, and they also
|
||||||
;; need an operating system configuration file.
|
;; need an operating system configuration file.
|
||||||
|
@ -1297,6 +1300,7 @@ argument list and OPTS is the option alist."
|
||||||
|
|
||||||
;;; Local Variables:
|
;;; Local Variables:
|
||||||
;;; eval: (put 'call-with-service-upgrade-info 'scheme-indent-function 1)
|
;;; eval: (put 'call-with-service-upgrade-info 'scheme-indent-function 1)
|
||||||
|
;;; eval: (put 'with-store* 'scheme-indent-function 1)
|
||||||
;;; End:
|
;;; End:
|
||||||
|
|
||||||
;;; system.scm ends here
|
;;; system.scm ends here
|
||||||
|
|
Reference in a new issue