From c48e522fdbb7c749bbf6147e44c067bf1f916fdd Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 29 Dec 2019 16:22:35 +0100 Subject: guix package: Save provenance information when using '--manifest'. Fixes . Reported by zimoun . * guix/describe.scm (manifest-entry-with-provenance): New procedure. * guix/scripts/package.scm (process-actions): Use it when FILES is non-empty. --- guix/describe.scm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'guix/describe.scm') diff --git a/guix/describe.scm b/guix/describe.scm index 893dca2640..6b9b219113 100644 --- a/guix/describe.scm +++ b/guix/describe.scm @@ -30,7 +30,8 @@ current-profile-entries package-path-entries - package-provenance)) + package-provenance + manifest-entry-with-provenance)) ;;; Commentary: ;;; @@ -144,3 +145,18 @@ property of manifest entries, or #f if it could not be determined." (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 +there." + (let ((properties (manifest-entry-properties entry))) + (if (assq 'properties properties) + entry + (let ((item (manifest-entry-item entry))) + (manifest-entry + (inherit entry) + (properties + (match (and (package? item) (package-provenance item)) + (#f properties) + (sexp `((provenance ,@sexp) + ,@properties))))))))) -- cgit v1.2.3