summary refs log tree commit diff
diff options
context:
space:
mode:
authorHartmut Goebel <h.goebel@crazy-compilers.com>2022-06-28 21:07:05 +0200
committerHartmut Goebel <h.goebel@crazy-compilers.com>2022-12-26 17:38:03 +0100
commitaf44a8550c1cc2624cf956839c35280b1e152ac5 (patch)
tree381077b46aa98d1c5508c1375e336c8a01a2736d
parent7c4aab1f7ddfff5959d45e9b6d45abb6d5013e0e (diff)
downloadguix-af44a8550c1cc2624cf956839c35280b1e152ac5.tar.gz
import: egg: Allow updating to a specific version.
* guix/import/egg.scm (latest-release): Rename to 'import-release',
  add #:version argument.
  If version is given, return an upstream-source for this version.
-rw-r--r--guix/import/egg.scm10
1 files changed, 6 insertions, 4 deletions
diff --git a/guix/import/egg.scm b/guix/import/egg.scm
index 2ad48c3399..10a40fe4f8 100644
--- a/guix/import/egg.scm
+++ b/guix/import/egg.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
 ;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -333,10 +334,11 @@ not work."
 ;;; Updater.
 ;;;
 
-(define (latest-release package)
-  "Return an @code{<upstream-source>} for the latest release of PACKAGE."
+(define* (import-release package #:key (version #f))
+  "Return an @code{<upstream-source>} for the latest release of PACKAGE.
+Optionally include a VERSION string to fetch a specific version."
   (let* ((egg-name (guix-package->egg-name package))
-         (version (find-latest-version egg-name))
+         (version (or version (find-latest-version egg-name)))
          (source-url (egg-uri egg-name version)))
     (upstream-source
      (package (package-name package))
@@ -348,6 +350,6 @@ not work."
    (name 'egg)
    (description "Updater for CHICKEN egg packages")
    (pred egg-package?)
-   (import latest-release)))
+   (import import-release)))
 
 ;;; egg.scm ends here