aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/nar-herder.in18
1 files changed, 15 insertions, 3 deletions
diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in
index c4a4bd2..c20aab7 100644
--- a/scripts/nar-herder.in
+++ b/scripts/nar-herder.in
@@ -483,9 +483,21 @@
(when (not (= (response-code response) 200))
(error "unable to fetch database from mirror"))
- (call-with-output-file (assq-ref opts 'database)
- (lambda (output-port)
- (dump-port body output-port)))
+ (let* ((reporter (progress-reporter/file
+ (uri->string database-uri)
+ (response-content-length response)
+ (current-error-port)))
+ (port
+ (progress-report-port
+ reporter
+ body
+ #:download-size (response-content-length response))))
+
+ (call-with-output-file (assq-ref opts 'database)
+ (lambda (output-port)
+ (dump-port port output-port)))
+
+ (close-port port))
(simple-format (current-error-port)
"finished downloading the database\n")))))