mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 22:08:16 -05:00
pack: Use 'with-build-handler'.
* guix/scripts/pack.scm (guix-pack): Wrap 'parameterize' in 'with-build-handler'. Remove explicit call to 'show-what-to-build'. Call 'build-derivations' regardless of whether OPTS contains 'dry-run?'.
This commit is contained in:
parent
bdda46a67d
commit
5f5e9a5cd6
1 changed files with 97 additions and 99 deletions
|
@ -1022,6 +1022,10 @@ (define with-provenance
|
|||
;; Set the build options before we do anything else.
|
||||
(set-build-options-from-command-line store opts)
|
||||
|
||||
(with-build-handler (build-notifier #:dry-run?
|
||||
(assoc-ref opts 'dry-run?)
|
||||
#:use-substitutes?
|
||||
(assoc-ref opts 'substitutes?))
|
||||
(parameterize ((%graft? (assoc-ref opts 'graft?))
|
||||
(%guile-for-build (package-derivation
|
||||
store
|
||||
|
@ -1030,8 +1034,7 @@ (define with-provenance
|
|||
(canonical-package guile-2.2))
|
||||
(assoc-ref opts 'system)
|
||||
#:graft? (assoc-ref opts 'graft?))))
|
||||
(let* ((dry-run? (assoc-ref opts 'dry-run?))
|
||||
(derivation? (assoc-ref opts 'derivation-only?))
|
||||
(let* ((derivation? (assoc-ref opts 'derivation-only?))
|
||||
(relocatable? (assoc-ref opts 'relocatable?))
|
||||
(proot? (eq? relocatable? 'proot))
|
||||
(manifest (let ((manifest (manifest-from-args store opts)))
|
||||
|
@ -1109,15 +1112,10 @@ (define (lookup-package package)
|
|||
#:archiver
|
||||
archiver)))
|
||||
(mbegin %store-monad
|
||||
(munless derivation?
|
||||
(show-what-to-build* (list drv)
|
||||
#:use-substitutes?
|
||||
(assoc-ref opts 'substitutes?)
|
||||
#:dry-run? dry-run?))
|
||||
(mwhen derivation?
|
||||
(return (format #t "~a~%"
|
||||
(derivation-file-name drv))))
|
||||
(munless (or derivation? dry-run?)
|
||||
(munless derivation?
|
||||
(built-derivations (list drv))
|
||||
(mwhen gc-root
|
||||
(register-root* (match (derivation->output-paths drv)
|
||||
|
@ -1126,4 +1124,4 @@ (define (lookup-package package)
|
|||
gc-root))
|
||||
(return (format #t "~a~%"
|
||||
(derivation->output-path drv))))))
|
||||
#:system (assoc-ref opts 'system))))))))
|
||||
#:system (assoc-ref opts 'system)))))))))
|
||||
|
|
Loading…
Reference in a new issue