diff options
author | Ludovic Courtès <ludo@gnu.org> | 2021-01-27 14:46:10 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-02-04 09:23:39 +0100 |
commit | 316fc2acbb112bfa572ae30f95a93bcd56621234 (patch) | |
tree | 88b313298e8adba90c87be3358b3d694cd7a8399 /guix/self.scm | |
parent | 814ee99da89a0bcc6cf53d61763d345ed95e067c (diff) |
channels: Record 'guix' channel metadata in (guix config).
Partially fixes <https://bugs.gnu.org/45896>.
* guix/config.scm.in (%channel-metadata): New variable.
* guix/describe.scm (channel-metadata): Use it.
(current-channels): New procedure.
(current-profile-entries): Clarify docstring.
* guix/self.scm (compiled-guix): Add #:channel-metadata and pass it to
'make-config.scm'.
(make-config.scm): Add #:channel-metadata and define '%channel-metadata'
in the generated file.
(guix-derivation): Add #:channel-metadata and pass it to 'compiled-guix'.
* guix/channels.scm (build-from-source): Replace 'name', 'source', and
'commit' parameters with 'instance'. Pass #:channel-metadata to BUILD.
(build-channel-instance): Adjust accordingly.
* build-aux/build-self.scm (build-program): Add #:channel-metadata
and pass it to 'guix-derivation'.
(build): Add #:channel-metadata and pass it to 'build-program'.
* guix/scripts/describe.scm (display-profile-info): Add optional
'channels' parameter. Pass it to 'display-profile-content'.
(display-profile-content): Add optional 'channels' parameter and honor
it. Iterate on CHANNELS rather than on the manifest entries of
PROFILE.
(guix-describe): When PROFILE is #f, call 'current-channels' and pass it
to 'display-profile-info', unless it returns the empty list.
Diffstat (limited to 'guix/self.scm')
-rw-r--r-- | guix/self.scm | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/guix/self.scm b/guix/self.scm index 15c8ad4eb9..35fba1152d 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -793,7 +793,9 @@ itself." (((labels packages _ ...) ...) (cons package packages)))) -(define* (compiled-guix source #:key (version %guix-version) +(define* (compiled-guix source #:key + (version %guix-version) + (channel-metadata #f) (pull-version 1) (name (string-append "guix-" version)) (guile-version (effective-version)) @@ -977,6 +979,8 @@ itself." %guix-package-name #:package-version version + #:channel-metadata + channel-metadata #:bug-report-address %guix-bug-report-address #:home-page-url @@ -1070,6 +1074,7 @@ itself." (define* (make-config.scm #:key gzip xz bzip2 (package-name "GNU Guix") (package-version "0") + (channel-metadata #f) (bug-report-address "bug-guix@gnu.org") (home-page-url "https://guix.gnu.org")) @@ -1083,6 +1088,7 @@ itself." %guix-version %guix-bug-report-address %guix-home-page-url + %channel-metadata %system %store-directory %state-directory @@ -1125,6 +1131,11 @@ itself." (define %guix-bug-report-address #$bug-report-address) (define %guix-home-page-url #$home-page-url) + (define %channel-metadata + ;; Metadata for the 'guix' channel in use. This + ;; information is used by (guix describe). + '#$channel-metadata) + (define %gzip #+(and gzip (file-append gzip "/bin/gzip"))) (define %bzip2 @@ -1249,11 +1260,14 @@ containing MODULE-FILES and possibly other files as well." (define* (guix-derivation source version #:optional (guile-version (effective-version)) - #:key (pull-version 0)) + #:key (pull-version 0) + channel-metadata) "Return, as a monadic value, the derivation to build the Guix from SOURCE -for GUILE-VERSION. Use VERSION as the version string. PULL-VERSION specifies -the version of the 'guix pull' protocol. Return #f if this PULL-VERSION value -is not supported." +for GUILE-VERSION. Use VERSION as the version string. Use CHANNEL-METADATA +as the channel metadata sexp to include in (guix config). + +PULL-VERSION specifies the version of the 'guix pull' protocol. Return #f if +this PULL-VERSION value is not supported." (define (shorten version) (if (and (string-every char-set:hex-digit version) (> (string-length version) 9)) @@ -1278,6 +1292,7 @@ is not supported." (set-guile-for-build guile) (let ((guix (compiled-guix source #:version version + #:channel-metadata channel-metadata #:name (string-append "guix-" (shorten version)) #:pull-version pull-version |