aboutsummaryrefslogtreecommitdiff
path: root/guix/utils.scm
diff options
context:
space:
mode:
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."