From eee212710978fb2044d3312aff0bf33b508aa026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 26 Apr 2014 16:38:38 +0200 Subject: [PATCH] store: (direct-store-path? (%store-prefix)) returns #f. * guix/store.scm (direct-store-path?): Return #f if PATH is (%store-prefix). * tests/store.scm ("direct-store-path?"): Add test. --- guix/store.scm | 1 + tests/store.scm | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/guix/store.scm b/guix/store.scm index c1898c5c81..2b924db213 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -839,6 +839,7 @@ be used internally by the daemon's build hook." This predicate is sometimes needed because files *under* a store path are not valid inputs." (and (store-path? path) + (not (string=? path (%store-prefix))) (let ((len (+ 1 (string-length (%store-prefix))))) (not (string-index (substring path len) #\/))))) diff --git a/tests/store.scm b/tests/store.scm index 90137b9754..b0f609f818 100644 --- a/tests/store.scm +++ b/tests/store.scm @@ -85,7 +85,8 @@ (not (direct-store-path? (string-append (%store-prefix) - "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7/bin/guile"))))) + "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7/bin/guile"))) + (not (direct-store-path? (%store-prefix))))) (test-skip (if %store 0 13))