summaryrefslogtreecommitdiff
path: root/guix/scripts/lint.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2017-07-06 09:13:31 +0300
committerEfraim Flashner <efraim@flashner.co.il>2017-10-09 14:05:17 +0300
commitadf0c531a845fb03c92e1f28e26e5c31adb95e4a (patch)
tree19680b6229566f55399888cf479ee6235ee3ba45 /guix/scripts/lint.scm
parentc723271f30ac500472d8068b090bc8e6df78fce0 (diff)
guix: lint: Add checker for new upstream versions.
* guix/scripts/lint.scm (check-for-updates): New procedure. (%checkers): Add it. * guix/scripts/refresh.scm (importer-modules, %updaters): Move from here ... * guix/upstream.scm: ... to here.
Diffstat (limited to 'guix/scripts/lint.scm')
-rw-r--r--guix/scripts/lint.scm17
1 files changed, 17 insertions, 0 deletions
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 57bbeec465..cd90257de3 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -33,6 +33,7 @@
#:use-module (guix licenses)
#:use-module (guix records)
#:use-module (guix ui)
+ #:use-module (guix upstream)
#:use-module (guix utils)
#:use-module (guix memoization)
#:use-module (guix scripts)
@@ -73,6 +74,7 @@
check-mirror-url
check-license
check-vulnerabilities
+ check-for-updates
check-formatting
run-checkers
@@ -826,6 +828,17 @@ from ~s: ~a (~s)~%")
(string-join (map vulnerability-id unpatched)
", ")))))))))
+(define (check-for-updates package)
+ "Check if there is an update available for PACKAGE."
+ (match (package-latest-release* package (force %updaters))
+ ((? upstream-source? source)
+ (when (version>? (upstream-source-version source)
+ (package-version package))
+ (emit-warning package
+ (format #f (G_ "can be upgraded to ~a~%")
+ (upstream-source-version source)))))
+ (#f #f))) ; cannot find newer upstream release
+
;;;
;;; Source code formatting.
@@ -992,6 +1005,10 @@ or a list thereof")
(CVE) database")
(check check-vulnerabilities))
(lint-checker
+ (name 'refresh)
+ (description "Check the package for new upstream releases")
+ (check check-for-updates))
+ (lint-checker
(name 'formatting)
(description "Look for formatting issues in the source")
(check check-formatting))))