aboutsummaryrefslogtreecommitdiff
path: root/guix/utils.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-10-09 00:04:45 +0200
committerLudovic Courtès <ludo@gnu.org>2013-10-09 00:11:34 +0200
commitac10e0e17e366d354ad8b3f91e03c1bdeddc7632 (patch)
tree1b33c11f9e9cfa19a840b2c640c70782bf8a994c /guix/utils.scm
parentb332e3664ee6aa3bc3560378e5f4c27cd984db5f (diff)
downloadgnu-guix-ac10e0e17e366d354ad8b3f91e03c1bdeddc7632.tar
gnu-guix-ac10e0e17e366d354ad8b3f91e03c1bdeddc7632.tar.gz
packages: Add 'patches' and related fields to <origin>.
See <https://lists.gnu.org/archive/html/guix-devel/2013-09/msg00137.html> for the rationale. * guix/packages.scm (<origin>)[patches, patch-flags, patch-inputs, patch-guile]: New fields. (%standard-patch-inputs, default-guile, patch-and-repack): New procedures. (package-source-derivation): When 'patches' is non-empty, call 'patch-and-repack'. * guix/utils.scm (file-sans-extension): New procedure.
Diffstat (limited to 'guix/utils.scm')
-rw-r--r--guix/utils.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/guix/utils.scm b/guix/utils.scm
index 733319a0b4..1f3c0c8ad6 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -63,6 +63,7 @@
package-name->name+version
string-tokenize*
file-extension
+ file-sans-extension
call-with-temporary-output-file
fold2
filtered-port))
@@ -352,6 +353,13 @@ introduce the version part."
(let ((dot (string-rindex file #\.)))
(and dot (substring file (+ 1 dot) (string-length file)))))
+(define (file-sans-extension file)
+ "Return the substring of FILE without its extension, if any."
+ (let ((dot (string-rindex file #\.)))
+ (if dot
+ (substring file 0 dot)
+ file)))
+
(define (string-tokenize* string separator)
"Return the list of substrings of STRING separated by SEPARATOR. This is
like `string-tokenize', but SEPARATOR is a string."