archive: Use 'with-build-handler'.
* guix/scripts/archive.scm (export-from-store): Remove call to 'show-what-to-build' and dry-run? condition. (guix-archive): Wrap 'cond' in 'with-build-handler'.master
parent
eb019af8d8
commit
2d5ee2c6e8
|
@ -259,12 +259,7 @@ build and a list of store files to transfer."
|
|||
resulting archive to the standard output port."
|
||||
(let-values (((drv files)
|
||||
(options->derivations+files store opts)))
|
||||
(show-what-to-build store drv
|
||||
#:use-substitutes? (assoc-ref opts 'substitutes?)
|
||||
#:dry-run? (assoc-ref opts 'dry-run?))
|
||||
|
||||
(if (or (assoc-ref opts 'dry-run?)
|
||||
(build-derivations store drv))
|
||||
(if (build-derivations store drv)
|
||||
(export-paths store files (current-output-port)
|
||||
#:recursive? (assoc-ref opts 'export-recursive?))
|
||||
(leave (G_ "unable to export the given packages~%")))))
|
||||
|
@ -382,6 +377,11 @@ output port."
|
|||
(with-status-verbosity (assoc-ref opts 'verbosity)
|
||||
(with-store store
|
||||
(set-build-options-from-command-line store opts)
|
||||
(with-build-handler
|
||||
(build-notifier #:use-substitutes?
|
||||
(assoc-ref opts 'substitutes?)
|
||||
#:dry-run?
|
||||
(assoc-ref opts 'dry-run?))
|
||||
(cond ((assoc-ref opts 'export)
|
||||
(export-from-store store opts))
|
||||
((assoc-ref opts 'import)
|
||||
|
@ -400,4 +400,4 @@ output port."
|
|||
(else
|
||||
(leave
|
||||
(G_ "either '--export' or '--import' \
|
||||
must be specified~%"))))))))))))
|
||||
must be specified~%")))))))))))))
|
||||
|
|
Reference in New Issue