guix-commits
[Top][All Lists]
Advanced

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

01/05: emacs: Use 'build-and-use-profile' from (guix scripts package).


From: Alex Kost
Subject: 01/05: emacs: Use 'build-and-use-profile' from (guix scripts package).
Date: Mon, 04 Apr 2016 18:16:20 +0000

alezost pushed a commit to branch master
in repository guix.

commit 5f2928456bf70a6869b0a415ca60b6cc1e43214c
Author: Alex Kost <address@hidden>
Date:   Fri Mar 25 11:27:18 2016 +0300

    emacs: Use 'build-and-use-profile' from (guix scripts package).
    
    * guix/scripts/package.scm: Export 'build-and-use-profile'.
    * emacs/guix-main.scm (process-package-actions): Use it.
---
 emacs/guix-main.scm      |   36 ++++++++----------------------------
 guix/scripts/package.scm |    3 ++-
 2 files changed, 10 insertions(+), 29 deletions(-)

diff --git a/emacs/guix-main.scm b/emacs/guix-main.scm
index 86cedfd..bcff9ce 100644
--- a/emacs/guix-main.scm
+++ b/emacs/guix-main.scm
@@ -917,34 +917,14 @@ OUTPUTS is a list of package outputs (may be an empty 
list)."
                         manifest transaction)))
     (unless (and (null? install) (null? remove))
       (with-store store
-        (let* ((derivation (run-with-store store
-                             (mbegin %store-monad
-                               (set-guile-for-build (default-guile))
-                               (profile-derivation new-manifest))))
-               (derivations (list derivation))
-               (new-profile (derivation->output-path derivation)))
-          (set-build-options store
-                             #:print-build-trace #f
-                             #:use-substitutes? use-substitutes?)
-          (show-manifest-transaction store manifest transaction
-                                     #:dry-run? dry-run?)
-          (show-what-to-build store derivations
-                              #:use-substitutes? use-substitutes?
-                              #:dry-run? dry-run?)
-          (unless dry-run?
-            (let ((name (generation-file-name
-                         profile
-                         (+ 1 (generation-number profile)))))
-              (and (build-derivations store derivations)
-                   (let* ((entries (manifest-entries new-manifest))
-                          (count   (length entries)))
-                     (switch-symlinks name new-profile)
-                     (switch-symlinks profile name)
-                     (format #t (N_ "~a package in profile~%"
-                                    "~a packages in profile~%"
-                                    count)
-                             count)
-                     (display-search-paths entries (list profile)))))))))))
+        (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/package.scm b/guix/scripts/package.scm
index 1d88b33..697afc1 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -47,7 +47,8 @@
   #:autoload   (gnu packages base) (canonical-package)
   #:autoload   (gnu packages guile) (guile-2.0)
   #:autoload   (gnu packages bootstrap) (%bootstrap-guile)
-  #:export (delete-generations
+  #:export (build-and-use-profile
+            delete-generations
             display-search-paths
             guix-package))
 



reply via email to

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