diff mbox series

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

Message ID 84d6e3731a5c8ac6a76c9810356f478c25b1d8d2.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/hexpm.scm(latest-release): Rename to (import-release),
  add keyword-argument 'version'.
  If version is given, return an upstream-source for this version.
---
 guix/import/hexpm.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/guix/import/hexpm.scm b/guix/import/hexpm.scm
index 3b63837393..652df5dd0e 100644
--- a/guix/import/hexpm.scm
+++ b/guix/import/hexpm.scm
@@ -328,11 +328,11 @@  latest version of PACKAGE-NAME."
 ;;; Updater
 ;;;
 
-(define (latest-release package)
+(define* (import-release package #:key (version #f))
   "Return an <upstream-source> for the latest release of PACKAGE."
   (let* ((hexpm-name (guix-package->hexpm-name package))
          (hexpm      (lookup-hexpm hexpm-name))
-         (version    (hexpm-latest-release hexpm))
+         (version    (or version (hexpm-latest-release hexpm)))
          (url        (hexpm-uri hexpm-name version)))
     (upstream-source
      (package (package-name package))
@@ -344,4 +344,4 @@  latest version of PACKAGE-NAME."
    (name 'hexpm)
    (description "Updater for hex.pm packages")
    (pred (url-prefix-predicate hexpm-package-url))
-   (import latest-release)))
+   (import import-release)))