diff mbox series

[bug#57460,07/20] refresh: Allow updating to a specific version (egg)

Message ID f3e36ab9541043e5228a2f1d3f24cde9f131e598.1661691694.git.h.goebel@crazy-compilers.com
State New
Headers show
Series Refresh to specific version | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Hartmut Goebel Aug. 28, 2022, 1:18 p.m. UTC
* guix/import/egg.scm(latest-release): Rename to (import-release),
  add keyword-argument 'version'.
  If version is given, return an upstream-source for this version.
---
 guix/import/egg.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/guix/import/egg.scm b/guix/import/egg.scm
index aa689f8d84..3897de5acf 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,10 @@  not work."
 ;;; Updater.
 ;;;
 
-(define (latest-release package)
+(define* (import-release package #:key (version #f))
   "Return an @code{<upstream-source>} for the latest release of PACKAGE."
   (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 +349,6 @@  not work."
    (name 'egg)
    (description "Updater for CHICKEN egg packages")
    (pred egg-package?)
-   (import latest-release)))
+   (import import-release)))
 
 ;;; egg.scm ends here