guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 04/13] utils: Use '@' for separating package names and versio


From: Ludovic Courtès
Subject: Re: [PATCH 04/13] utils: Use '@' for separating package names and version numbers.
Date: Mon, 29 Feb 2016 17:00:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Mathieu Lirzin <address@hidden> skribis:

> However, I am not pleased by the current state of the
> ‘specification/package-name->...’ procedures.  They don't compose well,
> and are obfuscated by being fragmented across a bunch of modules.  I
> don't know if there is much room for improvement but my feeling is that
> the brain involvement required for implementing the '@' thing was far
> too high compared to the actual task.

The idea is that things that need to traverse the list of packages live
in (gnu packages), whereas syntactic helpers leave in (guix ui) and
such.  This is so that the (guix …) module are (almost) independent of
the (gnu …) modules.

That said, if you think of improvements, that’d be interesting!

> From a39b458002e2c4c36c9adb2718f166b4e5ff7965 Mon Sep 17 00:00:00 2001
> From: Mathieu Lirzin <address@hidden>
> Date: Sun, 28 Feb 2016 17:50:58 +0100
> Subject: [PATCH 1/2] packages: Factorize package specification search.
>
> * gnu/packages.scm (%find-package): New procedure.
> (specification->package, specification->package+output): Use it.

[...]

>  (define* (specification->package+output spec #:optional (output "out"))
>    "Return the package and output specified by SPEC, or #f and #f; SPEC may

[...]

> +    (and=> (%find-package spec name version)
> +           (lambda (pkg)
> +             (if (member sub-drv (package-outputs pkg))
> +                 (values pkg sub-drv)

This fragment can return a single value instead of two.  Thus, it should
be changed to something like:

  (match (%find-package spec name version)
    (#f
     (values #f #f))
    (package   ;no need to call it ‘pkg’  :-)
     …))

OK with this change!

> From a5d3eb26c06965647d0e1749b848f8501ae61d62 Mon Sep 17 00:00:00 2001
> From: Mathieu Lirzin <address@hidden>
> Date: Sun, 28 Feb 2016 23:11:36 +0100
> Subject: [PATCH 2/2] * utils: Use '@' for separating package names and version
>  numbers.

Extra star in subject.

> +*** New syntax for separating package names and version numbers
> +
> +Use address@hidden instead of ‘-’ as a separator.  This new separator is a 
> reserved
                                       ^^
Maybe add: “, as in address@hidden

> +character which is not allowed both in package names and version numbers.

Maybe add:

  The old syntax to specify a package’s version—e.g., as “gnupg-2.0—is
  obsolete and support for it will be removed in the future.

OK with changes along these lines.

Thanks a lot!  This closes another item towards 0.9.1.  \o/

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]