summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--guix/.SRCINFO27
-rw-r--r--guix/PKGBUILD26
-rw-r--r--guix/guix-1.2.0-guile-json-4.5.patch65
-rw-r--r--guix/guix-1.2.0-json-crate.patch84
-rw-r--r--guix/guix-1.2.0-json-cve-swh.patch44
-rw-r--r--guix/guix-1.2.0-revert-verify-swh-certificate.patch159
-rw-r--r--guix/guix-1.3.0-revert-display-download-progress-tty.patch125
7 files changed, 148 insertions, 382 deletions
diff --git a/guix/.SRCINFO b/guix/.SRCINFO
index a8a2041..aa15ad4 100644
--- a/guix/.SRCINFO
+++ b/guix/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = guix
pkgdesc = A purely functional package manager for the GNU system
- pkgver = 1.2.0
+ pkgver = 1.3.0
pkgrel = 1
url = https://guix.gnu.org
install = guix.install
@@ -11,6 +11,7 @@ pkgbase = guix
makedepends = guile-ssh>=0.13.0
makedepends = guile-zstd
makedepends = guile-semver
+ makedepends = guile-lib
makedepends = bash-completion
makedepends = fish
makedepends = help2man
@@ -18,7 +19,7 @@ pkgbase = guix
depends = guile>=2.2.4
depends = guile-gcrypt>=0.1.0
depends = guile-sqlite3>=0.1.0
- depends = guile-zlib
+ depends = guile-zlib>=0.1.0
depends = guile-lzlib
depends = guile-avahi
depends = guile-git-lib>=0.3.0
@@ -31,20 +32,14 @@ pkgbase = guix
optdepends = guile-ssh: to offload builds to other machines
optdepends = guile-zstd: to use and publish zstd substitutes
optdepends = guile-semver: to use the crate importer
+ optdepends = guile-lib: to use the go importer
options = !strip
- source = https://ftp.gnu.org/gnu/guix/guix-1.2.0.tar.gz
- source = https://ftp.gnu.org/gnu/guix/guix-1.2.0.tar.gz.sig
- source = guix-1.2.0-json-cve-swh.patch
- source = guix-1.2.0-json-crate.patch
- source = guix-1.2.0-guile-json-4.5.patch
- source = guix-1.2.0-revert-verify-swh-certificate.patch
- validpgpkeys = 3CE464558A84FDC69DB40CFB090B11993D9AEBB5
- sha256sums = 5ecdf7ced25b1fb0ca7c57e794b7b60c8a7adcb15261dec2af37925c838c6d74
- sha256sums = e278e3aba3fe9acd35aa6586933d940f0c847ccfb6d1370cb5c4f754732d2fb6
- sha256sums = 39fba6b74fcc97155f0e81c603d3e0a0dcc17ce8070faa47dec5bd637383aedd
- sha256sums = 1b62d816090305ce5e5742813341409aa7b68157cc1c3cfc0b0fff3a583d2762
- sha256sums = 837def9c966f14e29291dfac6c8c642d8b64eda46458605bef6416a155d5ba4e
- sha256sums = 921c6fd2849c38d93e1f23e5d1f582889e2fc705c1827702bddecede3344088b
+ source = https://ftp.gnu.org/gnu/guix/guix-1.3.0.tar.gz
+ source = https://ftp.gnu.org/gnu/guix/guix-1.3.0.tar.gz.sig
+ source = guix-1.3.0-revert-display-download-progress-tty.patch
+ validpgpkeys = 27D586A4F8900854329FF09F1260E46482E63562
+ sha256sums = cb0f461c48d5823dfef7f88879a179737ee14c4dd93732d671932fc4e25053e8
+ sha256sums = 5c1c724a146e73b0e2b352dda1e1a4eb052e7dc89837f590693f0af23a6c404d
+ sha256sums = 4e110acfc8b8940b5de880ba782f607be666327a36b2ca2a124e96cc6846a560
pkgname = guix
-
diff --git a/guix/PKGBUILD b/guix/PKGBUILD
index 4704754..1a76aca 100644
--- a/guix/PKGBUILD
+++ b/guix/PKGBUILD
@@ -6,7 +6,7 @@
# gpg --recv-keys 3CE464558A84FDC69DB40CFB090B11993D9AEBB5
pkgname=guix
-pkgver=1.2.0
+pkgver=1.3.0
pkgrel=1
pkgdesc='A purely functional package manager for the GNU system'
arch=('x86_64' 'i686' 'armv7h')
@@ -17,6 +17,7 @@ makedepends=(
'guile-ssh>=0.13.0'
'guile-zstd'
'guile-semver'
+ 'guile-lib'
'bash-completion'
'fish'
'help2man'
@@ -25,7 +26,7 @@ depends=(
'guile>=2.2.4'
'guile-gcrypt>=0.1.0'
'guile-sqlite3>=0.1.0'
- 'guile-zlib'
+ 'guile-zlib>=0.1.0'
'guile-lzlib'
'guile-avahi'
'guile-git-lib>=0.3.0'
@@ -38,22 +39,17 @@ optdepends=(
'bash-completion: to enable bash programmable completion'
'guile-ssh: to offload builds to other machines'
'guile-zstd: to use and publish zstd substitutes'
- 'guile-semver: to use the crate importer')
+ 'guile-semver: to use the crate importer'
+ 'guile-lib: to use the go importer')
source=(
"https://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz"{,.sig}
- 'guix-1.2.0-json-cve-swh.patch'
- 'guix-1.2.0-json-crate.patch'
- 'guix-1.2.0-guile-json-4.5.patch'
- 'guix-1.2.0-revert-verify-swh-certificate.patch')
+ 'guix-1.3.0-revert-display-download-progress-tty.patch')
install="${pkgname}.install"
sha256sums=(
- '5ecdf7ced25b1fb0ca7c57e794b7b60c8a7adcb15261dec2af37925c838c6d74'
- 'e278e3aba3fe9acd35aa6586933d940f0c847ccfb6d1370cb5c4f754732d2fb6'
- '39fba6b74fcc97155f0e81c603d3e0a0dcc17ce8070faa47dec5bd637383aedd'
- '1b62d816090305ce5e5742813341409aa7b68157cc1c3cfc0b0fff3a583d2762'
- '837def9c966f14e29291dfac6c8c642d8b64eda46458605bef6416a155d5ba4e'
- '921c6fd2849c38d93e1f23e5d1f582889e2fc705c1827702bddecede3344088b')
-validpgpkeys=('3CE464558A84FDC69DB40CFB090B11993D9AEBB5')
+ 'cb0f461c48d5823dfef7f88879a179737ee14c4dd93732d671932fc4e25053e8'
+ '5c1c724a146e73b0e2b352dda1e1a4eb052e7dc89837f590693f0af23a6c404d'
+ '4e110acfc8b8940b5de880ba782f607be666327a36b2ca2a124e96cc6846a560')
+validpgpkeys=('27D586A4F8900854329FF09F1260E46482E63562')
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
@@ -103,6 +99,8 @@ package() {
make DESTDIR="${pkgdir}" install
# Remove unused upstart service files
rm -r "${pkgdir}/usr/lib/upstart"
+ # Remove unused openrc service files
+ rm -r "${pkgdir}/etc/openrc"
# Remove unused sysvinit service files
rm -r "${pkgdir}/etc/init.d"
# Remove the empty directory left by sysvinit service files as well
diff --git a/guix/guix-1.2.0-guile-json-4.5.patch b/guix/guix-1.2.0-guile-json-4.5.patch
deleted file mode 100644
index 07f7140..0000000
--- a/guix/guix-1.2.0-guile-json-4.5.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 3d43b7aef3d5b7ad2ba0418d2afd657e5fedeaf5 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
-Date: Wed, 20 Jan 2021 11:35:10 +0100
-Subject: [PATCH] import, swh: Adjust to Guile-JSON 4.5.x unspecified value
- handling.
-
-* guix/import/cpan.scm (<cpan-release>)[home-page]: Add 'unspecified?'
-case.
-* guix/import/gem.scm (<gem>)[licenses]: Likewise.
-(json->gem-dependency-list): Likewise.
-* guix/swh.scm (<directory-entry>)[checksums]: Likewise.
----
- guix/import/cpan.scm | 3 ++-
- guix/import/gem.scm | 5 +++--
- guix/swh.scm | 3 ++-
- 3 files changed, 7 insertions(+), 4 deletions(-)
-
-diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
-index 514417f781..87abe9c2f1 100644
---- a/guix/import/cpan.scm
-+++ b/guix/import/cpan.scm
-@@ -109,6 +109,7 @@
- (home-page cpan-release-home-page "resources"
- (match-lambda
- (#f #f)
-+ ((? unspecified?) #f)
- ((lst ...) (assoc-ref lst "homepage"))))
- (dependencies cpan-release-dependencies "dependency"
- (lambda (vector)
-diff --git a/guix/import/gem.scm b/guix/import/gem.scm
-index 1f6f94532e..418d716be6 100644
---- a/guix/import/gem.scm
-+++ b/guix/import/gem.scm
-@@ -49,6 +49,7 @@
- ;; This is sometimes #nil (the JSON 'null' value). Arrange
- ;; to always return a list.
- (cond ((not licenses) '())
-+ ((unspecified? licenses) '())
- ((vector? licenses) (vector->list licenses))
- (else '()))))
- (info gem-info)
-@@ -69,7 +70,7 @@
- json->gem-dependency-list))
-
- (define (json->gem-dependency-list vector)
-- (if vector
-+ (if (and vector (not (unspecified? vector)))
- (map json->gem-dependency (vector->list vector))
- '()))
-
-diff --git a/guix/swh.scm b/guix/swh.scm
-index 0b765cc743..f11b7ea2d5 100644
---- a/guix/swh.scm
-+++ b/guix/swh.scm
-@@ -348,6 +348,7 @@ FALSE-IF-404? is true, return #f upon 404 responses."
- (checksums directory-entry-checksums "checksums"
- (match-lambda
- (#f #f)
-+ ((? unspecified?) #f)
- (lst (json->checksums lst))))
- (id directory-entry-id "dir_id")
- (length directory-entry-length)
---
-2.29.2
-
diff --git a/guix/guix-1.2.0-json-crate.patch b/guix/guix-1.2.0-json-crate.patch
deleted file mode 100644
index 3677946..0000000
--- a/guix/guix-1.2.0-json-crate.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From 23862011c3d02814181399765a024c7fa3fadd97 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
-Date: Wed, 13 Jan 2021 22:42:49 +0100
-Subject: [PATCH] tests: Fix JSON syntax error in 'crate.scm'.
-
-This issue is caught with Guile-JSON 4.4.1, but not by 4.3.2.
-
-* tests/crate.scm (test-root-dependencies): Add missing comma.
----
- tests/crate.scm | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tests/crate.scm b/tests/crate.scm
-index bb7032c344..b6c3a7ee2e 100644
---- a/tests/crate.scm
-+++ b/tests/crate.scm
-@@ -36,8 +36,8 @@
- \"description\": \"summary\",
- \"homepage\": \"http://example.com\",
- \"repository\": \"http://example.com\",
-- \"keywords\": [\"dummy\" \"test\"],
-- \"categories\": [\"test\"]
-+ \"keywords\": [\"dummy\", \"test\"],
-+ \"categories\": [\"test\"],
- \"actual_versions\": [
- { \"id\": \"foo\",
- \"num\": \"1.0.0\",
-@@ -68,7 +68,7 @@
- \"description\": \"summary\",
- \"homepage\": \"http://example.com\",
- \"repository\": \"http://example.com\",
-- \"keywords\": [\"dummy\" \"test\"],
-+ \"keywords\": [\"dummy\", \"test\"],
- \"categories\": [\"test\"]
- \"actual_versions\": [
- { \"id\": \"foo\",
-@@ -92,7 +92,7 @@
- {
- \"crate_id\": \"intermediate-2\",
- \"kind\": \"normal\"
-- }
-+ },
- {
- \"crate_id\": \"leaf-alice\",
- \"kind\": \"normal\"
-@@ -112,7 +112,7 @@
- \"description\": \"summary\",
- \"homepage\": \"http://example.com\",
- \"repository\": \"http://example.com\",
-- \"keywords\": [\"dummy\" \"test\"],
-+ \"keywords\": [\"dummy\", \"test\"],
- \"categories\": [\"test\"]
- \"actual_versions\": [
- { \"id\": \"intermediate-1\",
-@@ -152,7 +152,7 @@
- \"description\": \"summary\",
- \"homepage\": \"http://example.com\",
- \"repository\": \"http://example.com\",
-- \"keywords\": [\"dummy\" \"test\"],
-+ \"keywords\": [\"dummy\", \"test\"],
- \"categories\": [\"test\"]
- \"actual_versions\": [
- { \"id\": \"intermediate-2\",
-@@ -184,7 +184,7 @@
- \"description\": \"summary\",
- \"homepage\": \"http://example.com\",
- \"repository\": \"http://example.com\",
-- \"keywords\": [\"dummy\" \"test\"],
-+ \"keywords\": [\"dummy\", \"test\"],
- \"categories\": [\"test\"]
- \"actual_versions\": [
- { \"id\": \"leaf-alice\",
-@@ -211,7 +211,7 @@
- \"description\": \"summary\",
- \"homepage\": \"http://example.com\",
- \"repository\": \"http://example.com\",
-- \"keywords\": [\"dummy\" \"test\"],
-+ \"keywords\": [\"dummy\", \"test\"],
- \"categories\": [\"test\"]
- \"actual_versions\": [
- { \"id\": \"leaf-bob\",
---
-2.29.2
-
diff --git a/guix/guix-1.2.0-json-cve-swh.patch b/guix/guix-1.2.0-json-cve-swh.patch
deleted file mode 100644
index aff4c89..0000000
--- a/guix/guix-1.2.0-json-cve-swh.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 9608f4003dedd8dfe99327c15668ca1a43ebd93b Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
-Date: Mon, 21 Dec 2020 11:44:19 +0100
-Subject: [PATCH] tests: Fix malformed JSON.
-
-Guile-JSON 4.3.2 would parse in spite of these typos, but 4.4.1 is
-stricter.
-
-* tests/swh.scm (%directory-entries): Add missing comma.
-* tests/cve-sample.json: Likewise.
----
- tests/cve-sample.json | 2 +-
- tests/swh.scm | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/tests/cve-sample.json b/tests/cve-sample.json
-index 39816f9dd4..11b71817bb 100644
---- a/tests/cve-sample.json
-+++ b/tests/cve-sample.json
-@@ -49,7 +49,7 @@
- "vulnerable" : true,
- "cpe23Uri" : "cpe:2.3:o:juniper:junos:16.1:*:*:*:*:*:*:*"
- } ]
-- } {
-+ }, {
- "operator" : "OR",
- "cpe_match" : [ {
- "vulnerable" : true,
-diff --git a/tests/swh.scm b/tests/swh.scm
-index aef68acbe7..06984b2a80 100644
---- a/tests/swh.scm
-+++ b/tests/swh.scm
-@@ -33,7 +33,7 @@
- "[ { \"name\": \"one\",
- \"type\": \"regular\",
- \"length\": 123,
-- \"dir_id\": 1 }
-+ \"dir_id\": 1 },
- { \"name\": \"two\",
- \"type\": \"regular\",
- \"length\": 456,
---
-2.29.2
-
diff --git a/guix/guix-1.2.0-revert-verify-swh-certificate.patch b/guix/guix-1.2.0-revert-verify-swh-certificate.patch
deleted file mode 100644
index 567896f..0000000
--- a/guix/guix-1.2.0-revert-verify-swh-certificate.patch
+++ /dev/null
@@ -1,159 +0,0 @@
-From 951f5cca43676dbdde2f5c01118bce63905f7444 Mon Sep 17 00:00:00 2001
-From: Ting-Wei Lan <lantw44@gmail.com>
-Date: Wed, 17 Feb 2021 21:53:27 +0800
-Subject: [PATCH 1/2] Revert "git-download: Don't verify X.509 certificate of
- SWH."
-
-This reverts commit a7696b9733d4ede9817a0a0accb5ce5b85d9a2d3.
----
- guix/git-download.scm | 4 +---
- 1 file changed, 1 insertion(+), 3 deletions(-)
-
-diff --git a/guix/git-download.scm b/guix/git-download.scm
-index 8e575e3b5f..1267986fe8 100644
---- a/guix/git-download.scm
-+++ b/guix/git-download.scm
-@@ -131,11 +131,9 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
- (download-nar #$output)
-
- ;; As a last resort, attempt to download from Software Heritage.
-- ;; Disable X.509 certificate verification to avoid depending
-- ;; on nss-certs--we're authenticating the checkout anyway.
- ;; XXX: Currently recursive checkouts are not supported.
- (and (not recursive?)
-- (parameterize ((%verify-swh-certificate? #f))
-+ (begin
- (format (current-error-port)
- "Trying to download from Software Heritage...~%")
- (swh-download (getenv "git url") (getenv "git commit")
---
-2.29.2
-
-
-From bf6def8cc3bf569a93cb66dd76f0b78f06ed393b Mon Sep 17 00:00:00 2001
-From: Ting-Wei Lan <lantw44@gmail.com>
-Date: Wed, 17 Feb 2021 21:53:28 +0800
-Subject: [PATCH 2/2] Revert "swh: Allow callers to disable X.509 certificate
- verification."
-
-This reverts commit 722ad41c44a499d2250c79527ef7d069ca728de0.
----
- guix/swh.scm | 34 +++++++++-------------------------
- 1 file changed, 9 insertions(+), 25 deletions(-)
-
-diff --git a/guix/swh.scm b/guix/swh.scm
-index 0b765cc743..d9f7d6f508 100644
---- a/guix/swh.scm
-+++ b/guix/swh.scm
-@@ -34,7 +34,6 @@
- #:use-module (ice-9 popen)
- #:use-module ((ice-9 ftw) #:select (scandir))
- #:export (%swh-base-url
-- %verify-swh-certificate?
- %allow-request?
-
- request-rate-limit-reached?
-@@ -126,10 +125,6 @@
- ;; Presumably we won't need to change it.
- (make-parameter "https://archive.softwareheritage.org"))
-
--(define %verify-swh-certificate?
-- ;; Whether to verify the X.509 HTTPS certificate for %SWH-BASE-URL.
-- (make-parameter #t))
--
- (define (swh-url path . rest)
- ;; URLs returned by the API may be relative or absolute. This has changed
- ;; without notice before. Handle both cases by detecting whether the path
-@@ -147,13 +142,6 @@
- url
- (string-append url "/")))
-
--;; XXX: Work around a bug in Guile 3.0.2 where #:verify-certificate? would
--;; be ignored (<https://bugs.gnu.org/40486>).
--(define* (http-get* uri #:rest rest)
-- (apply http-request uri #:method 'GET rest))
--(define* (http-post* uri #:rest rest)
-- (apply http-request uri #:method 'POST rest))
--
- (define %date-regexp
- ;; Match strings like "2014-11-17T22:09:38+01:00" or
- ;; "2018-09-30T23:20:07.815449+00:00"".
-@@ -190,7 +178,7 @@ Software Heritage."
-
- (define %allow-request?
- ;; Takes a URL and method (e.g., the 'http-get' procedure) and returns true
-- ;; to keep going. This can be used to disallow requests when
-+ ;; to keep going. This can be used to disallow a requests when
- ;; 'request-rate-limit-reached?' returns true, for instance.
- (make-parameter (const #t)))
-
-@@ -206,7 +194,7 @@ Software Heritage."
- (string->uri url))
-
- (define reset-time
-- (if (and (eq? method http-post*)
-+ (if (and (eq? method http-post)
- (string-prefix? "/api/1/origin/save/" (uri-path uri)))
- %save-rate-limit-reset-time
- %general-rate-limit-reset-time))
-@@ -219,23 +207,21 @@ RESPONSE."
- (let ((uri (string->uri url)))
- (match (assq-ref (response-headers response) 'x-ratelimit-reset)
- ((= string->number (? number? reset))
-- (if (and (eq? method http-post*)
-+ (if (and (eq? method http-post)
- (string-prefix? "/api/1/origin/save/" (uri-path uri)))
- (set! %save-rate-limit-reset-time reset)
- (set! %general-rate-limit-reset-time reset)))
- (_
- #f))))
-
--(define* (call url decode #:optional (method http-get*)
-+(define* (call url decode #:optional (method http-get)
- #:key (false-if-404? #t))
- "Invoke the endpoint at URL using METHOD. Decode the resulting JSON body
- using DECODE, a one-argument procedure that takes an input port. When
- FALSE-IF-404? is true, return #f upon 404 responses."
- (and ((%allow-request?) url method)
- (let*-values (((response port)
-- (method url #:streaming? #t
-- #:verify-certificate?
-- (%verify-swh-certificate?))))
-+ (method url #:streaming? #t)))
- ;; See <https://archive.softwareheritage.org/api/#rate-limiting>.
- (match (assq-ref (response-headers response) 'x-ratelimit-remaining)
- (#f #t)
-@@ -480,7 +466,7 @@ directory entries; if it has type 'file, return its <content> object."
- (define* (save-origin url #:optional (type "git"))
- "Request URL to be saved."
- (call (swh-url "/api/1/origin/save" type "url" url) json->save-reply
-- http-post*))
-+ http-post))
-
- (define-query (save-origin-status url type)
- "Return the status of a /save request for URL and TYPE (e.g., \"git\")."
-@@ -502,7 +488,7 @@ directory entries; if it has type 'file, return its <content> object."
- to the vault. Return a <vault-reply>."
- (call (swh-url "/api/1/vault" (symbol->string kind) id)
- json->vault-reply
-- http-post*))
-+ http-post))
-
- (define* (vault-fetch id kind
- #:key (log-port (current-error-port)))
-@@ -521,10 +507,8 @@ revision, it is a gzip-compressed stream for 'git fast-import'."
- ('done
- ;; Fetch the bundle.
- (let-values (((response port)
-- (http-get* (swh-url (vault-reply-fetch-url reply))
-- #:streaming? #t
-- #:verify-certificate?
-- (%verify-swh-certificate?))))
-+ (http-get (swh-url (vault-reply-fetch-url reply))
-+ #:streaming? #t)))
- (if (= (response-code response) 200)
- port
- (begin ;shouldn't happen
---
-2.29.2
-
diff --git a/guix/guix-1.3.0-revert-display-download-progress-tty.patch b/guix/guix-1.3.0-revert-display-download-progress-tty.patch
new file mode 100644
index 0000000..29aeb07
--- /dev/null
+++ b/guix/guix-1.3.0-revert-display-download-progress-tty.patch
@@ -0,0 +1,125 @@
+From 994bf9e014e33de7dcd31bd76bbae102e9b8189e Mon Sep 17 00:00:00 2001
+From: Ting-Wei Lan <lantw44@gmail.com>
+Date: Mon, 14 Jun 2021 01:55:47 +0800
+Subject: [PATCH] Revert "status: Do not emit ANSI escapes when stderr is not a
+ tty."
+
+This reverts commit d613c1771a1986d3c0f1e034155fde41f32f9b8e.
+---
+ guix/progress.scm | 68 ++++++++++++++++++++---------------------------
+ guix/status.scm | 4 ---
+ 2 files changed, 29 insertions(+), 43 deletions(-)
+
+diff --git a/guix/progress.scm b/guix/progress.scm
+index 334bd40547..cd80ae620a 100644
+--- a/guix/progress.scm
++++ b/guix/progress.scm
+@@ -184,54 +184,44 @@ move the cursor to the beginning of the line."
+
+ (define* (display-download-progress file size
+ #:key
+- (tty? #t)
+ start-time (transferred 0)
+ (log-port (current-error-port)))
+ "Write the progress report to LOG-PORT. Use START-TIME (a SRFI-19 time
+ object) and TRANSFERRED (a total number of bytes) to determine the
+-throughput. When TTY? is false, assume LOG-PORT is not a tty and do not emit
+-ANSI escape codes."
++throughput."
+ (define elapsed
+ (duration->seconds
+ (time-difference (current-time (time-type start-time))
+ start-time)))
+
+- (cond ((and (not tty?)
+- size (not (zero? size))
+- transferred)
+- ;; Display a dot for at most every 10%.
+- (when (zero? (modulo (round (* 100. (/ transferred size))) 10))
+- (display "." log-port)
+- (force-output log-port)))
+- ((and (number? size) (not (zero? size)))
+- (let* ((% (* 100.0 (/ transferred size)))
+- (throughput (/ transferred elapsed))
+- (left (format #f " ~a ~a" file
+- (byte-count->string size)))
+- (right (format #f "~a/s ~a ~a~6,1f%"
+- (byte-count->string throughput)
+- (seconds->string elapsed)
+- (progress-bar %) %)))
+- (erase-current-line log-port)
+- (display (string-pad-middle left right
+- (current-terminal-columns))
+- log-port)
+- (force-output log-port)))
+- (else
+- ;; If we don't know the total size, the last transfer will have a 0B
+- ;; size. Don't display it.
+- (unless (zero? transferred)
+- (let* ((throughput (/ transferred elapsed))
+- (left (format #f " ~a" file))
+- (right (format #f "~a/s ~a | ~a transferred"
+- (byte-count->string throughput)
+- (seconds->string elapsed)
+- (byte-count->string transferred))))
+- (erase-current-line log-port)
+- (display (string-pad-middle left right
+- (current-terminal-columns))
+- log-port)
+- (force-output log-port))))))
++ (if (and (number? size) (not (zero? size)))
++ (let* ((% (* 100.0 (/ transferred size)))
++ (throughput (/ transferred elapsed))
++ (left (format #f " ~a ~a" file
++ (byte-count->string size)))
++ (right (format #f "~a/s ~a ~a~6,1f%"
++ (byte-count->string throughput)
++ (seconds->string elapsed)
++ (progress-bar %) %)))
++ (erase-current-line log-port)
++ (display (string-pad-middle left right
++ (current-terminal-columns))
++ log-port)
++ (force-output log-port))
++ ;; If we don't know the total size, the last transfer will have a 0B
++ ;; size. Don't display it.
++ (unless (zero? transferred)
++ (let* ((throughput (/ transferred elapsed))
++ (left (format #f " ~a" file))
++ (right (format #f "~a/s ~a | ~a transferred"
++ (byte-count->string throughput)
++ (seconds->string elapsed)
++ (byte-count->string transferred))))
++ (erase-current-line log-port)
++ (display (string-pad-middle left right
++ (current-terminal-columns))
++ log-port)
++ (force-output log-port)))))
+
+ (define %progress-interval
+ ;; Default interval between subsequent outputs for rate-limited displays.
+diff --git a/guix/status.scm b/guix/status.scm
+index 362ae2882c..d6f4387adf 100644
+--- a/guix/status.scm
++++ b/guix/status.scm
+@@ -424,9 +424,6 @@ substitutes being downloaded."
+ (cute colorize-string <> (color RED BOLD))
+ identity))
+
+- (define tty?
+- (isatty?* port))
+-
+ (define (report-build-progress phase %)
+ (let ((% (min (max % 0) 100))) ;sanitize
+ (erase-current-line port)
+@@ -547,7 +544,6 @@ substitutes being downloaded."
+ (nar-uri-abbreviation uri)
+ (basename uri))))
+ (display-download-progress uri size
+- #:tty? tty?
+ #:start-time
+ (download-start download)
+ #:transferred transferred))))))
+--
+2.31.1
+