From: "Ludovic Courtès" <ludo@gnu.org>
To: Nicolas Graves <ngraves@ngraves.fr>
Cc: 73833@debbugs.gnu.org
Subject: [bug#73833] [PATCH v2 4/5] guix: refresh: Keep the version field of each update specification.
Date: Wed, 06 Nov 2024 16:47:51 +0100 [thread overview]
Message-ID: <87msicwehk.fsf@gnu.org> (raw)
In-Reply-To: <20241017223308.27941-5-ngraves@ngraves.fr> (Nicolas Graves's message of "Fri, 18 Oct 2024 00:26:00 +0200")
Nicolas Graves <ngraves@ngraves.fr> skribis:
> * guix/scripts/refresh.scm (options->update-specs)[update-specs]: Keep
> the version field of each update specification. This is done using a
> variable to cache package names and then filter out unwanted candidates.
> ---
> guix/scripts/refresh.scm | 23 +++++++++++++++++------
> 1 file changed, 17 insertions(+), 6 deletions(-)
>
> diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
> index ec7d38c22a..810c33c786 100644
> --- a/guix/scripts/refresh.scm
> +++ b/guix/scripts/refresh.scm
> @@ -310,12 +310,23 @@ (define update-specs
> some)))
>
> (if (assoc-ref opts 'recursive?)
> - (mlet* %store-monad ((edges (node-edges %bag-node-type (all-packages)))
> - (packages -> (node-transitive-edges
> - (map update-spec-package update-specs)
> - edges)))
> - ;; FIXME: The 'version' field of each update spec is lost.
> - (return (map update-spec packages)))
> + (mlet* %store-monad
> + ((edges (node-edges %bag-node-type (all-packages)))
> + (strict-spec-pkgs -> (map update-spec-package update-specs))
> + (strict-spec-pkg-names -> (map package-name strict-spec-pkgs))
> + (packages -> (node-transitive-edges strict-spec-pkgs edges))
> + (transitive-specs -> (map update-spec packages)))
> + (return (append update-specs
> + (filter-map (match-lambda
> + ((? update? spec)
> + (if (member (package-name
> + (update-spec-package spec))
> + strict-spec-pkg-names)
> + spec
> + #f))
> + (_
> + #f))
> + transitive-specs))))
Or just:
(filter (lambda (spec)
(member (package-name (update-spec-package spec))
package-names))
transitive-specs)
(IIUC.)
Maybe add a comment explaining that this is to retain the ‘version’
field of UPDATE-SPECS?
Also, check out the guidelines for identifiers.
Thanks,
Ludo’.
next prev parent reply other threads:[~2024-11-06 15:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-16 5:29 [bug#73833] [PATCH] guix: import: composer: Improve composer-fetch Nicolas Graves via Guix-patches via
2024-10-17 22:25 ` [bug#73833] [PATCH v2 0/5] Large improvements to import utils, composer import, and refresh Nicolas Graves via Guix-patches via
2024-10-17 22:25 ` [bug#73833] [PATCH v2 1/5] guix: import: utils: Add function git->origin Nicolas Graves via Guix-patches via
2024-11-06 15:16 ` Ludovic Courtès
2024-11-06 17:18 ` Nicolas Graves via Guix-patches via
2024-10-17 22:25 ` [bug#73833] [PATCH v2 2/5] tests: go: Add mock-git->origin function Nicolas Graves via Guix-patches via
2024-10-17 22:25 ` [bug#73833] [PATCH v2 3/5] guix: import: composer: Improve importer Nicolas Graves via Guix-patches via
2024-11-06 15:41 ` Ludovic Courtès
2024-10-17 22:26 ` [bug#73833] [PATCH v2 4/5] guix: refresh: Keep the version field of each update specification Nicolas Graves via Guix-patches via
2024-11-06 15:47 ` Ludovic Courtès [this message]
2024-10-17 22:26 ` [bug#73833] [PATCH v2 5/5] guix: refresh: Implement basic upstream-source-inputs rich updates Nicolas Graves via Guix-patches via
[not found] ` <87y11w9war.fsf@ngraves.fr>
2024-11-07 8:58 ` [bug#73833] [Nicolas Graves via Guix-patches via] " Nicolas Graves via Guix-patches via
2024-11-07 20:14 ` Nicolas Graves via Guix-patches via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87msicwehk.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=73833@debbugs.gnu.org \
--cc=ngraves@ngraves.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).