>From 5998d636ea17a192fa1cf1720c38c9b4676d0189 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sat, 31 Oct 2020 15:35:54 +0100 Subject: [PATCH] guix: describe: Improve package provenance tracking. %load-path lists ~/.config/guix/current before individual channels. We use canonicalize-path to get the store path for channel packages. * guix/describe.scm (package-provenance): Use canonicalize-path. --- guix/describe.scm | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/guix/describe.scm b/guix/describe.scm index 05bf99eb58..ecda90897a 100644 --- a/guix/describe.scm +++ b/guix/describe.scm @@ -132,25 +132,25 @@ property of manifest entries, or #f if it could not be determined." (file (let ((file (if (string-prefix? "/" file) file - (search-path %load-path file)))) + (and=> (search-path %load-path file) canonicalize-path)))) (and file (string-prefix? (%store-prefix) file) ;; Always store information about the 'guix' channel and ;; optionally about the specific channel FILE comes from. - (or (let ((main (and=> (find (lambda (entry) - (string=? "guix" - (manifest-entry-name entry))) - (current-profile-entries)) - entry-source)) - (extra (any (lambda (entry) - (let ((item (manifest-entry-item entry))) - (and (string-prefix? item file) - (entry-source entry)))) - (current-profile-entries)))) - (and main - `(,main - ,@(if extra (list extra) '())))))))))) + (let ((main (and=> (find (lambda (entry) + (string=? "guix" + (manifest-entry-name entry))) + (current-profile-entries)) + entry-source)) + (extra (any (lambda (entry) + (let ((item (manifest-entry-item entry))) + (and (string-prefix? item file) + (entry-source entry)))) + (current-profile-entries)))) + (and main + `(,main + ,@(if extra (list extra) '()))))))))) (define (manifest-entry-with-provenance entry) "Return ENTRY with an additional 'provenance' property if it's not already -- 2.28.0