unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Julien Lepiller <julien@lepiller.eu>
To: 44344@debbugs.gnu.org
Subject: [bug#44344] [PATCH] guix: describe: Improve package provenance tracking.
Date: Sat, 31 Oct 2020 15:40:07 +0100	[thread overview]
Message-ID: <20201031144007.25531-1-julien@lepiller.eu> (raw)

%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..fe5921a3b3 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))))
+                     (canonicalize-path (search-path %load-path file)))))
        (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





             reply	other threads:[~2020-10-31 15:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31 14:40 Julien Lepiller [this message]
2020-10-31 17:30 ` [bug#44344] [PATCH] guix: describe: Improve package provenance tracking Ludovic Courtès
2020-11-01 13:29   ` Julien Lepiller
2020-11-02 16:15     ` Ludovic Courtès
2020-11-02 16:42       ` Julien Lepiller
2020-11-03  9:17         ` Ludovic Courtès
2020-11-03 11:25           ` bug#44344: " Julien Lepiller

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=20201031144007.25531-1-julien@lepiller.eu \
    --to=julien@lepiller.eu \
    --cc=44344@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 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).