mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-12 06:06:53 -05:00
guix package: Save provenance information when using '--manifest'.
Fixes <https://bugs.gnu.org/38673>. Reported by zimoun <zimon.toutoune@gmail.com>. * guix/describe.scm (manifest-entry-with-provenance): New procedure. * guix/scripts/package.scm (process-actions): Use it when FILES is non-empty.
This commit is contained in:
parent
8a705ae4c6
commit
c48e522fdb
2 changed files with 22 additions and 3 deletions
|
@ -30,7 +30,8 @@ (define-module (guix describe)
|
||||||
current-profile-entries
|
current-profile-entries
|
||||||
package-path-entries
|
package-path-entries
|
||||||
|
|
||||||
package-provenance))
|
package-provenance
|
||||||
|
manifest-entry-with-provenance))
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;;;
|
;;;
|
||||||
|
@ -144,3 +145,18 @@ (define (entry-source entry)
|
||||||
(and main
|
(and main
|
||||||
`(,main
|
`(,main
|
||||||
,@(if extra (list extra) '()))))))))))
|
,@(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)))))))))
|
||||||
|
|
|
@ -38,7 +38,7 @@ (define-module (guix scripts package)
|
||||||
#:use-module (guix config)
|
#:use-module (guix config)
|
||||||
#:use-module (guix scripts)
|
#:use-module (guix scripts)
|
||||||
#:use-module (guix scripts build)
|
#:use-module (guix scripts build)
|
||||||
#:autoload (guix describe) (package-provenance)
|
#:use-module (guix describe)
|
||||||
#:autoload (guix store roots) (gc-roots)
|
#:autoload (guix store roots) (gc-roots)
|
||||||
#:use-module ((guix build utils)
|
#:use-module ((guix build utils)
|
||||||
#:select (directory-exists? mkdir-p))
|
#:select (directory-exists? mkdir-p))
|
||||||
|
@ -883,7 +883,10 @@ (define (transform-entry entry)
|
||||||
opts))
|
opts))
|
||||||
(manifest (match files
|
(manifest (match files
|
||||||
(() (profile-manifest profile))
|
(() (profile-manifest profile))
|
||||||
(_ (concatenate-manifests (map load-manifest files)))))
|
(_ (map-manifest-entries
|
||||||
|
manifest-entry-with-provenance
|
||||||
|
(concatenate-manifests
|
||||||
|
(map load-manifest files))))))
|
||||||
(step1 (options->removable opts manifest
|
(step1 (options->removable opts manifest
|
||||||
(manifest-transaction)))
|
(manifest-transaction)))
|
||||||
(step2 (options->installable opts manifest step1))
|
(step2 (options->installable opts manifest step1))
|
||||||
|
|
Loading…
Reference in a new issue