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, 26 Jan 2016 22:08:50 +0100 Message-ID: <878u3c121p.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> <87y4bc2hcm.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]:55108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOArC-0003Te-Un for guix-devel@gnu.org; Tue, 26 Jan 2016 16:09:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOAr8-0003An-SX for guix-devel@gnu.org; Tue, 26 Jan 2016 16:08:58 -0500 In-Reply-To: <87y4bc2hcm.fsf@gnu.org> (Mathieu Lirzin's message of "Tue, 26 Jan 2016 21:52:57 +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: >> >>> +++ b/guix/build/utils.scm >>> >>> (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. > > Actually It seems not used in gnu-build-system, instead there is this: > > ;; XXX: We'd rather use `package-name->name+version' or similar. > (string-drop (if dash > (substring base 0 dash) > base) > (+ 1 (string-index base #\-))))) It=E2=80=99s almost used, then. ;-) >> 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. > > OK. I will give a try. Awesome! >>> +(define* (package-full-name package #:optional (separator "@")) >>> + "Return a string which is the concatenation of PACKAGE name, SEPARAT= OR, and >>> +PACKAGE version. SEPARATOR is a optional argument defaulting to \"@\". >>> +PACKAGE must be a record." >>> + (string-append (package-name package) separator (package-version pac= kage))) >> >> I wonder what will break by changing the default to =E2=80=98@=E2=80=99.= :-) >> >> =E2=80=98package-full-name=E2=80=99 is used in a bunch of different plac= es, including >> user interfaces and for anchors in the generated HTML pages (is =E2=80= =98@=E2=80=99 >> allowed in HTML anchor names?). > > According to , using > =E2=80=98@=E2=80=99 in ids is not compatible with HTML4. But according to > > and from what I have successfully tested in Icecat 38.5.2, it works in > HTML5. OK, thanks for researching it. I guess we can conservatively keep using hyphens for anchors. Ludo=E2=80=99.