aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-01-06 18:37:52 +0100
committerLudovic Courtès <ludo@gnu.org>2021-01-07 12:08:41 +0100
commit069bb95ab23345ff51ba96b207a262fb553e6126 (patch)
tree4d5ab7845866e598a800e9538b2453d28b733965
parentb793718cb482a2d2c9fb3de1c90baaf388a0eef5 (diff)
downloadguix-069bb95ab23345ff51ba96b207a262fb553e6126.tar
guix-069bb95ab23345ff51ba96b207a262fb553e6126.tar.gz
upstream: Make the 'updaters' parameter optional.
* guix/upstream.scm (lookup-updater, package-latest-release) (package-latest-release*, package-update): Make 'updaters' an optional parameter. * guix/lint.scm (check-for-updates): Remove second argument to 'package-latest-release*'.
-rw-r--r--guix/lint.scm4
-rw-r--r--guix/upstream.scm16
2 files changed, 13 insertions, 7 deletions
diff --git a/guix/lint.scm b/guix/lint.scm
index be6bb4eb01..311bc94cc3 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 Cyril Roelandt <tipecaml@gmail.com>
;;; Copyright © 2014, 2015 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
@@ -1183,7 +1183,7 @@ vulnerability records for PACKAGE by calling PACKAGE-VULNERABILITIES."
(format #f (G_ "while retrieving upstream info for '~a'")
(package-name package))
#f
- (package-latest-release* package (force %updaters)))
+ (package-latest-release* package))
((? upstream-source? source)
(if (version>? (upstream-source-version source)
(package-version package))
diff --git a/guix/upstream.scm b/guix/upstream.scm
index 6584d5e4c4..a8ed1d81cd 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 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
;;;
@@ -248,7 +248,8 @@ correspond to the same version."
'()
(importer-modules))))
-(define (lookup-updater package updaters)
+(define* (lookup-updater package
+ #:optional (updaters (force %updaters)))
"Return an updater among UPDATERS that matches PACKAGE, or #f if none of
them matches."
(find (match-lambda
@@ -256,7 +257,9 @@ them matches."
(pred package)))
updaters))
-(define (package-latest-release package updaters)
+(define* (package-latest-release package
+ #: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."
@@ -265,7 +268,9 @@ that the returned source is newer than the current one."
((upstream-updater-latest updater) package))
(_ #f)))
-(define (package-latest-release* package updaters)
+(define* (package-latest-release* package
+ #:optional
+ (updaters (force %updaters)))
"Like 'package-latest-release', but ensure that the return source is newer
than that of PACKAGE."
(match (package-latest-release package updaters)
@@ -402,7 +407,8 @@ SOURCE, an <upstream-source>."
;; Mapping of origin methods to source update procedures.
`((,url-fetch . ,package-update/url-fetch)))
-(define* (package-update store package updaters
+(define* (package-update store package
+ #: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.