From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] Emacs interface for Guix Date: Tue, 12 Aug 2014 21:50:00 +0200 Message-ID: <87d2c5h4if.fsf@gnu.org> References: <87k3719v7p.fsf@gmail.com> <87r419fa50.fsf@gnu.org> <87fvho9fqm.fsf@gmail.com> <87a97taixl.fsf@gmail.com> <87sil2rbly.fsf@gnu.org> <87tx5idn7f.fsf_-_@gmail.com> <87egwlkcy1.fsf@gnu.org> <87ppg5el2i.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHI5F-0004Q1-La for guix-devel@gnu.org; Tue, 12 Aug 2014 15:50:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHI56-0007ar-5Q for guix-devel@gnu.org; Tue, 12 Aug 2014 15:50:13 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:60368) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHI55-0007XS-NP for guix-devel@gnu.org; Tue, 12 Aug 2014 15:50:04 -0400 In-Reply-To: <87ppg5el2i.fsf@gmail.com> (Alex Kost's message of "Tue, 12 Aug 2014 20:20:37 +0400") 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: Alex Kost Cc: guix-devel@gnu.org Alex Kost skribis: > Ludovic Court=C3=A8s (2014-08-12 18:19 +0400) wrote: [...] >> Perfect. I=E2=80=99ve pushed it, followed by a patch that changes >> guix/scripts/package.scm to use =E2=80=98manifest-add=E2=80=99 (comments= welcome.) > > Thanks, you forgot to delete =E2=80=98same-package?=E2=80=99 from =E2=80= =98guix-package=E2=80=99 > [=E2=80=98process-actions=E2=80=99] in your commit =E2=80=93 it is a part= of =E2=80=98manifest-add=E2=80=99 now. Oops, fixed now. >>> From 5fd45b3f4216921837f522d56b20c4be0a58fe8e Mon Sep 17 00:00:00 2001 >>> From: Alex Kost >>> Date: Tue, 12 Aug 2014 13:54:23 +0400 >>> Subject: [PATCH 2/2] guix package: Add 'process-package-actions'. >>> >>> * guix/scripts/package.scm (process-package-actions): New procedure. >>> (guix-package): Use it. >>> [ensure-default-profile]: Move to top-level. >>> [substitutes?]: New variable. >>> [same-package?]: Remove. >>> (options->installable, options->removable): Change according to >>> 'process-package-actions'. >> >> This patch would need to be rebased on top of f48624f. >> >> Were you planning on using =E2=80=98process-package-actions=E2=80=99 in = the Emacs >> interface? > > Yes, actually I've been using that function for a couple of weeks, I > just didn't update "guix.el" repo for that. But your suggestion below > is definitely better. Cool. >> That seems like a coarse-grain and clumsy interface. Perhaps there are >> tinier parts of it that could be moved to (guix profiles)? For >> instance, there=E2=80=99s no =E2=80=98manifest-upgrade=E2=80=99 at the m= oment. > > I think =E2=80=98manifest-add=E2=80=99 already does what =E2=80=98manifes= t-upgrade=E2=80=99 would do: it > replaces entries with the same name. So if there is installed > =E2=80=9Cguile-2.0.11:out=E2=80=9D and a user installs =E2=80=9Cguile-1.8= .8:out=E2=80=9D, the previously > installed guile is removed from manifest. I thought it's intended > behaviour and that's why =E2=80=98options->installable=E2=80=99 combines = =E2=80=9Cto-install=E2=80=9D > and =E2=80=9Cto-upgrade=E2=80=9D options. Could you explain what =E2=80= =98manifest-upgrade=E2=80=99 > should do? Oh you=E2=80=99re right, currently upgrade and install are basically the sa= me thing. >> What about introducing a type that would contain >> a list of packages to install, to remove, and to upgrade, and we could d= o: > > I think only =E2=80=9Cinstall=E2=80=9D part should contain a list of pack= ages (or > (PACKAGE OUTPUT) things). Upgrading and removing can be performed on > obsolete packages, so only a package specification of an installed > package is known in such cases. Perhaps any pattern (package (with > "out" output), (package output), name specification) should be accepted. The arguments should be the same as (or compatible) for =E2=80=98manifest-a= dd=E2=80=99 and =E2=80=98manifest-remove=E2=80=99. So the list of packages could be installed could be a list of (PACKAGE OUTPUT) as you note. The list of packages to upgrade could a list of (PACKAGE OUTPUT) as well, computed by =E2=80=98guix package=E2=80=99 or guix.el. (The difficul= ty here is that (guix profiles) should not depend on (gnu packages).) The list of packages to remove should be a list of . > So there will be =E2=80=98make-manifest-transaction=E2=80=99 function wit= h #:install, > #:upgrade, #:remove keys. Do I understand it right? Rather, use (define-record-type* ...), so we can then write: (manifest-transaction (install lst1) (remove lst2) ...) >> ;; Show what will/would be installed, removed, etc. >> (show-transaction manifest transaction #:dry-run? bool) >> >> ;; Do the installation/removal/upgrades listed in TRANSACTION, and >> ;; return the new manifest. >> (manifest-perform-transaction manifest transaction) > > So =E2=80=98manifest-perform-transaction=E2=80=99 will open connection? = If so, > shouldn't it accept '#:dry-run' and '#:use-substitutes?' keys? No, it would just return the new manifest, built by successive calls to =E2=80=98manifest-add=E2=80=99 and =E2=80=98manifest-remove=E2=80=99. Very= simple. The actual profile is still built with =E2=80=98profile-derivation=E2=80=99. Ludo=E2=80=99.