From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: [PATCH] emacs: Add support for deleting generations. Date: Mon, 06 Oct 2014 00:04:07 +0400 Message-ID: <87bnpqjnbc.fsf@gmail.com> References: <87k3719v7p.fsf@gmail.com> <87a97taixl.fsf@gmail.com> <87sil2rbly.fsf@gnu.org> <87tx5idn7f.fsf_-_@gmail.com> <87egwlkcy1.fsf@gnu.org> <87ppg5el2i.fsf@gmail.com> <87d2c5h4if.fsf@gnu.org> <87lhqsev1d.fsf@gmail.com> <877g2c74xh.fsf@gnu.org> <87ha1gds3w.fsf@gmail.com> <8761hsmxkl.fsf@gnu.org> <87zjf4d1mh.fsf@gmail.com> <87mwb0b3fq.fsf@gnu.org> <87ha17ctyv.fsf_-_@gmail.com> <87ppfs6gxk.fsf@gnu.org> <87wq8fk979.fsf_-_@gmail.com> <87eguninyx.fsf@gnu.org> <87k34ekic2.fsf_-_@gmail.com> <874mviek0l.fsf@gnu.org> <87fvf2jrzc.fsf@gmail.com> <87r3ymcohx.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xas2U-0001EQ-A1 for guix-devel@gnu.org; Sun, 05 Oct 2014 16:04:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xas2L-0005Ly-9l for guix-devel@gnu.org; Sun, 05 Oct 2014 16:04:18 -0400 In-Reply-To: <87r3ymcohx.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sun, 05 Oct 2014 21:20:26 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s (2014-10-05 23:20 +0400) wrote: > Alex Kost skribis: > >> Thanks for the comments, the updated patch is attached. I also fixed >> another =E2=80=9Ci.e.=E2=80=9D thing there and used =E2=80=98with-store= =E2=80=99 in >> =E2=80=98process-package-actions=E2=80=99 procedure as well. Is it OK t= o make these >> changes in this commit (the =E2=80=98with-store=E2=80=99 change is small= but many lines >> were changed because of the new indentation)? > > The =E2=80=98with-store=E2=80=99 change in =E2=80=98process-package-actio= ns=E2=80=99 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 =E2=80=98process-package-= actions=E2=80=99. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-emacs-Use-with-store-in-process-package-actions.patch >From 6ef2a8b88007840ffa6648563356021770bbb6e6 Mon Sep 17 00:00:00 2001 From: Alex Kost 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 --=-=-=--