Commit Graph

11 Commits

Author SHA1 Message Date
Ludovic Courtès 54fd5ad0a5
search-paths: Add 'set-search-paths'.
* guix/search-paths.scm (set-search-paths): New procedure.
2018-05-10 14:53:57 +02:00
Ludovic Courtès fcd75bdbfa
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.
2017-01-23 22:23:41 +01:00
Eric Bavier c6e030b2e3 utils: Have search-path-as-list pattern search for directories.
* guix/build/utils.scm (search-path-as-list)[pattern]: Check requested file
  type.  Check pattern against directory names.
* guix/search-paths.scm (evaluate-search-paths)[pattern]: Remove symlink hack.
2015-10-29 17:30:18 -05:00
Ludovic Courtès d838e70298 search-paths: Export 'string-tokenize*'.
* guix/search-paths.scm (string-tokenize*): Export.
* tests/utils.scm ("string-tokenize*"): Adjust accordingly.
2015-05-06 18:26:53 +02:00
Ludovic Courtès 8e3a3bc290 environment: Move iteration outside of 'for-each-search-path'.
* guix/search-paths.scm (search-path-definition): New procedure.
* guix/scripts/environment.scm (for-each-search-path): Rename to...
  (evaluate-input-search-paths): ... this.  Remove 'proc' and 'pure?'
  parameters, and return directly the list of search-path/value pairs.
  (create-environment): Use 'for-each' and 'evaluate-input-search-paths'
  instead of 'for-each-search-path'.
  (show-search-paths): Use 'for-each', 'search-path-definition', and
  'evaluate-search-paths' instead of 'for-each-search-path'.
2015-05-05 15:13:59 +02:00
Ludovic Courtès fdfa753c69 search-paths: Define the 'PATH' environment variable.
* guix/search-paths.scm ($PATH): New variable.
* guix/scripts/environment.scm (for-each-search-path): Use it.
2015-05-05 15:13:58 +02:00
Ludovic Courtès 369149995c search-paths: 'evaluate-search-paths' can be passed a list of directories.
* guix/search-paths.scm (evaluate-search-paths): Change 'directory' to
  'directories', and adjust 'search-path-as-list' accordingly.
* guix/scripts/package.scm (search-path-environment-variables): Adjust
  call accordingly.
2015-05-05 15:13:58 +02:00
Ludovic Courtès 441cfb420a search-paths: 'evaluate-search-paths' now returns spec/value pairs.
* guix/search-paths.scm (evaluate-search-paths): Return
  specification/value pairs instead of variable/value pairs.
* guix/scripts/package.scm (search-path-environment-variables): Adjust
  accordingly.  Pass #:separator to 'environment-variable-definition'.
2015-05-04 23:30:52 +02:00
Ludovic Courtès b07901c0cc search-paths: Add 'environment-variable-definition'.
* guix/search-paths.scm (environment-variable-definition): New variable.
* guix/scripts/package.scm (search-path-environment-variables): Use it.
2015-05-04 23:30:52 +02:00
Ludovic Courtès 6568d2bd6e 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.
2015-05-04 23:30:51 +02:00
Ludovic Courtès e89431bf01 Move search path specifications to (guix search-paths).
* guix/packages.scm (<search-path-specification>,
  search-path-specification->sexp, sexp->search-path-specification):
  Move to...
* guix/search-paths.scm: ... here.  New file.
* Makefile.am (MODULES): Add it.
* guix/build-system/cmake.scm, guix/build-system/glib-or-gtk.scm,
  guix/build-system/gnu.scm, guix/build-system/haskell.scm,
  guix/build-system/perl.scm, guix/build-system/python.scm,
  guix/build-system/ruby.scm, guix/build-system/waf.scm,
  guix/profiles.scm, guix/scripts/package.scm: Use it.
2015-05-04 23:30:51 +02:00