refresh: Gracefully handle failure to download a tarball.
* guix/scripts/refresh.scm (guix-refresh): When updating a source file, gracefully handle the case where TARBALL is #f. Reported by Nikita Karetnikov <nikita@karetnikov.org>.
This commit is contained in:
parent
e31ff8b8d0
commit
fe3e603d14
|
@ -160,13 +160,21 @@ update would trigger a complete rebuild."
|
||||||
'version)
|
'version)
|
||||||
(package-location package))))
|
(package-location package))))
|
||||||
(when version
|
(when version
|
||||||
(format (current-error-port)
|
(if (and=> tarball file-exists?)
|
||||||
(_ "~a: ~a: updating from version ~a to version ~a...~%")
|
(begin
|
||||||
(location->string loc) (package-name package)
|
(format (current-error-port)
|
||||||
(package-version package) version)
|
(_ "~a: ~a: updating from version ~a to version ~a...~%")
|
||||||
(let ((hash (call-with-input-file tarball
|
(location->string loc)
|
||||||
(compose sha256 get-bytevector-all))))
|
(package-name package)
|
||||||
(update-package-source package version hash)))))
|
(package-version package) version)
|
||||||
|
(let ((hash (call-with-input-file tarball
|
||||||
|
(compose sha256
|
||||||
|
get-bytevector-all))))
|
||||||
|
(update-package-source package version
|
||||||
|
hash)))
|
||||||
|
(warning (_ "~a: version ~a could not be \
|
||||||
|
downloaded and authenticated; not updating")
|
||||||
|
(package-name package) version)))))
|
||||||
packages))
|
packages))
|
||||||
(for-each (lambda (package)
|
(for-each (lambda (package)
|
||||||
(match (false-if-exception (package-update-path package))
|
(match (false-if-exception (package-update-path package))
|
||||||
|
|
Loading…
Reference in New Issue