From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] Implement guix-package --upgrade Date: Tue, 12 Feb 2013 16:16:05 +0100 Message-ID: <87y5etv9ze.fsf@gnu.org> References: <87vc9yxcre.fsf@tines.lan> <87a9r9zwrv.fsf@gnu.org> <87liaty5cy.fsf@tines.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:36555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5Hak-0002Ae-4s for bug-guix@gnu.org; Tue, 12 Feb 2013 10:16:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U5Hai-00082V-D5 for bug-guix@gnu.org; Tue, 12 Feb 2013 10:16:18 -0500 Received: from [2a01:e0b:1:123:ca0a:a9ff:fe03:271e] (port=41067 helo=xanadu.aquilenet.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5Hai-00081C-6d for bug-guix@gnu.org; Tue, 12 Feb 2013 10:16:16 -0500 In-Reply-To: <87liaty5cy.fsf@tines.lan> (Mark H. Weaver's message of "Tue, 12 Feb 2013 09:27:41 -0500") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Mark H Weaver Cc: bug-guix@gnu.org Mark H Weaver skribis: >> Mark H Weaver skribis: >>> + (upgrade (if (null? upgrade-regexps) >>> + '() >>> + (filter-map (match-lambda >>> + ((name _ _ _ _) >>> + (and (any (cut regexp-exec = <> name) >>> + upgrade-regexps) >>> + (find-package name))) >>> + (_ #f)) >>> + installed))) >> >> It=E2=80=99s actually slightly more complex: you need to select those pa= ckages >> that are installed and for which either a newer version is available >> (per =E2=80=98version-string>?=E2=80=99, see gnu-maintenance.scm; should= be moved to >> utils.scm), or the version is identical and the output path differs (for >> instance because one of its dependencies has changed.) > > Okay. I was relying on the fact that attempts to install a derivation > that's already installed will ultimately be ignored, and my (admittedly > simple) tests seem to suggest that it works properly, but perhaps this > approach will be too inefficient when the profile contains a large > number of packages. More importantly, you don=E2=80=99t want upgrade to downgrade. For instance, if guile-1.8.8 turns out to be before guile-2.0.7 in the package list, users who=E2=80=99ve installed the latter shouldn=E2=80=99t s= uddenly downgrade to the former. >> There are tests in guix-package.sh, but this one is going to be >> difficult to test without building the world. > > Would you be willing to write the tests? I think that my knowledge of > Guix is still too weak to do this job properly. (For that matter, it > was probably foolish of me to try to implement --upgrade at this early > stage in my explorations :) Well, you=E2=80=99re brave! :-) I=E2=80=99ll take care of the tests and -e. Thanks! Ludo=E2=80=99.