diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-02-16 01:37:26 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-02-16 01:37:26 +0100 |
commit | d510ab46144b4c7cb27e383f0031c9b363335cd3 (patch) | |
tree | db6f430c9f286a1dc4593a438aa6b2915b8a99fb /guix | |
parent | 0228826262b2fd01371cdaf78cfe22371b18f2d7 (diff) | |
download | gnu-guix-d510ab46144b4c7cb27e383f0031c9b363335cd3.tar gnu-guix-d510ab46144b4c7cb27e383f0031c9b363335cd3.tar.gz |
packages: Add `package-output'.
* guix/packages.scm (package-output): New procedure.
* tests/packages.scm ("package-output"): New test.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/packages.scm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/guix/packages.scm b/guix/packages.scm index b372f03818..51984baa3b 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -20,10 +20,12 @@ #:use-module (guix utils) #:use-module (guix store) #:use-module (guix base32) + #:use-module (guix derivations) #:use-module (guix build-system) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-9 gnu) + #:use-module (srfi srfi-11) #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) #:re-export (%current-system) @@ -62,6 +64,7 @@ package-source-derivation package-derivation package-cross-derivation + package-output &package-error package-error? @@ -305,3 +308,13 @@ PACKAGE for SYSTEM." (define* (package-cross-derivation store package) ;; TODO #f) + +(define* (package-output store package output + #:optional (system (%current-system))) + "Return the output path of PACKAGE's OUTPUT for SYSTEM---where OUTPUT is the +symbolic output name, such as \"out\". Note that this procedure calls +`package-derivation', which is costly." + (let-values (((_ drv) + (package-derivation store package system))) + (derivation-output-path + (assoc-ref (derivation-outputs drv) output)))) |