summary refs log tree commit diff
path: root/gnu/packages.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-06-11 23:05:23 +0200
committerLudovic Courtès <ludo@gnu.org>2017-06-11 23:05:23 +0200
commitc08ea55e7ec25261e4596bf6726a83c1ed056b94 (patch)
tree62c86988b26ccca3b8cdebaf07b201f4d0f904e4 /gnu/packages.scm
parentc580ff672425ad7cd6a388178fa5857b6aa15d5f (diff)
downloadguix-c08ea55e7ec25261e4596bf6726a83c1ed056b94.tar.gz
packages: Add 'specifications->manifest'.
* gnu/packages.scm (specifications->manifest): New procedure.
* doc/guix.texi (Invoking guix package): Change example from using
'(compose list specification->package+output)' to using
'specifications->manifest'.
Diffstat (limited to 'gnu/packages.scm')
-rw-r--r--gnu/packages.scm12
1 files changed, 11 insertions, 1 deletions
diff --git a/gnu/packages.scm b/gnu/packages.scm
index 57907155fb..5629061788 100644
--- a/gnu/packages.scm
+++ b/gnu/packages.scm
@@ -29,6 +29,7 @@
   #:use-module ((guix build utils)
                 #:select ((package-name->name+version
                            . hyphen-separated-name->name+version)))
+  #:autoload   (guix profiles) (packages->manifest)
   #:use-module (ice-9 vlist)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
@@ -53,7 +54,8 @@
             find-newest-available-packages
 
             specification->package
-            specification->package+output))
+            specification->package+output
+            specifications->manifest))
 
 ;;; Commentary:
 ;;;
@@ -278,3 +280,11 @@ version; if SPEC does not specify an output, return OUTPUT."
            (leave (G_ "package `~a' lacks output `~a'~%")
                   (package-full-name package)
                   sub-drv))))))
+
+(define (specifications->manifest specs)
+  "Given SPECS, a list of specifications such as \"emacs@25.2\" or
+\"guile:debug\", return a profile manifest."
+  ;; This procedure exists mostly so users of 'guix package -m' don't have to
+  ;; fiddle with multiple-value returns.
+  (packages->manifest
+   (map (compose list specification->package+output) specs)))