scripts: gc: Report size in MiBs instead of bytes.

* guix/scripts/gc.scm (guix-gc): Show info in MiBs not bytes.
This commit is contained in:
Taylan Kammer 2018-06-22 21:55:26 +02:00
parent 3785ccd201
commit 0925c0ea77
No known key found for this signature in database
GPG Key ID: AF8138351A5CB8EE
1 changed files with 5 additions and 5 deletions

View File

@ -199,10 +199,10 @@ Invoke the garbage collector.\n"))
;; Attempt to have at least SPACE bytes available in STORE. ;; Attempt to have at least SPACE bytes available in STORE.
(let ((free (free-disk-space (%store-prefix)))) (let ((free (free-disk-space (%store-prefix))))
(if (> free space) (if (> free space)
(info (G_ "already ~h bytes available on ~a, nothing to do~%") (info (G_ "already ~h MiBs available on ~a, nothing to do~%")
free (%store-prefix)) (/ free 1024. 1024.) (%store-prefix))
(let ((to-free (- space free))) (let ((to-free (- space free)))
(info (G_ "freeing ~h bytes~%") to-free) (info (G_ "freeing ~h MiBs~%") (/ to-free 1024. 1024.))
(collect-garbage store to-free))))) (collect-garbage store to-free)))))
(with-error-handling (with-error-handling
@ -234,10 +234,10 @@ Invoke the garbage collector.\n"))
(ensure-free-space store free-space)) (ensure-free-space store free-space))
(min-freed (min-freed
(let-values (((paths freed) (collect-garbage store min-freed))) (let-values (((paths freed) (collect-garbage store min-freed)))
(info (G_ "freed ~h bytes~%") freed))) (info (G_ "freed ~h MiBs~%") (/ freed 1024. 1024.))))
(else (else
(let-values (((paths freed) (collect-garbage store))) (let-values (((paths freed) (collect-garbage store)))
(info (G_ "freed ~h bytes~%") freed)))))) (info (G_ "freed ~h MiBs~%") (/ freed 1024. 1024.)))))))
((delete) ((delete)
(delete-paths store (map direct-store-path paths))) (delete-paths store (map direct-store-path paths)))
((list-references) ((list-references)