guix-devel
[Top][All Lists]
Advanced

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

Re: grafted package and CLI


From: Ludovic Courtès
Subject: Re: grafted package and CLI
Date: Thu, 07 Jul 2022 10:00:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

> Or even, it can be confusing:
>
>         $ guix shell curl@7.79.1 -- curl --version
>         curl 7.84.0 (x86_64-unknown-linux-gnu) libcurl/7.84.0 GnuTLS/3.7.2 
> zlib/1.2.11 libidn2/2.3.1 nghttp2/1.44.0
>         Release-Date: 2022-06-27
>         [..]
>
> The issue is not new, e.g., see [1].  I proposed a patch [2] (see below)
> which addresses the issue with “guix show”.
>
> However, it does not address issue with “guix package -A | grep ^curl”;
> and it is potentially not fixable because it uses
> ’fold-available-packages’ which loads the cache (for performance) and
> this cache does not contain the ’replacement’ field – it is not a good
> idea to introduce it, IMHO.

Usually, when the replacement is a different version, we make it public,
so it also shows up in ‘guix package -A’.  It’s just a convention, but
it’s probably good enough?

> diff --git a/guix/ui.scm b/guix/ui.scm
> index 7fbd4c63a2..b6497f5e5c 100644
> --- a/guix/ui.scm
> +++ b/guix/ui.scm
> @@ -1528,9 +1528,18 @@ HYPERLINKS? is true, emit hyperlink escape sequences 
> when appropriate."
>    (define (package<? p1 p2)
>      (string<? (package-full-name p1) (package-full-name p2)))
>
> +  (define replacement
> +    (package-replacement p))
> +
>    ;; Note: Don't i18n field names so that people can post-process it.
>    (format port "name: ~a~%" (package-name p))
>    (format port "version: ~a~%" (package-version p))
> +  (when replacement
> +    (unless
> +     (string=?
> +      (package-version p)
> +      (package-version replacement))
> +     (format port "replacement: ~a~%" (package-version replacement))))
>    (format port "outputs: ~a~%" (string-join (package-outputs p)))
>    (format port "systems: ~a~%"
>            (string-join (package-transitive-supported-systems p)))

I’m all for it!  If you want you can resent the whole thing produced by
‘git format-patch’, or I can apply it and provide a commit message on
your behalf.

Thanks,
Ludo’.



reply via email to

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