me
/
guix
Archived
1
0
Fork 0

upstream: 'package-update' reports "unknown upstream releases" errors.

Fixes <https://issues.guix.gnu.org/55987>.
Reported by John Kehayias <john.kehayias@protonmail.com>.

* guix/upstream.scm (package-update): Instead of calling
'package-latest-release*', call 'package-latest-release' and distinguish
between "up-to-date" and "unknown upstream releases".  Raise an error in
the latter case.
Ludovic Courtès 2022-06-15 23:01:26 +02:00
parent 5c06eedf08
commit 53b9c27aa5
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 26 additions and 20 deletions

View File

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2010-2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015 Alex Kost <alezost@gmail.com> ;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
;;; Copyright © 2019, 2022 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2019, 2022 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev> ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
@ -488,30 +488,36 @@ SOURCE, an <upstream-source>."
#:optional (updaters (force %updaters)) #:optional (updaters (force %updaters))
#:key (key-download 'interactive)) #:key (key-download 'interactive))
"Return the new version, the file name of the new version tarball, and input "Return the new version, the file name of the new version tarball, and input
changes for PACKAGE; return #f (three values) when PACKAGE is up-to-date. changes for PACKAGE; return #f (three values) when PACKAGE is up-to-date;
raise an error when the updater could not determine available releases.
KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed
values: 'always', 'never', and 'interactive' (default)." values: 'always', 'never', and 'interactive' (default)."
(match (package-latest-release* package updaters) (match (package-latest-release package updaters)
((? upstream-source? source) ((? upstream-source? source)
(let ((method (match (package-source package) (if (version>? (upstream-source-version source)
((? origin? origin) (package-version package))
(origin-method origin)) (let ((method (match (package-source package)
(_ ((? origin? origin)
#f)))) (origin-method origin))
(match (assq method %method-updates) (_
(#f #f))))
(raise (make-compound-condition (match (assq method %method-updates)
(formatted-message (G_ "cannot download for \ (#f
(raise (make-compound-condition
(formatted-message (G_ "cannot download for \
this method: ~s") this method: ~s")
method) method)
(condition (condition
(&error-location (&error-location
(location (package-location package))))))) (location (package-location package)))))))
((_ . update) ((_ . update)
(update store package source (update store package source
#:key-download key-download))))) #:key-download key-download))))
(values #f #f #f)))
(#f (#f
(values #f #f #f)))) (raise (formatted-message
(G_ "updater failed to determine available releases for ~a~%")
(package-name package))))))
(define* (update-package-source package source hash) (define* (update-package-source package source hash)
"Modify the source file that defines PACKAGE to refer to SOURCE, an "Modify the source file that defines PACKAGE to refer to SOURCE, an