diff options
author | Ludovic Courtès <ludo@gnu.org> | 2017-01-22 22:42:57 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2017-01-23 22:23:41 +0100 |
commit | fcd75bdbfa99d14363b905afbf914eec20e69df8 (patch) | |
tree | 38f9cfaf9c186fc6c9af54183efbd02fa1a13f70 /guix/build/utils.scm | |
parent | c5746f239964a72642ac56640b8ff490d5bfa673 (diff) |
search-paths: Allow specs with #f as their separator.
This adds support for single-entry search paths.
Fixes <http://bugs.gnu.org/25422>.
Reported by Leo Famulari <leo@famulari.name>.
* guix/search-paths.scm (<search-path-specification>)[separator]:
Document as string or #f.
(evaluate-search-paths): Add case for SEPARATOR as #f.
(environment-variable-definition): Handle SEPARATOR being #f.
* guix/build/utils.scm (list->search-path-as-string): Add case for
SEPARATOR as #f.
(search-path-as-string->list): Likewise.
* guix/build/profiles.scm (abstract-profile): Likewise.
* tests/search-paths.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
* tests/packages.scm ("--search-paths with single-item search path"):
New test.
* gnu/packages/version-control.scm (git)[native-search-paths](separator):
New field.
Diffstat (limited to 'guix/build/utils.scm')
-rw-r--r-- | guix/build/utils.scm | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/guix/build/utils.scm b/guix/build/utils.scm index bc6f114152..cf09326393 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org> ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> @@ -400,10 +400,17 @@ for under the directories designated by FILES. For example: (delete-duplicates input-dirs))) (define (list->search-path-as-string lst separator) - (string-join lst separator)) + (if separator + (string-join lst separator) + (match lst + ((head rest ...) head) + (() "")))) (define* (search-path-as-string->list path #:optional (separator #\:)) - (string-tokenize path (char-set-complement (char-set separator)))) + (if separator + (string-tokenize path + (char-set-complement (char-set separator))) + (list path))) (define* (set-path-environment-variable env-var files input-dirs #:key |