1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

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>
This commit is contained in:
Cyrill Schenkel
2015-05-24 14:04:15 +02:00
committed by Ludovic Courtès
parent 9aafbc0c13
commit cdb5b075d5
3 changed files with 31 additions and 1 deletions

View File

@@ -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"