[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/10: refresh: Distinguish between "no updater" and "failing updater".
From: |
guix-commits |
Subject: |
02/10: refresh: Distinguish between "no updater" and "failing updater". |
Date: |
Mon, 9 Sep 2019 18:35:04 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 7c101c4c175b7abcb43279d1c66b41a91b9c64bc
Author: Ludovic Courtès <address@hidden>
Date: Mon Sep 9 10:33:42 2019 +0200
refresh: Distinguish between "no updater" and "failing updater".
Previously, something like "guix refresh texmacs" would report "no
updater". Now, it reports that the 'gnu-ftp' updater failed to list
releases.
* guix/upstream.scm (lookup-updater): Use 'find' instead of 'any' to
return the <upstream-updater>.
(package-latest-release): Adjust accordingly.
* guix/scripts/refresh.scm (check-for-package-update): When
'package-latest-release' returns #f, distinguish between "no updater"
and "failing updater".
---
guix/scripts/refresh.scm | 12 ++++++++++--
guix/upstream.scm | 12 ++++++------
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index 4591d0f..daf6fcf 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -368,8 +368,16 @@ the latest known version of ~a (~a)~%")
(upstream-source-version source)))))))
(#f
(when warn?
- (warn-no-updater package)))))
-
+ ;; Distinguish between "no updater" and "failing updater."
+ (match (lookup-updater package updaters)
+ ((? upstream-updater? updater)
+ (warning (package-location package)
+ (G_ "'~a' updater failed to determine available \
+releases for ~a~%")
+ (upstream-updater-name updater)
+ (package-name package)))
+ (#f
+ (warn-no-updater package)))))))
;;;
diff --git a/guix/upstream.scm b/guix/upstream.scm
index d4f9c5b..aa47dab 100644
--- a/guix/upstream.scm
+++ b/guix/upstream.scm
@@ -245,18 +245,18 @@ correspond to the same version."
(define (lookup-updater package updaters)
"Return an updater among UPDATERS that matches PACKAGE, or #f if none of
them matches."
- (any (match-lambda
- (($ <upstream-updater> name description pred latest)
- (and (pred package) latest)))
- updaters))
+ (find (match-lambda
+ (($ <upstream-updater> name description pred latest)
+ (pred package)))
+ updaters))
(define (package-latest-release package 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)
- ((? procedure? latest-release)
- (latest-release package))
+ ((? upstream-updater? updater)
+ ((upstream-updater-latest updater) package))
(_ #f)))
(define (package-latest-release* package updaters)
- branch master updated (5fbba84 -> deb0836), guix-commits, 2019/09/09
- 02/10: refresh: Distinguish between "no updater" and "failing updater".,
guix-commits <=
- 01/10: packages: 'package-field-location' really catches 'system-error., guix-commits, 2019/09/09
- 06/10: gnu: orage: Fix build., guix-commits, 2019/09/09
- 03/10: import: crate: Allow imports of a specific version., guix-commits, 2019/09/09
- 08/10: gnu: monero: Fix detection of readline library., guix-commits, 2019/09/09
- 09/10: gnu: monero: Activate Trezor support., guix-commits, 2019/09/09
- 04/10: gnu: mousepad: Update to 0.4.2., guix-commits, 2019/09/09
- 05/10: gnu: ristretto: Update to 0.10.0., guix-commits, 2019/09/09
- 07/10: gnu: Add copyright header., guix-commits, 2019/09/09
- 10/10: gnu: monero-gui: Update to 0.14.1.2., guix-commits, 2019/09/09