summaryrefslogtreecommitdiff
path: root/guix/derivations.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/derivations.scm')
-rw-r--r--guix/derivations.scm23
1 files changed, 17 insertions, 6 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm
index 6fbce14da0..7b131955b0 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -1,20 +1,20 @@
-;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
-;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;;
-;;; This file is part of Guix.
+;;; This file is part of GNU Guix.
;;;
-;;; Guix is free software; you can redistribute it and/or modify it
+;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
-;;; Guix is distributed in the hope that it will be useful, but
+;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
-;;; along with Guix. If not, see <http://www.gnu.org/licenses/>.
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (guix derivations)
#:use-module (srfi srfi-1)
@@ -55,6 +55,7 @@
read-derivation
write-derivation
derivation-path->output-path
+ derivation-path->output-paths
derivation
%guile-for-build
@@ -288,6 +289,16 @@ path of its output OUTPUT."
(outputs (derivation-outputs drv)))
(and=> (assoc-ref outputs output) derivation-output-path)))))
+(define (derivation-path->output-paths path)
+ "Read the derivation from PATH (`/nix/store/xxx.drv'), and return the
+list of name/path pairs of its outputs."
+ (let* ((drv (call-with-input-file path read-derivation))
+ (outputs (derivation-outputs drv)))
+ (map (match-lambda
+ ((name . output)
+ (cons name (derivation-output-path output))))
+ outputs)))
+
;;;
;;; Derivation primitive.