Ludovic Courtès (2014-10-05 23:20 +0400) wrote:

> Alex Kost <alez...@gmail.com> skribis:
>
>> Thanks for the comments, the updated patch is attached.  I also fixed
>> another “i.e.” thing there and used ‘with-store’ in
>> ‘process-package-actions’ procedure as well.  Is it OK to make these
>> changes in this commit (the ‘with-store’ change is small but many lines
>> were changed because of the new indentation)?
>
> The ‘with-store’ change in ‘process-package-actions’ would be better in
> a separate patch, because it fixes an unrelated file descriptor leak.
>
> Other than that the patch looks good to me, thank you!

Pushed, thanks.  Here is another patch for fixing ‘process-package-actions’.

>From 6ef2a8b88007840ffa6648563356021770bbb6e6 Mon Sep 17 00:00:00 2001
From: Alex Kost <alez...@gmail.com>
Date: Sun, 5 Oct 2014 23:52:52 +0400
Subject: [PATCH] emacs: Use 'with-store' in 'process-package-actions'.

* emacs/guix-main.scm (process-package-actions): Use 'with-store'.
---
 emacs/guix-main.scm | 50 +++++++++++++++++++++++++-------------------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/emacs/guix-main.scm b/emacs/guix-main.scm
index 7dbfa61..b85bb5c 100644
--- a/emacs/guix-main.scm
+++ b/emacs/guix-main.scm
@@ -790,31 +790,31 @@ 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))
-      (let* ((store (open-connection))
-             (derivation (run-with-store
-                          store (profile-derivation new-manifest)))
-             (derivations (list derivation))
-             (new-profile (derivation->output-path derivation)))
-        (set-build-options store
-                           #:use-substitutes? use-substitutes?)
-        (manifest-show-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)))))))))
+      (with-store store
+        (let* ((derivation (run-with-store store
+                             (profile-derivation new-manifest)))
+               (derivations (list derivation))
+               (new-profile (derivation->output-path derivation)))
+          (set-build-options store
+                             #:use-substitutes? use-substitutes?)
+          (manifest-show-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))))))))))
 
 (define (delete-generations* profile generations)
   "Delete GENERATIONS from PROFILE.
-- 
2.1.2

Reply via email to