[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
23/23: upstream.scm
From: |
guix-commits |
Subject: |
23/23: upstream.scm |
Date: |
Mon, 4 Jul 2022 09:49:28 -0400 (EDT) |
htgoebel pushed a commit to branch wip-import-version
in repository guix.
commit 926f9b080911966066800e0342e0462820172b77
Author: Hartmut Goebel <h.goebel@crazy-compilers.com>
AuthorDate: Fri Jun 24 22:36:38 2022 +0200
upstream.scm
* guix/upstream.scm(package-latest-release) add kwarg version, pass it on to
the updater's 'latest' function.
(package-update): add kwarg version and pass it on to
package-latest-release.
---
guix/upstream.scm | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/guix/upstream.scm b/guix/upstream.scm
index fcacd4983a..0cb7f93aee 100644
--- a/guix/upstream.scm
+++ b/guix/upstream.scm
@@ -274,7 +274,8 @@ them matches."
(define* (package-latest-release package
#:optional
- (updaters (force %updaters)))
+ (updaters (force %updaters))
+ #:key (version #f))
"Return an upstream source to update PACKAGE, a <package> object, or #f if
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
@@ -283,7 +284,7 @@ one."
(any (match-lambda
(($ <upstream-updater> name description pred latest)
(and (pred package)
- (latest package))))
+ (latest package #:version version))))
updaters))
(define* (package-latest-release* package
@@ -487,13 +488,13 @@ SOURCE, an <upstream-source>."
(define* (package-update store package
#:optional (updaters (force %updaters))
- #:key (key-download 'interactive))
+ #:key (key-download 'interactive) (version #f))
"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;
raise an error when the updater could not determine available releases.
KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed
values: 'always', 'never', and 'interactive' (default)."
- (match (package-latest-release package updaters)
+ (match (package-latest-release package updaters #:version version)
((? upstream-source? source)
(if (version>? (upstream-source-version source)
(package-version package))
@@ -516,9 +517,13 @@ this method: ~s")
#:key-download key-download))))
(values #f #f #f)))
(#f
- (raise (formatted-message
- (G_ "updater failed to determine available releases for ~a~%")
- (package-name package))))))
+ (if version
+ (raise (formatted-message
+ (G_ "updater failed to find release ~a@~a~%")
+ (package-name package) version))
+ (raise (formatted-message
+ (G_ "updater failed to determine available releases for ~a~%")
+ (package-name package)))))))
(define* (update-package-source package source hash)
"Modify the source file that defines PACKAGE to refer to SOURCE, an
- 09/23: updaters: issue error-message if version is given:, (continued)
- 09/23: updaters: issue error-message if version is given:, guix-commits, 2022/07/04
- 11/23: sourceforge: not supported, too complicate to implement., guix-commits, 2022/07/04
- 10/23: cran/bioconductor, guix-commits, 2022/07/04
- 12/23: gnu-maintenance (kernel.org, ftp, html, savannah, xorg, gnu), guix-commits, 2022/07/04
- 13/23: pypi:, guix-commits, 2022/07/04
- 15/23: egg, guix-commits, 2022/07/04
- 16/23: hexpm, guix-commits, 2022/07/04
- 14/23: crate, guix-commits, 2022/07/04
- 19/23: kde:, guix-commits, 2022/07/04
- 21/23: generic-git, guix-commits, 2022/07/04
- 23/23: upstream.scm,
guix-commits <=
- 17/23: launchpad, guix-commits, 2022/07/04
- 18/23: gnome:, guix-commits, 2022/07/04
- 20/23: github REWORD, guix-commits, 2022/07/04
- 22/23: refresh, guix-commits, 2022/07/04