Subject: [PATCH v3 08/18] import: gem: Allow updating to a specific version.

From: Hartmut Goebel <[email-masked]>
Date: Tue, 20 Dec 2022 10:34:13 +0100

* guix/import/gem.scm (latest-release): Rename to 'import-release',
  add #:version argument.
  If version is given, return an upstream-source for this version.
---
 guix/import/gem.scm | 7 ++++---
 1 file 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 <[email-masked]>
 ;;; Copyright © 2021 Sarah Morgensen <[email-masked]>
 ;;; Copyright © 2022 Taiju HIGASHI <[email-masked]>
+;;; Copyright © 2022 Hartmut Goebel <[email-masked]>
 ;;;
 ;;; 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
-- 
2.30.6