diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-08-30 14:38:10 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-08-30 18:38:08 +0200 |
commit | b7c7c03eb5e37fc3455e4e17b0898ffc4bca29c3 (patch) | |
tree | a9c2d06e8cb6a9049f13246b6665c960f48bb13b /guix/build/utils.scm | |
parent | d56f8d5e749496362d76bbbf364c8eba2260c6e5 (diff) |
utils: Add 'strip-store-file-name'.
* guix/build/utils.scm (strip-store-file-name): New procedure.
* guix/build/emacs-build-system.scm (store-directory->name-version):
Remove. Update callers to use 'strip-store-file-name'.
* gnu/packages/gcc.scm (make-libstdc++-doc)[arguments]: Use
'strip-store-file-name' instead of 'string-drop'.
Diffstat (limited to 'guix/build/utils.scm')
-rw-r--r-- | guix/build/utils.scm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 16406930b5..b0abc69f0e 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -33,6 +33,7 @@ alist-delete) #:export (%store-directory store-file-name? + strip-store-file-name parallel-job-count directory-exists? @@ -87,6 +88,12 @@ "Return true if FILE is in the store." (string-prefix? (%store-directory) file)) +(define (strip-store-file-name file) + "Strip the '/gnu/store' and hash from FILE, a store file name. The result +is typically a \"PACKAGE-VERSION\" string." + (string-drop file + (+ 34 (string-length (%store-directory))))) + (define parallel-job-count ;; Number of processes to be passed next to GNU Make's `-j' argument. (make-parameter |