From b7884ca3ca72b39397ff0abd1154f97b981394cd Mon Sep 17 00:00:00 2001 From: Nikita Karetnikov Date: Thu, 26 Sep 2013 02:36:24 +0000 Subject: guix package: Add '--delete-generations'. * guix/scripts/package.scm (switch-to-previous-generation): New function. (roll-back): Use the new function instead of 'switch-link'. (show-help): Add '--delete-generations'. (%options): Likewise. (guix-package)[process-actions]: Add 'current-generation-number', 'display-and-delete', and 'delete-generation'. Add support for '--delete-generations', and reindent the code. * tests/guix-package.sh: Test '--delete-generations'. * doc/guix.texi (Invoking guix-package): Document '--delete-generations'. --- tests/guix-package.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/guix-package.sh') diff --git a/tests/guix-package.sh b/tests/guix-package.sh index 5f97aff026..fc1c07287f 100644 --- a/tests/guix-package.sh +++ b/tests/guix-package.sh @@ -142,6 +142,17 @@ then # Make sure LIBRARY_PATH gets listed by `--search-paths'. guix package --bootstrap -p "$profile" -i guile-bootstrap -i gcc-bootstrap guix package --search-paths -p "$profile" | grep LIBRARY_PATH + + # Delete the third generation and check that it was actually deleted. + guix package -p "$profile" --delete-generations=3 + test -z "`guix package -p "$profile" -l 3`" + + # Exit with 1 when a generation does not exist. + if guix package -p "$profile" --delete-generations=42; + then false; else true; fi + + # Exit with 0 when trying to delete the zeroth generation. + guix package -p "$profile" --delete-generations=0 fi # Make sure the `:' syntax works. -- cgit v1.2.3