upstream: 'package-latest-release' tries all the matching updaters.

* guix/upstream.scm (package-latest-release): Try UPDATERS until one of
them returns an upstream source.  This is useful for packages with
several matching updaters, such a zlib ('sourceforge' and
'generic-html').
This commit is contained in:
Ludovic Courtès 2021-04-04 22:44:41 +02:00
parent b92cfc322d
commit 35ca3cfbcf
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 9 additions and 6 deletions

View File

@ -264,12 +264,15 @@ them matches."
#:optional
(updaters (force %updaters)))
"Return an upstream source to update PACKAGE, a <package> object, or #f if
none of UPDATERS matches PACKAGE. It is the caller's responsibility to ensure
that the returned source is newer than the current one."
(match (lookup-updater package updaters)
((? upstream-updater? updater)
((upstream-updater-latest updater) package))
(_ #f)))
none of UPDATERS matches PACKAGE. When several updaters match PACKAGE, try
them until one of them returns an upstream source. It is the caller's
responsibility to ensure that the returned source is newer than the current
one."
(any (match-lambda
(($ <upstream-updater> name description pred latest)
(and (pred package)
(latest package))))
updaters))
(define* (package-latest-release* package
#:optional