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'. --- doc/guix.texi | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index 442cef26da..2e6bdc595e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -714,6 +714,16 @@ or months by passing an integer along with the first letter of the duration, e.g., @code{--list-generations=20d}. @end itemize +@item --delete-generations[=@var{pattern}] +@itemx -d [@var{pattern}] +Delete all generations except the current one. Note that the zeroth +generation is never deleted. + +This command accepts the same patterns as @option{--list-generations}. +When @var{pattern} is specified, delete the matching generations. If +the current generation matches, it is deleted atomically, i.e., by +switching to the previous available generation. + @end table @node Packages with Multiple Outputs -- cgit v1.2.3