From: Christopher Baines <mail@cbaines.net>
To: 47986@debbugs.gnu.org
Subject: [bug#47986] [PATCH] inferior: Support querying package replacements.
Date: Sat, 24 Apr 2021 06:45:09 +0100 [thread overview]
Message-ID: <20210424054509.7740-1-mail@cbaines.net> (raw)
I'm looking at this to help with adding support for looking up package
replacements to store in the Guix Data Service.
* guix/inferior.scm (inferior-package-replacement): New procedure.
---
guix/inferior.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/guix/inferior.scm b/guix/inferior.scm
index eb457f81f9..19607724c0 100644
--- a/guix/inferior.scm
+++ b/guix/inferior.scm
@@ -90,6 +90,7 @@
inferior-package-native-search-paths
inferior-package-transitive-native-search-paths
inferior-package-search-paths
+ inferior-package-replacement
inferior-package-provenance
inferior-package-derivation
@@ -462,6 +463,25 @@ package."
(define inferior-package-transitive-native-search-paths
(cut %inferior-package-search-paths <> 'package-transitive-native-search-paths))
+(define (inferior-package-replacement package)
+ (match (inferior-package-field
+ package
+ '(compose (match-lambda
+ ((? package? package)
+ (let ((id (object-address package)))
+ (hashv-set! %package-table id package)
+ (list id
+ (package-name package)
+ (package-version package))))
+ (#f #f))
+ package-replacement))
+ (#f #f)
+ ((id name version)
+ (inferior-package (inferior-package-inferior package)
+ name
+ version
+ id))))
+
(define (inferior-package-provenance package)
"Return a \"provenance sexp\" for PACKAGE, an inferior package. The result
is similar to the sexp returned by 'package-provenance' for regular packages."
--
2.30.1
next reply other threads:[~2021-04-24 5:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-24 5:45 Christopher Baines [this message]
2021-05-03 20:50 ` [bug#47986] [PATCH] inferior: Support querying package replacements Ludovic Courtès
2021-05-14 8:45 ` Christopher Baines
2021-05-14 8:42 ` [bug#47986] [PATCH v2] " Christopher Baines
2021-05-15 10:11 ` [bug#47986] [PATCH] " Ludovic Courtès
2021-05-15 11:15 ` bug#47986: " Christopher Baines
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210424054509.7740-1-mail@cbaines.net \
--to=mail@cbaines.net \
--cc=47986@debbugs.gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.