diff options
Diffstat (limited to 'guix')
-rw-r--r-- | guix/derivations.scm | 9 | ||||
-rw-r--r-- | guix/store.scm | 9 |
2 files changed, 9 insertions, 9 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm index 011f4b778b..b33e835556 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -541,15 +541,6 @@ advance, such as a file download. When REFERENCES-GRAPHS is true, it must be a list of file name/store path pairs. In that case, the reference graph of each store path is exported in the build environment in the corresponding file, in a simple text format." - (define direct-store-path? - (let ((len (+ 1 (string-length (%store-prefix))))) - (lambda (p) - ;; Return #t if P is a store path, and not a sub-directory of a - ;; store path. This predicate is needed because files *under* a - ;; store path are not valid inputs. - (and (store-path? p) - (not (string-index (substring p len) #\/)))))) - (define (add-output-paths drv) ;; Return DRV with an actual store path for each of its output and the ;; corresponding environment variable. diff --git a/guix/store.scm b/guix/store.scm index 290118d74b..2821cacdcc 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -85,6 +85,7 @@ %store-prefix store-path? + direct-store-path? derivation-path? store-path-package-name store-path-hash-part @@ -640,6 +641,14 @@ collected, and the number of bytes freed." ;; `isStorePath' in Nix does something similar. (string-prefix? (%store-prefix) path)) +(define (direct-store-path? path) + "Return #t if PATH is a store path, and not a sub-directory of a store path. +This predicate is sometimes needed because files *under* a store path are not +valid inputs." + (and (store-path? path) + (let ((len (+ 1 (string-length (%store-prefix))))) + (not (string-index (substring path len) #\/))))) + (define (derivation-path? path) "Return #t if PATH is a derivation path." (and (store-path? path) (string-suffix? ".drv" path))) |