[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/12: daemon: Fix the displayed GC estimated progress.
From: |
guix-commits |
Subject: |
06/12: daemon: Fix the displayed GC estimated progress. |
Date: |
Sat, 11 Jan 2020 18:22:39 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit be0fb348b8f9e535510d37cc6b84bec480ef5fa1
Author: Ludovic Courtès <address@hidden>
AuthorDate: Sat Jan 11 22:11:16 2020 +0100
daemon: Fix the displayed GC estimated progress.
* nix/libstore/gc.cc (LocalStore::deletePathRecursive): Fix computation
of 'fraction'. Take 'bytesInvalidated' into account.
---
nix/libstore/gc.cc | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/nix/libstore/gc.cc b/nix/libstore/gc.cc
index 5043963..77d7fa2 100644
--- a/nix/libstore/gc.cc
+++ b/nix/libstore/gc.cc
@@ -426,13 +426,14 @@ void LocalStore::deletePathRecursive(GCState & state,
const Path & path)
}
if (state.options.maxFreed != ULLONG_MAX) {
- double fraction = state.results.bytesFreed + size
- / state.options.maxFreed;
+ auto freed = state.results.bytesFreed + state.bytesInvalidated;
+ double fraction = ((double) freed) / (double) state.options.maxFreed;
unsigned int percentage = (fraction > 1. ? 1. : fraction) * 100.;
printMsg(lvlInfo, format("[%1%%%] deleting '%2%'") % percentage % path);
} else {
- size_t total = (state.results.bytesFreed + size) / (1024 * 1024);
- printMsg(lvlInfo, format("[%1% MiB] deleting '%2%'") % total % path);
+ auto freed = state.results.bytesFreed + state.bytesInvalidated;
+ freed /= 1024ULL * 1024ULL;
+ printMsg(lvlInfo, format("[%1% MiB] deleting '%2%'") % freed % path);
}
state.results.paths.insert(path);
- branch master updated (6b9839e -> f9e0488), guix-commits, 2020/01/11
- 02/12: gnu: Use the two-element 'define-deprecated' form where applicable., guix-commits, 2020/01/11
- 03/12: gnu: cmake@3.15.5: Apply "cmake-curl-certificates.patch"., guix-commits, 2020/01/11
- 05/12: daemon: Account for deleted store files when deduplication is on., guix-commits, 2020/01/11
- 08/12: gnu: entr: Fix references to external programs., guix-commits, 2020/01/11
- 12/12: doc: Make sure 'htmlxref.cnf' is honored., guix-commits, 2020/01/11
- 01/12: deprecation: Add a two-element form for simple aliases., guix-commits, 2020/01/11
- 07/12: system: Drop net-tools from %BASE-PACKAGES (replaced by iproute2)., guix-commits, 2020/01/11
- 06/12: daemon: Fix the displayed GC estimated progress.,
guix-commits <=
- 09/12: gnu: timidity++: Add libvorbis as input, guix-commits, 2020/01/11
- 11/12: doc: Update htmlxref.cnf., guix-commits, 2020/01/11
- 04/12: gnu: cmake@3.15.5: Honor 'SSL_CERT_DIR' and 'SSL_CERT_FILE'., guix-commits, 2020/01/11
- 10/12: gnu: Add libolm., guix-commits, 2020/01/11