guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: emacs: Disable grafts when dry-run is enabled.


From: Alex Kost
Subject: 01/01: emacs: Disable grafts when dry-run is enabled.
Date: Sat, 30 Jul 2016 15:24:15 +0000 (UTC)

alezost pushed a commit to branch master
in repository guix.

commit a82a201a8d8b324d3e4f85c0faab02cce04f7b28
Author: Alex Kost <address@hidden>
Date:   Wed Jul 27 14:55:50 2016 +0300

    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 <address@hidden>
---
 emacs/guix-main.scm |   20 +++++++++++---------
 guix/scripts.scm    |    9 ++++++---
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/emacs/guix-main.scm b/emacs/guix-main.scm
index cbf7cdc..040932f 100644
--- a/emacs/guix-main.scm
+++ b/emacs/guix-main.scm
@@ -46,6 +46,7 @@
  (guix)
  (guix combinators)
  (guix git-download)
+ (guix grafts)
  (guix packages)
  (guix profiles)
  (guix licenses)
@@ -930,15 +931,16 @@ OUTPUTS is a list of package outputs (may be an empty 
list)."
          (new-manifest (manifest-perform-transaction
                         manifest transaction)))
     (unless (and (null? install) (null? remove))
-      (with-store store
-        (set-build-options store
-                           #:print-build-trace #f
-                           #:use-substitutes? use-substitutes?)
-        (show-manifest-transaction store manifest transaction
-                                   #:dry-run? dry-run?)
-        (build-and-use-profile store profile new-manifest
-                               #:use-substitutes? use-substitutes?
-                               #:dry-run? dry-run?)))))
+      (parameterize ((%graft? (not dry-run?)))
+        (with-store store
+          (set-build-options store
+                             #:print-build-trace #f
+                             #:use-substitutes? use-substitutes?)
+          (show-manifest-transaction store manifest transaction
+                                     #:dry-run? dry-run?)
+          (build-and-use-profile store profile new-manifest
+                                 #:use-substitutes? use-substitutes?
+                                 #:dry-run? dry-run?))))))
 
 (define (delete-generations* profile generations)
   "Delete GENERATIONS from PROFILE.
diff --git a/guix/scripts.scm b/guix/scripts.scm
index d84375f..bbee50b 100644
--- a/guix/scripts.scm
+++ b/guix/scripts.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2014 Deck Pickard <address@hidden>
-;;; Copyright © 2015 Alex Kost <address@hidden>
+;;; Copyright © 2015, 2016 Alex Kost <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -19,6 +19,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (guix scripts)
+  #:use-module (guix grafts)
   #:use-module (guix utils)
   #:use-module (guix ui)
   #:use-module (guix store)
@@ -105,11 +106,13 @@ true."
                         #:rest build-options)
   "Build PACKAGE using BUILD-OPTIONS acceptable by 'set-build-options'.
 Show what and how will/would be built."
-  (mbegin %store-monad
+  (mlet %store-monad ((grafting? ((lift0 %graft? %store-monad))))
     (apply set-build-options*
            #:use-substitutes? use-substitutes?
            (strip-keyword-arguments '(#:dry-run?) build-options))
-    (mlet %store-monad ((derivation (package->derivation package)))
+    (mlet %store-monad ((derivation (package->derivation
+                                     package #:graft? (and (not dry-run?)
+                                                           grafting?))))
       (mbegin %store-monad
         (maybe-build (list derivation)
                      #:use-substitutes? use-substitutes?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]