summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-05-19 09:59:45 +0200
committerLudovic Courtès <ludo@gnu.org>2015-05-19 16:09:58 +0200
commit38d27786086ff2b8d1325b1c0090ccff3745adfc (patch)
tree57deedf95169ad34e83c91dff742e01a11e5486d /guix/scripts
parente3fd0ce6969a62665a1eaedccebb6b21ced1e86f (diff)
guix gc: Add '--optimize'.
* guix/scripts/gc.scm (show-help, %options): Add --optimize. (guix-gc): Handle it.
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/gc.scm10
1 files changed, 9 insertions, 1 deletions
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 <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2015 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -44,6 +44,8 @@ Invoke the garbage collector.\n"))
(display (_ "
-d, --delete attempt to delete PATHS"))
(display (_ "
+ --optimize optimize the store by deduplicating identical files"))
+ (display (_ "
--list-dead list dead paths"))
(display (_ "
--list-live list live paths"))
@@ -88,6 +90,10 @@ Invoke the garbage collector.\n"))
(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 @@ Invoke the garbage collector.\n"))
(list-relatives requisites))
((list-referrers)
(list-relatives referrers))
+ ((optimize)
+ (optimize-store store))
((list-dead)
(for-each (cut simple-format #t "~a~%" <>)
(dead-paths store)))