me
/
guix
Archived
1
0
Fork 0

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.
master
Hartmut Goebel 2022-11-01 11:37:28 +01:00
parent af44a8550c
commit 1e39f475a2
No known key found for this signature in database
GPG Key ID: 634A8DFFD3F631DF
1 changed files with 4 additions and 3 deletions

View File

@ -6,6 +6,7 @@
;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net> ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev> ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2022 Taiju HIGASHI <higashi@taiju.info> ;;; Copyright © 2022 Taiju HIGASHI <higashi@taiju.info>
;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -173,11 +174,11 @@ package on RubyGems."
(define gem-package? (define gem-package?
(url-prefix-predicate "https://rubygems.org/downloads/")) (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." "Return an <upstream-source> for the latest release of PACKAGE."
(let* ((gem-name (guix-package->gem-name package)) (let* ((gem-name (guix-package->gem-name package))
(gem (rubygems-fetch gem-name)) (gem (rubygems-fetch gem-name))
(version (gem-version gem)) (version (or version (gem-version gem)))
(url (rubygems-uri gem-name version))) (url (rubygems-uri gem-name version)))
(upstream-source (upstream-source
(package (package-name package)) (package (package-name package))
@ -189,7 +190,7 @@ package on RubyGems."
(name 'gem) (name 'gem)
(description "Updater for RubyGem packages") (description "Updater for RubyGem packages")
(pred gem-package?) (pred gem-package?)
(import latest-release))) (import import-release)))
(define* (gem-recursive-import package-name #:optional version) (define* (gem-recursive-import package-name #:optional version)
(recursive-import package-name (recursive-import package-name