summaryrefslogtreecommitdiff
path: root/guix/scripts/package.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-01-09 23:06:54 +0100
committerLudovic Courtès <ludo@gnu.org>2017-01-11 10:13:32 +0100
commit0c8491cbbead8d04b84714ee4f970f1f1c7be352 (patch)
treeae0c3546dbf28c91d5989d43f73a5f29249524cb /guix/scripts/package.scm
parentc490a0b03768231d15f6b9b9df70a92e8fa6a9cb (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/package.scm')
-rw-r--r--guix/scripts/package.scm31
1 files changed, 16 insertions, 15 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 90e7fa2298..70e68efee9 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
;;; Copyright © 2013, 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2014, 2016 Alex Kost <alezost@gmail.com>
@@ -207,19 +207,20 @@ specified in MANIFEST, a manifest object."
#:use-substitutes? use-substitutes?
#:dry-run? dry-run?)
- (cond
- (dry-run? #t)
- ((and (file-exists? profile)
- (and=> (readlink* profile) (cut string=? prof <>)))
- (format (current-error-port) (_ "nothing to be done~%")))
- (else
- (let* ((number (generation-number profile))
-
- ;; Always use NUMBER + 1 for the new profile, possibly
- ;; overwriting a "previous future generation".
- (name (generation-file-name profile (+ 1 number))))
- (and (build-derivations store (list prof-drv))
- (let* ((entries (manifest-entries manifest))
+ (or dry-run?
+ (match (build-derivations store (list prof-drv))
+ ((prof)
+ (cond
+ ((and (file-exists? profile)
+ (and=> (readlink* profile) (cut string=? prof <>)))
+ (format (current-error-port) (_ "nothing to be done~%")))
+ (else
+ (let* ((number (generation-number profile))
+
+ ;; Always use NUMBER + 1 for the new profile, possibly
+ ;; overwriting a "previous future generation".
+ (name (generation-file-name profile (+ 1 number)))
+ (entries (manifest-entries manifest))
(count (length entries)))
(switch-symlinks name prof)
(switch-symlinks profile name)
@@ -230,7 +231,7 @@ specified in MANIFEST, a manifest object."
count)
count)
(display-search-paths entries (list profile)
- #:kind 'prefix))))))))
+ #:kind 'prefix)))))))))
;;;