diff options
author | Ludovic Courtès <ludo@gnu.org> | 2017-01-09 23:06:54 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2017-01-11 10:13:32 +0100 |
commit | 0c8491cbbead8d04b84714ee4f970f1f1c7be352 (patch) | |
tree | ae0c3546dbf28c91d5989d43f73a5f29249524cb /guix/scripts.scm | |
parent | c490a0b03768231d15f6b9b9df70a92e8fa6a9cb (diff) |
Callers of 'build-derivations' & co. now honor its result.
* guix/profiles.scm (link-to-empty-profile): Use the result of
'build-derivations' instead of calling 'derivation->output-path'.
* guix/scripts.scm (build-package): Likewise, and use 'format' directly
instead of 'show-derivation-outputs'.
(build-package-source): Likewise.
* guix/scripts/archive.scm (export-from-store): Use result of
'build-derivations'.
* guix/scripts/build.scm (guix-build): Likewise. Use 'format' instead
of 'show-derivation-outputs'.
* guix/scripts/copy.scm (send-to-remote-host): Use result of
'build-derivations'.
* guix/scripts/package.scm (build-and-use-profile): Likewise.
* guix/upstream.scm (download-tarball): Likewise.
* guix/scripts/system.scm (reinstall-grub): Likewise.
(perform-action): Use result of 'maybe-build'.
Diffstat (limited to 'guix/scripts.scm')
-rw-r--r-- | guix/scripts.scm | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/guix/scripts.scm b/guix/scripts.scm index bbee50bc3d..e4e53229b4 100644 --- a/guix/scripts.scm +++ b/guix/scripts.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2014 Deck Pickard <deck.r.pickard@gmail.com> ;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com> ;;; @@ -29,6 +29,7 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-37) #:use-module (ice-9 match) + #:use-module (ice-9 format) #:export (args-fold* parse-command-line maybe-build @@ -90,7 +91,8 @@ parameter of 'args-fold'." (define* (maybe-build drvs #:key dry-run? use-substitutes?) "Show what will/would be built, and actually build DRVS, unless DRY-RUN? is -true." +true. Return #f when DRY-RUN? is true, and the list of store items actually +built otherwise." (with-monad %store-monad (>>= (show-what-to-build* drvs #:dry-run? dry-run? @@ -112,12 +114,14 @@ Show what and how will/would be built." (strip-keyword-arguments '(#:dry-run?) build-options)) (mlet %store-monad ((derivation (package->derivation package #:graft? (and (not dry-run?) - grafting?)))) - (mbegin %store-monad - (maybe-build (list derivation) - #:use-substitutes? use-substitutes? - #:dry-run? dry-run?) - (return (show-derivation-outputs derivation)))))) + grafting?))) + (items (maybe-build (list derivation) + #:use-substitutes? + use-substitutes? + #:dry-run? dry-run?))) + (unless dry-run? + (format #t "~{~a~%~}" items)) + (return (or dry-run? items))))) (define* (build-package-source package #:key dry-run? (use-substitutes? #t) @@ -129,11 +133,13 @@ Show what and how will/would be built." #:use-substitutes? use-substitutes? (strip-keyword-arguments '(#:dry-run?) build-options)) (mlet %store-monad ((derivation (origin->derivation - (package-source package)))) - (mbegin %store-monad - (maybe-build (list derivation) - #:use-substitutes? use-substitutes? - #:dry-run? dry-run?) - (return (show-derivation-outputs derivation)))))) + (package-source package))) + (items (maybe-build (list derivation) + #:use-substitutes? + use-substitutes? + #:dry-run? dry-run?))) + (unless dry-run? + (format #t "~{~a~%~}" items)) + (return (or dry-run? items))))) ;;; scripts.scm ends here |