From 8a154c29151fc445e8d0364f507f6e200de1e700 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 9 May 2021 17:22:24 +0200 Subject: describe: Gracefully handle profiles that lack provenance info. Fixes . Previously, 'current-channels' would return the empty list when 'current-profile' is true but the profile lacks provenance info. * guix/describe.scm (current-channels)[build-time-metadata]: New procedure. Call it when 'manifest-entry-channel' returns #f for all of ENTRIES. * guix/scripts/describe.scm (guix-describe): When PROFILE is true, pass third argument to 'display-profile-info'. --- guix/scripts/describe.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'guix/scripts') diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm index b5f6249176..a3e3338f7e 100644 --- a/guix/scripts/describe.scm +++ b/guix/scripts/describe.scm @@ -301,4 +301,11 @@ text. The hyperlink links to a web view of COMMIT, when available." (channels (display-profile-info #f format channels)))) (profile - (display-profile-info (canonicalize-profile profile) format)))))) + ;; For the current profile, resort to 'current-channels', which has a + ;; fallback to metadata from (guix config) in case PROFILE lacks it. + (let ((channels (if (and (current-profile) + (string=? profile (current-profile))) + (current-channels) + (profile-channels profile)))) + (display-profile-info (canonicalize-profile profile) + format channels))))))) -- cgit v1.2.3