diff options
| author | Alex Kost <alezost@gmail.com> | 2016-07-27 14:55:50 +0300 |
|---|---|---|
| committer | Alex Kost <alezost@gmail.com> | 2016-07-30 18:17:03 +0300 |
| commit | a82a201a8d8b324d3e4f85c0faab02cce04f7b28 (patch) | |
| tree | bf1b7b17c38aeba8b4c823a6f05f103d7ed79a00 | |
| parent | 6661db4e97d59bbf6c13981be774c28e2a0aaa7d (diff) | |
emacs: Disable grafts when dry-run is enabled.
* emacs/guix-main.scm (process-package-actions): Set grafting according
to 'dry-run?'.
* guix/scripts.scm (build-package): Disable grafts when 'dry-run?' is #t.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
| -rw-r--r-- | emacs/guix-main.scm | 20 | ||||
| -rw-r--r-- | guix/scripts.scm | 9 |
2 files changed, 17 insertions, 12 deletions
diff --git a/emacs/guix-main.scm b/emacs/guix-main.scm index cbf7cdc4747..040932f3072 100644 --- a/emacs/guix-main.scm +++ b/emacs/guix-main.scm | |||
| @@ -46,6 +46,7 @@ | |||
| 46 | (guix) | 46 | (guix) |
| 47 | (guix combinators) | 47 | (guix combinators) |
| 48 | (guix git-download) | 48 | (guix git-download) |
| 49 | (guix grafts) | ||
| 49 | (guix packages) | 50 | (guix packages) |
| 50 | (guix profiles) | 51 | (guix profiles) |
| 51 | (guix licenses) | 52 | (guix licenses) |
| @@ -930,15 +931,16 @@ OUTPUTS is a list of package outputs (may be an empty list)." | |||
| 930 | (new-manifest (manifest-perform-transaction | 931 | (new-manifest (manifest-perform-transaction |
| 931 | manifest transaction))) | 932 | manifest transaction))) |
| 932 | (unless (and (null? install) (null? remove)) | 933 | (unless (and (null? install) (null? remove)) |
| 933 | (with-store store | 934 | (parameterize ((%graft? (not dry-run?))) |
| 934 | (set-build-options store | 935 | (with-store store |
| 935 | #:print-build-trace #f | 936 | (set-build-options store |
| 936 | #:use-substitutes? use-substitutes?) | 937 | #:print-build-trace #f |
| 937 | (show-manifest-transaction store manifest transaction | 938 | #:use-substitutes? use-substitutes?) |
| 938 | #:dry-run? dry-run?) | 939 | (show-manifest-transaction store manifest transaction |
| 939 | (build-and-use-profile store profile new-manifest | 940 | #:dry-run? dry-run?) |
| 940 | #:use-substitutes? use-substitutes? | 941 | (build-and-use-profile store profile new-manifest |
| 941 | #:dry-run? dry-run?))))) | 942 | #:use-substitutes? use-substitutes? |
| 943 | #:dry-run? dry-run?)))))) | ||
| 942 | 944 | ||
| 943 | (define (delete-generations* profile generations) | 945 | (define (delete-generations* profile generations) |
| 944 | "Delete GENERATIONS from PROFILE. | 946 | "Delete GENERATIONS from PROFILE. |
diff --git a/guix/scripts.scm b/guix/scripts.scm index d84375f570c..bbee50bc3dc 100644 --- a/guix/scripts.scm +++ b/guix/scripts.scm | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2014 Deck Pickard <deck.r.pickard@gmail.com> | 3 | ;;; Copyright © 2014 Deck Pickard <deck.r.pickard@gmail.com> |
| 4 | ;;; Copyright © 2015 Alex Kost <alezost@gmail.com> | 4 | ;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com> |
| 5 | ;;; | 5 | ;;; |
| 6 | ;;; This file is part of GNU Guix. | 6 | ;;; This file is part of GNU Guix. |
| 7 | ;;; | 7 | ;;; |
| @@ -19,6 +19,7 @@ | |||
| 19 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | 19 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 20 | 20 | ||
| 21 | (define-module (guix scripts) | 21 | (define-module (guix scripts) |
| 22 | #:use-module (guix grafts) | ||
| 22 | #:use-module (guix utils) | 23 | #:use-module (guix utils) |
| 23 | #:use-module (guix ui) | 24 | #:use-module (guix ui) |
| 24 | #:use-module (guix store) | 25 | #:use-module (guix store) |
| @@ -105,11 +106,13 @@ true." | |||
| 105 | #:rest build-options) | 106 | #:rest build-options) |
| 106 | "Build PACKAGE using BUILD-OPTIONS acceptable by 'set-build-options'. | 107 | "Build PACKAGE using BUILD-OPTIONS acceptable by 'set-build-options'. |
| 107 | Show what and how will/would be built." | 108 | Show what and how will/would be built." |
| 108 | (mbegin %store-monad | 109 | (mlet %store-monad ((grafting? ((lift0 %graft? %store-monad)))) |
| 109 | (apply set-build-options* | 110 | (apply set-build-options* |
| 110 | #:use-substitutes? use-substitutes? | 111 | #:use-substitutes? use-substitutes? |
| 111 | (strip-keyword-arguments '(#:dry-run?) build-options)) | 112 | (strip-keyword-arguments '(#:dry-run?) build-options)) |
| 112 | (mlet %store-monad ((derivation (package->derivation package))) | 113 | (mlet %store-monad ((derivation (package->derivation |
| 114 | package #:graft? (and (not dry-run?) | ||
| 115 | grafting?)))) | ||
| 113 | (mbegin %store-monad | 116 | (mbegin %store-monad |
| 114 | (maybe-build (list derivation) | 117 | (maybe-build (list derivation) |
| 115 | #:use-substitutes? use-substitutes? | 118 | #:use-substitutes? use-substitutes? |
