From 8e59fdd53bbc3eba75328e1e1a329291fcedc0bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 13 Jun 2013 22:15:41 +0200 Subject: [PATCH] guix gc: Add `--requisites'. * guix/scripts/gc.scm (show-help, %options): Add `--requisites'. (guix-gc): Handle it. * doc/guix.texi (Invoking guix gc): Document `--requisites'. * NEWS: Update. --- NEWS | 4 ++++ doc/guix.texi | 7 +++++++ guix/scripts/gc.scm | 8 ++++++++ 3 files changed, 19 insertions(+) diff --git a/NEWS b/NEWS index 3a946ec59d..6c33b9ab58 100644 --- a/NEWS +++ b/NEWS @@ -32,6 +32,10 @@ See the manual for details. This option instructs to fall back to local builds when the substituter fails to download a substitute. +*** New ‘--requisites’ option for “guix gc” + +See the manual for details. + ** Bugs fixed *** “guix --help” now works when using Guile 2.0.5 *** Binary substituter multi-threading and pipe issues fixed diff --git a/doc/guix.texi b/doc/guix.texi index 02fb9982c1..23e8351c02 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -722,6 +722,13 @@ In addition, the references among existing store files can be queried: List the references (respectively, the referrers) of store files given as arguments. +@item --requisites +@itemx -R +List the requisites of the store files passed as arguments. Requisites +include the store files themselves, their references, and the references +of these, recursively. In other words, the returned list is the +@dfn{transitive closure} of the store files. + @end table diff --git a/guix/scripts/gc.scm b/guix/scripts/gc.scm index cecb68ec36..77ec7635de 100644 --- a/guix/scripts/gc.scm +++ b/guix/scripts/gc.scm @@ -50,6 +50,8 @@ (define (show-help) (newline) (display (_ " --references list the references of PATHS")) + (display (_ " + -R, --requisites list the requisites of PATHS")) (display (_ " --referrers list the referrers of PATHS")) (newline) @@ -128,6 +130,10 @@ (define %options (lambda (opt name arg result) (alist-cons 'action 'list-references (alist-delete 'action result)))) + (option '(#\R "requisites") #f #f + (lambda (opt name arg result) + (alist-cons 'action 'list-requisites + (alist-delete 'action result)))) (option '("referrers") #f #f (lambda (opt name arg result) (alist-cons 'action 'list-referrers @@ -189,6 +195,8 @@ (define (list-relatives relatives) (delete-paths store paths)) ((list-references) (list-relatives references)) + ((list-requisites) + (list-relatives requisites)) ((list-referrers) (list-relatives referrers)) ((list-dead)