From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: Re: [PATCH] Implement guix-package --upgrade Date: Tue, 12 Feb 2013 09:27:41 -0500 Message-ID: <87liaty5cy.fsf@tines.lan> References: <87vc9yxcre.fsf@tines.lan> <87a9r9zwrv.fsf@gnu.org> 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]:50115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5Gq1-0006Mr-LQ for bug-guix@gnu.org; Tue, 12 Feb 2013 09:28:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U5Gpv-0004N4-ML for bug-guix@gnu.org; Tue, 12 Feb 2013 09:28:01 -0500 In-Reply-To: <87a9r9zwrv.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 12 Feb 2013 10:50:12 +0100") 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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: bug-guix@gnu.org Hi Ludovic, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > 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 pac= kages > 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. I'll do as you suggest and post an updated patch soon. > 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 :) > I think guix-package needs a -e switch (as for guix-build), which would > allow us to write dummy packages for test purposes. Makes sense. Thanks! Mark