aboutsummaryrefslogtreecommitdiff
path: root/guix/derivations.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-10-17 20:58:02 +0200
committerLudovic Courtès <ludo@gnu.org>2014-11-02 21:22:12 +0100
commite786293e769f4d69e14d77905bf3a5745557033f (patch)
tree4e95aa8dff7c98f527f15cf628c7c34c3377732c /guix/derivations.scm
parent5c2033f86469ed052fd89a2a228f8cb17128ddf2 (diff)
downloadgnu-guix-e786293e769f4d69e14d77905bf3a5745557033f.tar
gnu-guix-e786293e769f4d69e14d77905bf3a5745557033f.tar.gz
derivations: Add 'derivation-name'.
* guix/derivations.scm (derivation-name): New procedure. * tests/derivations.scm ("derivation-name"): New test.
Diffstat (limited to 'guix/derivations.scm')
-rw-r--r--guix/derivations.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm
index b80e31936e..b2a5c6b976 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -56,6 +56,7 @@
derivation-input-sub-derivations
derivation-input-output-paths
+ derivation-name
fixed-output-derivation?
offloadable-derivation?
substitutable-derivation?
@@ -128,6 +129,11 @@
(derivation-outputs drv)))
(number->string (object-address drv) 16))))
+(define (derivation-name drv)
+ "Return the base name of DRV."
+ (let ((base (store-path-package-name (derivation-file-name drv))))
+ (string-drop-right base 4)))
+
(define (fixed-output-derivation? drv)
"Return #t if DRV is a fixed-output derivation, such as the result of a
download with a fixed hash (aka. `fetchurl')."