From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 04/13] utils: Use '@' for separating package names and version numbers. Date: Tue, 23 Feb 2016 12:11:01 +0100 Message-ID: <87vb5flm0q.fsf@gnu.org> References: <1453666771-16869-1-git-send-email-mthl@gnu.org> <1453666771-16869-5-git-send-email-mthl@gnu.org> <87h9i1evp5.fsf@gmail.com> <8737tl4bve.fsf@gnu.org> <877fiwpayr.fsf@gnu.org> <87k2m0cto5.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 ([2001:4830:134:3::10]:32782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYAs2-0005T7-Dk for guix-devel@gnu.org; Tue, 23 Feb 2016 06:11:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYArx-0006dP-Dx for guix-devel@gnu.org; Tue, 23 Feb 2016 06:11:10 -0500 In-Reply-To: <87k2m0cto5.fsf@gnu.org> (Mathieu Lirzin's message of "Fri, 19 Feb 2016 21:49:14 +0100") 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: Mathieu Lirzin Cc: guix-devel@gnu.org, Alex Kost Mathieu Lirzin skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Mathieu Lirzin skribis: >> >>> From 7fef43249b704db3c4d511b2f1b62428740cfa73 Mon Sep 17 00:00:00 2001 >>> From: Mathieu Lirzin >>> Date: Sun, 24 Jan 2016 01:54:44 +0100 >>> Subject: [PATCH] utils: Use '@' for separating package names and version >>> numbers. >>> >> [...] >>> (define (package-name->name+version name) >>> - "Given NAME, a package name like \"foo-0.9.1b\", return two values: >>> -\"foo\" and \"0.9.1b\". When the version part is unavailable, NAME and >>> -#f are returned. The first hyphen followed by a digit is considered to >>> -introduce the version part." >>> + "Given NAME, a package name like \"foo@0.9.1b\", return two values: = \"foo\" >>> +and \"0.9.1b\". When the version part is unavailable, NAME and #f are >>> +returned. Both parts must not contain any '@'." >> >> I think this one should remain unchanged, first because it triggers a >> full rebuild ;-), and second because it has uses in >> {emacs,gnu}-build-system that expect exactly these semantics. >> >> So I think we have to simply provide a different version of that in >> (guix utils) or so. >> >> Also, I think that at least for some time, the new >> =E2=80=98package-name->name+version=E2=80=99 (maybe we could call it >> =E2=80=98package-specification->name+version=E2=80=99 for consistency) s= hould fall back >> to the old method when: >> >> 1. The spec has no @ sign, and >> >> 2. The specified package name was not found. >> >> >> It could print a warning when the old method has been used *and* a >> matching package was found, explaining that this is deprecated syntax. >> >> WDYT? > > I have finally took some time to look into this, and actually > implementing =E2=80=98package-specification->name+version=E2=80=99 in (gu= ix utils) with > the suggested fall back feature seems not desirable since checking for > package existence would require using the procedure > =E2=80=98find-packages-by-name=E2=80=99 from (gnu packages) which will th= en create a > circular dependency. Did I miss something? No, good point. What about this: 1. Put the new =E2=80=98package-name->name+version=E2=80=99 in (guix util= s) and keep it dumb (i.e., it insists on having an =E2=80=98@=E2=80=99, as is the = case with the patch you posted.) 2. Add the fallback case in =E2=80=98specification->package=E2=80=99 and =E2=80=98specification->package+output=E2=80=99 in (gnu packages). How does that sound? Thanks! Ludo=E2=80=99.