guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: download-nar: Improve output.


From: guix-commits
Subject: branch master updated: download-nar: Improve output.
Date: Fri, 28 Jul 2023 13:15:20 -0400

This is an automated email from the git hooks/post-receive script.

cbaines pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 3bb3fddb5c download-nar: Improve output.
3bb3fddb5c is described below

commit 3bb3fddb5c6e79056172e5858cdc0ee0b6b8cfaa
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Fri Jul 28 18:08:17 2023 +0100

    download-nar: Improve output.
    
    Report errors that occur, output the "Downloading from " line before 
starting
    to report progress and end the output with a newline.
---
 guix/build/download-nar.scm | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/guix/build/download-nar.scm b/guix/build/download-nar.scm
index 1b5b5503eb..3ba121b7fb 100644
--- a/guix/build/download-nar.scm
+++ b/guix/build/download-nar.scm
@@ -73,29 +73,34 @@ success, #f otherwise."
                      (catch #t
                        (lambda ()
                          (http-fetch (string->uri url)))
-                       (lambda args
+                       (lambda (key . args)
+                         (format #t "Unable to fetch from ~a, ~a: ~a~%"
+                                 (uri-host (string->uri url))
+                                 key
+                                 args)
                          (values #f #f)))))
          (if (not port)
              (loop rest)
-             (let* ((reporter (progress-reporter/file
-                               url
-                               size
-                               (current-error-port)
-                               #:abbreviation nar-uri-abbreviation))
-                    (port-with-progress
-                     (progress-report-port reporter port
-                                           #:download-size size)))
+             (begin
                (if size
                    (format #t "Downloading from ~a (~,2h MiB)...~%" url
                            (/ size (expt 2 20.)))
                    (format #t "Downloading from ~a...~%" url))
-               (if (string-contains url "/lzip")
-                   (restore-lzipped-nar port-with-progress
-                                        item
-                                        size)
-                   (begin
+               (let* ((reporter (progress-reporter/file
+                                 url
+                                 size
+                                 (current-error-port)
+                                 #:abbreviation nar-uri-abbreviation))
+                      (port-with-progress
+                       (progress-report-port reporter port
+                                             #:download-size size)))
+                 (if (string-contains url "/lzip")
+                     (restore-lzipped-nar port-with-progress
+                                          item
+                                          size)
                      (restore-file port-with-progress
                                    item)))
+               (newline)
                #t))))
       (()
        #f))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]