guix_mirror_bot pushed a commit to branch master
in repository guix.

commit a06c9b0ff721a5ec3f0c214cc92dc00175595dab
Author: Yarl Baudig <[email protected]>
AuthorDate: Sat Feb 7 02:16:01 2026 +0100

    store: Make derivation-path? use direct-store-path?.
    
    * guix/store.scm (derivation-path?): Use direct-store-path? instead of
    store-path?.
    * tests/store.scm (derivation-path?): New test.
    
    Change-Id: Ib54b9e2045f19f26039cf072eeb79dab8f0195be
    Signed-off-by: Ludovic Courtès <[email protected]>
    Merges: #6192
---
 guix/store.scm  |  2 +-
 tests/store.scm | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/guix/store.scm b/guix/store.scm
index 3c48e1d110..bd90da22cd 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 1f69f14cdc..2eb6b77839 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"

Reply via email to