From 38d27786086ff2b8d1325b1c0090ccff3745adfc Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 19 May 2015 09:59:45 +0200 Subject: guix gc: Add '--optimize'. * guix/scripts/gc.scm (show-help, %options): Add --optimize. (guix-gc): Handle it. --- guix/scripts/gc.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/scripts/gc.scm b/guix/scripts/gc.scm index ed16cab8f9..4bae65a1ec 100644 --- a/guix/scripts/gc.scm +++ b/guix/scripts/gc.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013 Ludovic Courtès +;;; Copyright © 2012, 2013, 2015 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -43,6 +43,8 @@ (define (show-help) collect at least MIN bytes of garbage")) (display (_ " -d, --delete attempt to delete PATHS")) + (display (_ " + --optimize optimize the store by deduplicating identical files")) (display (_ " --list-dead list dead paths")) (display (_ " @@ -88,6 +90,10 @@ (define %options (lambda (opt name arg result) (alist-cons 'action 'delete (alist-delete 'action result)))) + (option '("optimize") #f #f + (lambda (opt name arg result) + (alist-cons 'action 'optimize + (alist-delete 'action result)))) (option '("list-dead") #f #f (lambda (opt name arg result) (alist-cons 'action 'list-dead @@ -169,6 +175,8 @@ (define (list-relatives relatives) (list-relatives requisites)) ((list-referrers) (list-relatives referrers)) + ((optimize) + (optimize-store store)) ((list-dead) (for-each (cut simple-format #t "~a~%" <>) (dead-paths store))) -- cgit v1.2.3