From d7ddb257c9d22c794d6b26af64a57901ccee71e0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 27 Sep 2013 01:17:01 +0200 Subject: guix package: '--delete-generations' deletes generations older than specified. * guix/scripts/package.scm (matching-generations): Add 'duration-relation' keyword parameter. (guix-package)[process-action](delete-generations): Pass #:duration-relation >. * tests/guix-package.sh: Add test. * doc/guix.texi (Invoking guix package): Clarify the meaning of durations for '--list-durations' and '--delete-durations'. --- doc/guix.texi | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 2e6bdc595e..29928c5af4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -711,18 +711,24 @@ second one. @item @emph{Durations}. You can also get the last @emph{N}@tie{}days, weeks, or months by passing an integer along with the first letter of the -duration, e.g., @code{--list-generations=20d}. +duration. For example, @code{--list-generations=20d} lists generations +that are up to 20 days old. @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. +When @var{pattern} is omitted, delete all generations except the current +one. 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. +When @var{pattern} is specified, delete the matching generations. When +@var{pattern} specifies a duration, generations @emph{older} than the +specified duration match. For instance, @code{--delete-generations=1m} +deletes generations that are more than one month old. + +If the current generation matches, it is deleted atomically---i.e., by +switching to the previous available generation. Note that the zeroth +generation is never deleted. @end table -- cgit v1.2.3