Subject: Re: bug#57460: [PATCH 00/19] Refresh to specific version

From: Ludovic Courtès <[email-masked]>
Date: Tue, 22 Nov 2022 08:33:38 +0100

Hi Hartmut

Hartmut Goebel <[email-masked]> skribis:

> From c748a25193d8f9ee29b9d281f542fb1d0d3f4ec1 Mon Sep 17 00:00:00 2001
> Message-Id: <[email-masked]>
> From: Hartmut Goebel <[email-masked]>
> Date: Fri, 24 Jun 2022 20:40:57 +0200
> Subject: [PATCH v2] refresh: Allow updating to a specific version.
>
> * guix/scripts/refresh.scm (options->packages)[args-packages]: Handle version
>   specification in package name arguments.
>   (update-package): Add #:version argument and pass it on to called functions.
>   (guix-refresh): When updating, pass the specified version (if any) to
>   update-package.
>   [package-list-without-versions, package-list-with-versions]: New functions.

Thanks for this updated patch!

[...]

> -(define (options->packages opts)
> +(define (options->package-specs opts)
>    "Return the list of packages requested by OPTS, honoring options like
>  '--recursive'."

In Guix, “package spec” refers to the syntax that
‘specification->package’ accepts, like “guile” or “[email-masked]”.  So we’ll
have to use another name throughout.  How about “update spec” or
“refresh spec” for the string, and just “update” for the record?

> +(define-record-type* <package-spec> package-spec make-package-spec
> +  package-spec?
> +  (package   package-spec-package) ; package
> +  (target    package-spec-target)) ; target version

Since there are just two fields, it may be simpler to use SRFI-9:

  (define-record-type <update>
    (update package version)
    update?
    (package update-package)
    (version update-version))

Thanks,
Ludo’.