summaryrefslogtreecommitdiff
path: root/guix/import/cpan.scm
diff options
context:
space:
mode:
authorHartmut Goebel <h.goebel@crazy-compilers.com>2022-06-24 22:01:35 +0200
committerHartmut Goebel <h.goebel@crazy-compilers.com>2022-12-26 17:15:07 +0100
commit21703b5120a1e1c141bcf6114de21944edd944db (patch)
treee867dca69ecd0b690e73b0fcfa103031641b1d41 /guix/import/cpan.scm
parent9500c11c8bf4e75894bfe67f839ffdbbf219ae2b (diff)
import: Issue error-message if version is given.
These importer don't support importing a specific version, thus the updater does neither. Issue an error message in case version is given. * guix/import/cpan.scm (latest-release), guix/import/elpa.scm (latest-release), guix/import/hackage.scm (latest-release), guix/import/minetest.scm (latest-minetest-release), guix/import/opam.scm (latest-release): Add #:version argument, issue error if version is given. * guix/import/cran.scm (latest-cran-release): Same. (latest-bioconductor-release) Same. <version>: rename to <latest-version>. * guix/import/stackage.scm (latest-lts-release): For each generated updater, add #:version argument and issue error if version is given.
Diffstat (limited to 'guix/import/cpan.scm')
-rw-r--r--guix/import/cpan.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
index a929dc62e3..8972b87080 100644
--- a/guix/import/cpan.scm
+++ b/guix/import/cpan.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2016 Alex Sassmannshausen <alex@pompo.co>
;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020, 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -29,6 +30,7 @@
#:use-module (srfi srfi-26)
#:use-module (json)
#:use-module (gcrypt hash)
+ #:use-module (guix diagnostics)
#:use-module (guix store)
#:use-module (guix utils)
#:use-module (guix base32)
@@ -305,8 +307,13 @@ in RELEASE, a <cpan-release> record."
")"))))
(url-predicate (cut regexp-exec cpan-rx <>))))
-(define (latest-release package)
+(define* (latest-release package #:key (version #f))
"Return an <upstream-source> for the latest release of PACKAGE."
+ (when version
+ (error
+ (formatted-message
+ (G_ "~a updater doesn't support updating to a specific version, sorry.")
+ "cpan")))
(match (cpan-fetch (package->upstream-name package))
(#f #f)
(release