mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
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
1 changed files with 15 additions and 7 deletions
|
@ -160,13 +160,21 @@ (define core-package?
|
|||
'version)
|
||||
(package-location package))))
|
||||
(when version
|
||||
(format (current-error-port)
|
||||
(_ "~a: ~a: updating from version ~a to version ~a...~%")
|
||||
(location->string loc) (package-name package)
|
||||
(package-version package) version)
|
||||
(let ((hash (call-with-input-file tarball
|
||||
(compose sha256 get-bytevector-all))))
|
||||
(update-package-source package version hash)))))
|
||||
(if (and=> tarball file-exists?)
|
||||
(begin
|
||||
(format (current-error-port)
|
||||
(_ "~a: ~a: updating from version ~a to version ~a...~%")
|
||||
(location->string loc)
|
||||
(package-name package)
|
||||
(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))
|
||||
(for-each (lambda (package)
|
||||
(match (false-if-exception (package-update-path package))
|
||||
|
|
Loading…
Reference in a new issue