[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/06: guix system: init: Check the available space before copying.
From: |
Ludovic Courtès |
Subject: |
04/06: guix system: init: Check the available space before copying. |
Date: |
Mon, 2 Jul 2018 18:39:20 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 71bf6cb700965cfe5b8f3661315017b022d0aca1
Author: Ludovic Courtès <address@hidden>
Date: Mon Jul 2 23:59:52 2018 +0200
guix system: init: Check the available space before copying.
* guix/scripts/system.scm (copy-closure): Call 'query-path-info*' on
TO-COPY and REFS. Compute the total size. Call 'check-available-space'.
---
guix/scripts/system.scm | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 14aedce..92e9223 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -148,12 +148,18 @@ REFERENCES as its set of references."
"Copy ITEM and all its dependencies to the store under root directory
TARGET, and register them."
(mlet* %store-monad ((to-copy (topologically-sorted* (list item)))
- (refs (mapm %store-monad references* to-copy)))
+ (refs (mapm %store-monad references* to-copy))
+ (info (mapm %store-monad query-path-info*
+ (delete-duplicates
+ (append to-copy (concatenate refs)))))
+ (size -> (reduce + 0 (map path-info-nar-size info))))
(define progress-bar
(progress-reporter/bar (length to-copy)
(format #f (G_ "copying to '~a'...")
target)))
+ (check-available-space size target)
+
(call-with-progress-reporter progress-bar
(lambda (report)
(let ((void (%make-void-port "w")))
- branch master updated (c729901 -> 3dbf331), Ludovic Courtès, 2018/07/02
- 03/06: ui: Make 'check-available-space' public., Ludovic Courtès, 2018/07/02
- 05/06: deduplication: Fix incorrect use of 'throw'., Ludovic Courtès, 2018/07/02
- 01/06: packages: Optimize 'package-transitive-supported-systems'., Ludovic Courtès, 2018/07/02
- 02/06: store: Add 'query-path-info*'., Ludovic Courtès, 2018/07/02
- 04/06: guix system: init: Check the available space before copying.,
Ludovic Courtès <=
- 06/06: deduplication: Place link files under /gnu/store/.links., Ludovic Courtès, 2018/07/02