From patchwork Sat Oct 31 14:40:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Lepiller X-Patchwork-Id: 24906 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 24F2A27BBF3; Sat, 31 Oct 2020 14:41:15 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 97C6327BBF2 for ; Sat, 31 Oct 2020 14:41:14 +0000 (GMT) Received: from localhost ([::1]:48174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYs49-000415-R0 for patchwork@mira.cbaines.net; Sat, 31 Oct 2020 10:41:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYs3y-00040y-9t for guix-patches@gnu.org; Sat, 31 Oct 2020 10:41:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50877) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYs3x-00032A-Vi for guix-patches@gnu.org; Sat, 31 Oct 2020 10:41:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kYs3x-0007Mj-UQ for guix-patches@gnu.org; Sat, 31 Oct 2020 10:41:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#44344] [PATCH] guix: describe: Improve package provenance tracking. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 31 Oct 2020 14:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44344 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 44344@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160415523228268 (code B ref -1); Sat, 31 Oct 2020 14:41:01 +0000 Received: (at submit) by debbugs.gnu.org; 31 Oct 2020 14:40:32 +0000 Received: from localhost ([127.0.0.1]:34190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYs3T-0007Ls-Jy for submit@debbugs.gnu.org; Sat, 31 Oct 2020 10:40:31 -0400 Received: from lists.gnu.org ([209.51.188.17]:36932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYs3S-0007Ll-CQ for submit@debbugs.gnu.org; Sat, 31 Oct 2020 10:40:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYs3R-0003vT-U6 for guix-patches@gnu.org; Sat, 31 Oct 2020 10:40:30 -0400 Received: from lepiller.eu ([2a00:5884:8208::1]:38036) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYs3P-0002uJ-J8 for guix-patches@gnu.org; Sat, 31 Oct 2020 10:40:29 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id a97a7fea for ; Sat, 31 Oct 2020 14:40:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:mime-version:content-transfer-encoding; s=dkim; bh=S864rJtuir2JdV2fA07vzk6B9UlNA/mDegMB8282Nq8=; b=U9O4 Yp0wDraF5sZgGkma74pJbda6XO4idAZeuAfdBjediemQ6rdNOQ54//hBESiHXHNK MuH6STk6hFdjLLZB4R8KQZ1wX3XsmkdcWNMq+hy8eV1dWt/kHu+NTTy6cU9GkFGD PT2fY7tu4GGsVpPDIwhkYzSFhA7rY5lFKJEcrXk5gZxp8qLOoLG+/XRZ5AoILi4l 0SS31/056jXjfephNr8ADY+I7zRsRNn0n/KnSzpJoiV3vQOxw3T2stkCwDFStu+S ctXN8brKMcXw8zgkyrQ7xJT7zzZcVojwoxhrER159iunksWSWrpLovV7VcwICivG NUypMOxUhfj9Aa1YEQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 81eb3ea4 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Sat, 31 Oct 2020 14:40:20 +0000 (UTC) From: Julien Lepiller Date: Sat, 31 Oct 2020 15:40:07 +0100 Message-Id: <20201031144007.25531-1-julien@lepiller.eu> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:5884:8208::1; envelope-from=julien@lepiller.eu; helo=lepiller.eu X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches %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