[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/05: guix gc: Add '--optimize'.
From: |
Ludovic Courtès |
Subject: |
05/05: guix gc: Add '--optimize'. |
Date: |
Tue, 19 May 2015 14:10:20 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 38d27786086ff2b8d1325b1c0090ccff3745adfc
Author: Ludovic Courtès <address@hidden>
Date: Tue May 19 09:59:45 2015 +0200
guix gc: Add '--optimize'.
* guix/scripts/gc.scm (show-help, %options): Add --optimize.
(guix-gc): Handle it.
---
doc/guix.texi | 11 +++++++++++
guix/scripts/gc.scm | 10 +++++++++-
2 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 91c86dc..0d2a01f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -1472,6 +1472,17 @@ Attempt to delete all the store files and directories
specified as
arguments. This fails if some of the files are not in the store, or if
they are still live.
address@hidden --optimize
address@hidden deduplication
+Optimize the store by hard-linking identical files---this is
address@hidden
+
+The daemon performs deduplication after each successful build or archive
+import, unless it was started with @code{--disable-deduplication}
+(@pxref{Invoking guix-daemon, @code{--disable-deduplication}}). Thus,
+this option is primarily useful when the daemon was running with
address@hidden
+
@item --list-dead
Show the list of dead files and directories still present in the
store---i.e., files and directories no longer reachable from any root.
diff --git a/guix/scripts/gc.scm b/guix/scripts/gc.scm
index ed16cab..4bae65a 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 <address@hidden>
+;;; Copyright © 2012, 2013, 2015 Ludovic Courtès <address@hidden>
;;;
;;; 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)))