From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Lirzin Subject: Re: [PATCH 04/13] utils: Use '@' for separating package names and version numbers. Date: Tue, 26 Jan 2016 21:52:57 +0100 Message-ID: <87y4bc2hcm.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> 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]:46419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOAbu-0000v9-Ed for guix-devel@gnu.org; Tue, 26 Jan 2016 15:53:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOAbt-0002cB-5i for guix-devel@gnu.org; Tue, 26 Jan 2016 15:53:10 -0500 In-Reply-To: <877fiwpayr.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 26 Jan 2016 17:22:20 +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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org, Alex Kost 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: --8<---------------cut here---------------start------------->8--- ;; XXX: We'd rather use `package-name->name+version' or similar. (string-drop (if dash (substring base 0 dash) base) (+ 1 (string-index base #\-))))) --8<---------------cut here---------------end--------------->8--- > 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) sh= ould 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. >> +(define* (package-full-name package #:optional (separator "@")) >> + "Return a string which is the concatenation of PACKAGE name, SEPARATO= R, and >> +PACKAGE version. SEPARATOR is a optional argument defaulting to \"@\". >> +PACKAGE must be a record." >> + (string-append (package-name package) separator (package-version pack= age))) > > 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 place= s, 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. -- Mathieu Lirzin