aboutsummaryrefslogtreecommitdiff
path: root/guix/profiles.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/profiles.scm')
-rw-r--r--guix/profiles.scm17
1 files changed, 17 insertions, 0 deletions
diff --git a/guix/profiles.scm b/guix/profiles.scm
index 96c8ca0514..5e69e012f9 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -51,6 +51,7 @@
manifest-matching-entries
profile-manifest
+ package->manifest-entry
profile-derivation
generation-number
generation-numbers
@@ -105,6 +106,22 @@
(call-with-input-file file read-manifest)
(manifest '()))))
+(define* (package->manifest-entry package #:optional output)
+ "Return a manifest entry for the OUTPUT of package PACKAGE. When OUTPUT is
+omitted or #f, use the first output of PACKAGE."
+ (let ((deps (map (match-lambda
+ ((label package)
+ `(,package "out"))
+ ((label package output)
+ `(,package ,output)))
+ (package-transitive-propagated-inputs package))))
+ (manifest-entry
+ (name (package-name package))
+ (version (package-version package))
+ (output (or output (car (package-outputs package))))
+ (item package)
+ (dependencies (delete-duplicates deps)))))
+
(define (manifest->gexp manifest)
"Return a representation of MANIFEST as a gexp."
(define (entry->gexp entry)