From 00554b2a0f4410e428de527c16c2b3bbe8daeb3a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 2 Sep 2013 23:30:07 +0200 Subject: substitute-binary: Show the Nar size, when available. * guix/scripts/substitute-binary.scm (guix-substitute-binary)["--substitute"]: Show the Nar size, when available. * guix/ui.scm (show-what-to-build): Add 'TODO'. --- guix/scripts/substitute-binary.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/substitute-binary.scm b/guix/scripts/substitute-binary.scm index 97bbfcbce8..63f0c4f8d2 100755 --- a/guix/scripts/substitute-binary.scm +++ b/guix/scripts/substitute-binary.scm @@ -508,8 +508,13 @@ PORT. REPORT-PROGRESS is a two-argument procedure such as that returned by ;; Tell the daemon what the expected hash of the Nar itself is. (format #t "~a~%" (narinfo-hash narinfo)) - (format (current-error-port) "downloading `~a' from `~a'...~%" - store-path (uri->string uri)) + (format (current-error-port) "downloading `~a' from `~a'~:[~*~; (~,1f MiB installed)~]...~%" + store-path (uri->string uri) + + ;; Use the Nar size as an estimate of the installed size. + (narinfo-size narinfo) + (and=> (narinfo-size narinfo) + (cute / <> (expt 2. 20)))) (let*-values (((raw download-size) ;; Note that Hydra currently generates Nars on the fly ;; and doesn't specify a Content-Length, so -- cgit v1.2.3