[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#57460] [PATCH v3 06/18] import: crate: Allow updating to a specific
From: |
Hartmut Goebel |
Subject: |
[bug#57460] [PATCH v3 06/18] import: crate: Allow updating to a specific version. |
Date: |
Tue, 20 Dec 2022 10:34:11 +0100 |
* guix/import/crate.scm (latest-release): Rename to 'import-release',
add #:version argument.
If version is given, return an upstream-source for this version.
---
guix/import/crate.scm | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 51bfcd7bed..339dbcd74c 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2019, 2020 Martin Becze <mjbecze@riseup.net>
;;; Copyright © 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -354,11 +355,12 @@ look up the development dependencs for the given crate."
(define crate-package?
(url-predicate crate-url?))
-(define (latest-release package)
- "Return an <upstream-source> for the latest release of PACKAGE."
+(define* (import-release package #:key (version #f))
+ "Return an <upstream-source> for the latest release of PACKAGE. Optionally
+include a VERSION string to fetch a specific version."
(let* ((crate-name (guix-package->crate-name package))
(crate (lookup-crate crate-name))
- (version (crate-latest-version crate))
+ (version (or version (crate-latest-version crate)))
(url (crate-uri crate-name version)))
(upstream-source
(package (package-name package))
@@ -370,5 +372,5 @@ look up the development dependencs for the given crate."
(name 'crate)
(description "Updater for crates.io packages")
(pred crate-package?)
- (import latest-release)))
+ (import import-release)))
--
2.30.6
- [bug#57460] [PATCH v3 00/18] Refresh to specific version, Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 01/18] upstream-updater: Rename record field., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 07/18] import: egg: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 06/18] import: crate: Allow updating to a specific version.,
Hartmut Goebel <=
- [bug#57460] [PATCH v3 02/18] import: cpan: Remove unused exports., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 11/18] import: gnome: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 08/18] import: gem: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 05/18] gnu-maintenance: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 13/18] import: kde: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 17/18] upstream: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 18/18] doc: Describe how to update to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 03/18] import: Issue error-message if version is given., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 10/18] import: github: Allow updating to a specific version., Hartmut Goebel, 2022/12/20