diff --git a/guix/store.scm b/guix/store.scm index 3c48e1d110e..bd90da22cdb 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -1980,7 +1980,7 @@ valid inputs." (define (derivation-path? path) "Return #t if PATH is a derivation path." - (and (store-path? path) (string-suffix? ".drv" path))) + (and (direct-store-path? path) (string-suffix? ".drv" path))) (define (store-path-base path) "Return the base path of a path in the store." diff --git a/tests/store.scm b/tests/store.scm index 1f69f14cdcd..2eb6b778396 100644 --- a/tests/store.scm +++ b/tests/store.scm @@ -109,6 +109,18 @@ "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7/bin/guile"))) (not (direct-store-path? (%store-prefix))))) +(test-assert "derivation-path?" + (and (derivation-path? + (string-append (%store-prefix) + "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7.drv")) + (not (derivation-path? + (string-append (%store-prefix) + "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7"))) + (not (derivation-path? + (string-append + (%store-prefix) + "/283gqy39v3g9dxjy26rynl0zls82fmcg-guile-2.0.7/guile.drv"))))) + (test-skip (if %store 0 18)) (test-equal "substitute-urls, default"