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 17:22:20 +0100 Message-ID: <877fiwpayr.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> 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]:36846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO6Nu-0007gS-Su for guix-devel@gnu.org; Tue, 26 Jan 2016 11:22:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aO6Nr-0007sp-Ga for guix-devel@gnu.org; Tue, 26 Jan 2016 11:22:26 -0500 In-Reply-To: <8737tl4bve.fsf@gnu.org> (Mathieu Lirzin's message of "Mon, 25 Jan 2016 21:56:05 +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: > 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. > > Fixes . > > * guix/build/utils.scm (package-name->name+version): Use '@' for > separating package names and version numbers instead of '-'. This > provides the ability to use numbers in package names. > * guix/packages.scm (package-full-name): Add an optional SEPARATOR > argument defaulting to "@". > * doc/guix.texi (Invoking guix package, Invoking guix import): Adapt to > the new syntax. > * guix/ui.scm (package-specification->name+version+output): Likewise. > * guix/scripts/import/hackage.scm (show-help): Likewise. > * gnu/packages.scm (check-package-freshness, specification->package) > (specification->package+output): Likewise. > * emacs/guix-base.scm (guix-package-name-specification): Likewise. > * emacs/guix-main.scm (full-name->name+version) > (name+version->full-name): Likewise. > * emacs/guix-ui-package.el (guix-packages-by-name): Likewise. > * tests/guix-build.sh: Likewise. > * tests/guix-lint.sh: Likewise. > * tests/guix-package.sh: Likewise. > * tests/ui.scm ("package-specification->name+version+output"): Likewise. > * tests/utils.scm ("package-name->name+version"): Likewise. > * tests/graph.scm ("bag-emerged DAG"): Use 'package-full-name' optional > SEPARATOR argument. > * gnu/packages/commencement.scm (gcc-boot0): Likewise. > * NEWS: Mention new syntax. [...] > +++ b/guix/build/utils.scm > @@ -2,6 +2,7 @@ > ;;; Copyright =C2=A9 2012, 2013, 2014, 2015 Ludovic Court=C3=A8s > ;;; Copyright =C2=A9 2013 Andreas Enge > ;;; Copyright =C2=A9 2013 Nikita Karetnikov > +;;; Copyright =C2=A9 2016 Mathieu Lirzin > ;;; Copyright =C2=A9 2015 Mark H Weaver > ;;; > ;;; This file is part of GNU Guix. > @@ -100,25 +101,13 @@ is typically a \"PACKAGE-VERSION\" string." > (+ 34 (string-length (%store-directory))))) >=20=20 > (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) shou= ld 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? > +(define* (package-full-name package #:optional (separator "@")) > + "Return a string which is the concatenation of PACKAGE name, SEPARATOR= , and > +PACKAGE version. SEPARATOR is a optional argument defaulting to \"@\". > +PACKAGE must be a record." > + (string-append (package-name package) separator (package-version packa= ge))) 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 places,= including user interfaces and for anchors in the generated HTML pages (is =E2=80=98@= =E2=80=99 allowed in HTML anchor names?). So yeah, maybe we can try, but I suspect we=E2=80=99ll see breakage in unexpected places. The rest looks good to me. Thank you! Ludo=E2=80=99.