summaryrefslogtreecommitdiff
path: root/guix/import/gem.scm
diff options
context:
space:
mode:
authorHartmut Goebel <h.goebel@crazy-compilers.com>2022-11-01 11:37:28 +0100
committerHartmut Goebel <h.goebel@crazy-compilers.com>2022-12-26 17:38:03 +0100
commit1e39f475a2695490bb9a229981e91fc23a899e6d (patch)
tree9d4994d77caa903f28b7e55880e84e152fc23205 /guix/import/gem.scm
parentaf44a8550c1cc2624cf956839c35280b1e152ac5 (diff)
import: gem: Allow updating to a specific version.
* guix/import/gem.scm (latest-release): Rename to 'import-release', add #:version argument. If version is given, return an upstream-source for this version.
Diffstat (limited to 'guix/import/gem.scm')
-rw-r--r--guix/import/gem.scm7
1 files changed, 4 insertions, 3 deletions
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index 1c6c55baa6..8ad0662628 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -6,6 +6,7 @@
;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2022 Taiju HIGASHI <higashi@taiju.info>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -173,11 +174,11 @@ package on RubyGems."
(define gem-package?
(url-prefix-predicate "https://rubygems.org/downloads/"))
-(define (latest-release package)
+(define* (import-release package #:key (version #f))
"Return an <upstream-source> for the latest release of PACKAGE."
(let* ((gem-name (guix-package->gem-name package))
(gem (rubygems-fetch gem-name))
- (version (gem-version gem))
+ (version (or version (gem-version gem)))
(url (rubygems-uri gem-name version)))
(upstream-source
(package (package-name package))
@@ -189,7 +190,7 @@ package on RubyGems."
(name 'gem)
(description "Updater for RubyGem packages")
(pred gem-package?)
- (import latest-release)))
+ (import import-release)))
(define* (gem-recursive-import package-name #:optional version)
(recursive-import package-name