unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 47597@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#47597] [PATCH 3/3] lint: refresh: Warn about missing or dysfunctional updaters.
Date: Sun,  4 Apr 2021 23:03:16 +0200	[thread overview]
Message-ID: <20210404210316.31198-3-ludo@gnu.org> (raw)
In-Reply-To: <20210404210316.31198-1-ludo@gnu.org>

This feedback should help us improve updaters.

* guix/lint.scm (check-for-updates): Return a warning when PACKAGE lacks
an updater or when the updater returns #f.
---
 guix/lint.scm | 41 ++++++++++++++++++++++++++---------------
 1 file changed, 26 insertions(+), 15 deletions(-)

diff --git a/guix/lint.scm b/guix/lint.scm
index cdd9dd14d7..a7d6bbba4f 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -1191,21 +1191,32 @@ vulnerability records for PACKAGE by calling PACKAGE-VULNERABILITIES."
 
 (define (check-for-updates package)
   "Check if there is an update available for PACKAGE."
-  (match (with-networking-fail-safe
-          (format #f (G_ "while retrieving upstream info for '~a'")
-                  (package-name package))
-          #f
-          (package-latest-release* package))
-    ((? upstream-source? source)
-     (if (version>? (upstream-source-version source)
-                    (package-version package))
-         (list
-          (make-warning package
-                        (G_ "can be upgraded to ~a")
-                        (list (upstream-source-version source))
-                        #:field 'version))
-         '()))
-    (#f '()))) ; cannot find newer upstream release
+  (match (lookup-updater package)
+    (#f
+     (list (make-warning package (G_ "no updater for ~a")
+                         (list (package-name package))
+                         #:field 'source)))
+    ((? upstream-updater? updater)
+     (match (with-networking-fail-safe
+             (format #f (G_ "while retrieving upstream info for '~a'")
+                     (package-name package))
+             #f
+             (package-latest-release package))
+       ((? upstream-source? source)
+        (if (version>? (upstream-source-version source)
+                       (package-version package))
+            (list
+             (make-warning package
+                           (G_ "can be upgraded to ~a")
+                           (list (upstream-source-version source))
+                           #:field 'version))
+            '()))
+       (#f                                       ;cannot find upstream release
+        (list (make-warning package
+                            (G_ "updater '~a' failed to find \
+upstream releases")
+                            (list (upstream-updater-name updater))
+                            #:field 'source)))))))
 
 
 (define (check-archival package)
-- 
2.31.1





  parent reply	other threads:[~2021-04-04 21:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-04 20:58 [bug#47597] [PATCH 0/3] Add SourceForge updater and lint warnings Ludovic Courtès
2021-04-04 21:03 ` [bug#47597] [PATCH 1/3] gnu-maintenance: Add 'sourceforge' updater Ludovic Courtès
2021-04-04 21:03   ` [bug#47597] [PATCH 2/3] upstream: 'package-latest-release' tries all the matching updaters Ludovic Courtès
2021-04-04 21:03   ` Ludovic Courtès [this message]
2021-04-05 15:38   ` [bug#47597] [PATCH 0/3] Add SourceForge updater and lint warnings Mathieu Othacehe
2021-04-05 16:03     ` Ludovic Courtès
2021-04-06 22:01     ` bug#47597: " Ludovic Courtès
2021-04-05 15:46 ` [bug#47597] " Léo Le Bouter via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210404210316.31198-3-ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=47597@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).