aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Neidhardt <mail@ambrevar.xyz>2020-03-06 08:29:09 +0100
committerPierre Neidhardt <mail@ambrevar.xyz>2020-03-06 08:32:01 +0100
commit1d24cc6de674ff8cd6321eb373ab86c8028e2281 (patch)
treee1bf456ca621d976b0482152efc5179cb3ca2ad9
parentbc8b2ffdac3f55414629ace5b1a0db32e9656c0a (diff)
downloadpatches-1d24cc6de674ff8cd6321eb373ab86c8028e2281.tar
patches-1d24cc6de674ff8cd6321eb373ab86c8028e2281.tar.gz
scripts: Show disk-space warning when under the min of the thresholds.
Follow-up to 71c3c3df92375ca9b4bd28b2be90dda67288fa5c which got the logic wrong. * guix/scripts.scm (warn-about-disk-space): Compare AVAILABLE to the min of RELATIVE-THRESHOLD-IN-BYTES and ABSOLUTE-THRESHOLD-IN-BYTES, not the max.
-rw-r--r--guix/scripts.scm2
1 files changed, 1 insertions, 1 deletions
diff --git a/guix/scripts.scm b/guix/scripts.scm
index e235c8d4c3..3e19e38957 100644
--- a/guix/scripts.scm
+++ b/guix/scripts.scm
@@ -237,7 +237,7 @@ THRESHOLDS is a pair (ABSOLUTE-THRESHOLD . RELATIVE-THRESHOLD)."
(total (* block-size (file-system-block-count stats)))
(relative-threshold-in-bytes (* total (cadr thresholds)))
(absolute-threshold-in-bytes (car thresholds)))
- (when (< available (max relative-threshold-in-bytes
+ (when (< available (min relative-threshold-in-bytes
absolute-threshold-in-bytes))
(warning (G_ "only ~,1f GiB of free space available on ~a~%")
(/ available 1. GiB) (%store-prefix))