diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-05-04 21:44:52 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-05-04 23:30:51 +0200 |
commit | 6568d2bd6e4e047dd95b00a7a6e7501a16491eb5 (patch) | |
tree | f5f16ed73cbb0486fd00a8147707ce75b2132df4 /guix/utils.scm | |
parent | e89431bf016830a919ec2430889f6c2679aab408 (diff) | |
download | gnu-guix-6568d2bd6e4e047dd95b00a7a6e7501a16491eb5.tar gnu-guix-6568d2bd6e4e047dd95b00a7a6e7501a16491eb5.tar.gz |
search-paths: Add 'evaluate-search-paths', from (guix scripts package).
* guix/scripts/package.scm (with-null-error-port,
evaluate-search-paths): Move to...
* guix/search-paths.scm: ... here.
* guix/utils.scm (string-tokenize*): Move to...
* guix/search-paths.scm: ... here.
* tests/utils.scm ("string-tokenize*"): Adjust accordingly.
Diffstat (limited to 'guix/utils.scm')
-rw-r--r-- | guix/utils.scm | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/guix/utils.scm b/guix/utils.scm index 3d38ba1223..a2ade2bf97 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -72,7 +72,6 @@ version-major+minor guile-version>? package-name->name+version - string-tokenize* string-replace-substring arguments-from-environment-variable file-extension @@ -606,33 +605,6 @@ introduce the version part." (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." - (define (index string what) - (let loop ((string string) - (offset 0)) - (cond ((string-null? string) - #f) - ((string-prefix? what string) - offset) - (else - (loop (string-drop string 1) (+ 1 offset)))))) - - (define len - (string-length separator)) - - (let loop ((string string) - (result '())) - (cond ((index string separator) - => - (lambda (offset) - (loop (string-drop string (+ offset len)) - (cons (substring string 0 offset) - result)))) - (else - (reverse (cons string result)))))) - (define* (string-replace-substring str substr replacement #:optional (start 0) |