diff options
author | Ludovic Courtès <ludo@gnu.org> | 2022-06-22 18:48:00 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2022-06-22 18:48:00 +0200 |
commit | 8655a714457dbf1cde45979507012d9515614028 (patch) | |
tree | 7712625328f45794ccda9baa730a4825bb2efb47 /guix/upstream.scm | |
parent | a589049e141588ebcf4079116e378d60b779f6b4 (diff) | |
parent | 2af3f5eef045f7d177cc394c89be069bac895688 (diff) |
Merge branch master into core-updates
Diffstat (limited to 'guix/upstream.scm')
-rw-r--r-- | guix/upstream.scm | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/guix/upstream.scm b/guix/upstream.scm index 6666803a92..dac8153905 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -1,5 +1,5 @@ ;;; 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 © 2019, 2022 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev> @@ -464,6 +464,7 @@ SOURCE, an <upstream-source>." #:key-download key-download))) (values version tarball source)))))) + (define* (package-update/git-fetch store package source #:key key-download) "Return the version, checkout, and SOURCE, to update PACKAGE to SOURCE, an <upstream-source>." @@ -487,30 +488,36 @@ SOURCE, an <upstream-source>." #:optional (updaters (force %updaters)) #:key (key-download 'interactive)) "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 values: 'always', 'never', and 'interactive' (default)." - (match (package-latest-release* package updaters) + (match (package-latest-release package updaters) ((? upstream-source? source) - (let ((method (match (package-source package) - ((? origin? origin) - (origin-method origin)) - (_ - #f)))) - (match (assq method %method-updates) - (#f - (raise (make-compound-condition - (formatted-message (G_ "cannot download for \ + (if (version>? (upstream-source-version source) + (package-version package)) + (let ((method (match (package-source package) + ((? origin? origin) + (origin-method origin)) + (_ + #f)))) + (match (assq method %method-updates) + (#f + (raise (make-compound-condition + (formatted-message (G_ "cannot download for \ this method: ~s") - method) - (condition - (&error-location - (location (package-location package))))))) - ((_ . update) - (update store package source - #:key-download key-download))))) + method) + (condition + (&error-location + (location (package-location package))))))) + ((_ . update) + (update store package source + #:key-download key-download)))) + (values #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) "Modify the source file that defines PACKAGE to refer to SOURCE, an |