aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCyrill Schenkel <cyrill.schenkel@gmail.com>2015-05-24 14:04:15 +0200
committerLudovic Courtès <ludo@gnu.org>2015-05-26 22:26:01 +0200
commitcdb5b075d545dd4e0b2a03bdc62fa0d1f6e00fc3 (patch)
tree45acbdd1be71153881dc51c76e9ae6006547e026 /tests
parent9aafbc0c1382ab78059804eb16b0900fd3b10ee4 (diff)
downloadguix-cdb5b075d545dd4e0b2a03bdc62fa0d1f6e00fc3.tar.gz
guix-cdb5b075d545dd4e0b2a03bdc62fa0d1f6e00fc3.zip
gc: ignore trailing slash or subdirectories for `guix gc -d'
Fixes <http://bugs.gnu.org/19757>. * guix/scripts/gc.scm (guix-gc): Convert paths to direct store paths. * guix/store.scm (direct-store-path): Get rid of subdirectories in store path. * tests/guix-gc.sh: New tests. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-gc.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/guix-gc.sh b/tests/guix-gc.sh
index eac9d82e89..c1eb66cef5 100644
--- a/tests/guix-gc.sh
+++ b/tests/guix-gc.sh
@@ -64,3 +64,23 @@ guix gc -C 1KiB
# Check trivial error cases.
if guix gc --delete /dev/null;
then false; else true; fi
+
+# Bug #19757
+out="`guix build guile-bootstrap`"
+test -d "$out"
+
+guix gc --delete "$out"
+
+! test -d "$out"
+
+out="`guix build guile-bootstrap`"
+test -d "$out"
+
+guix gc --delete "$out/"
+
+! test -d "$out"
+
+out="`guix build guile-bootstrap`"
+test -d "$out"
+
+guix gc --delete "$out/bin/guile"