From ea4a66b2afa401cc92a87a8754c75022bdf0e5d5 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 7 Apr 2023 18:11:21 +0200 Subject: import: Properly report "no specific version" errors. * guix/import/cpan.scm (latest-release): Use 'raise' instead of 'error'. * guix/import/elpa.scm (latest-release): Likewise. * guix/import/hackage.scm (latest-release): Likewise. * guix/import/minetest.scm (latest-minetest-release): Likewise. * guix/import/opam.scm (latest-release): Likewise. * guix/import/stackage.scm (latest-lts-release): Likewise. --- guix/import/cpan.scm | 3 ++- guix/import/elpa.scm | 3 ++- guix/import/hackage.scm | 2 +- guix/import/minetest.scm | 3 ++- guix/import/opam.scm | 3 ++- guix/import/stackage.scm | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) (limited to 'guix') diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm index eeb142a9b8..da47018c35 100644 --- a/guix/import/cpan.scm +++ b/guix/import/cpan.scm @@ -28,6 +28,7 @@ #:use-module ((ice-9 rdelim) #:select (read-line)) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-34) #:use-module (json) #:use-module (gcrypt hash) #:use-module (guix diagnostics) @@ -310,7 +311,7 @@ in RELEASE, a record." (define* (latest-release package #:key (version #f)) "Return an for the latest release of PACKAGE." (when version - (error + (raise (formatted-message (G_ "~a updater doesn't support updating to a specific version, sorry.") "cpan"))) diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index f71e758db4..8ebebcafb3 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -34,6 +34,7 @@ #:use-module (srfi srfi-9 gnu) #:use-module (srfi srfi-11) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) #:use-module (guix i18n) #:use-module (guix diagnostics) @@ -405,7 +406,7 @@ type ''." (define repo (elpa-repository package)) (when version - (error + (raise (formatted-message (G_ "~a updater doesn't support updating to a specific version, sorry.") "elpa"))) diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm index 83ad85f3fe..56c8696ad7 100644 --- a/guix/import/hackage.scm +++ b/guix/import/hackage.scm @@ -356,7 +356,7 @@ respectively." (define* (latest-release package #:key (version #f)) "Return an for the latest release of PACKAGE." (when version - (error + (raise (formatted-message (G_ "~a updater doesn't support updating to a specific version, sorry.") "hackage"))) diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm index 7e7b6dd6ac..5ea6e023ce 100644 --- a/guix/import/minetest.scm +++ b/guix/import/minetest.scm @@ -22,6 +22,7 @@ #:use-module (ice-9 threads) #:use-module (ice-9 hash-table) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-34) #:use-module (guix diagnostics) #:use-module ((guix packages) #:prefix package:) #:use-module (guix upstream) @@ -492,7 +493,7 @@ or #false if the latest release couldn't be determined." (define source (package:package-source pkg)) (when version - (error + (raise (formatted-message (G_ "~a updater doesn't support updating to a specific version, sorry.") "minetest"))) diff --git a/guix/import/opam.scm b/guix/import/opam.scm index e336936306..eed68e7a93 100644 --- a/guix/import/opam.scm +++ b/guix/import/opam.scm @@ -29,6 +29,7 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-2) #:use-module ((srfi srfi-26) #:select (cut)) + #:use-module (srfi srfi-34) #:use-module ((web uri) #:select (string->uri uri->string)) #:use-module ((guix build utils) #:select (dump-port find-files mkdir-p)) #:use-module (guix build-system) @@ -417,7 +418,7 @@ package in OPAM." (define* (latest-release package #:key (version #f)) "Return an for the latest release of PACKAGE." (when version - (error + (raise (formatted-message (G_ "~a updater doesn't support updating to a specific version, sorry.") "opam"))) diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm index 735eeb75f7..f98b86c334 100644 --- a/guix/import/stackage.scm +++ b/guix/import/stackage.scm @@ -145,7 +145,7 @@ included in the Stackage LTS release." "Return an for the latest Stackage LTS release of PACKAGE or #f if the package is not included in the Stackage LTS release." (when version - (error + (raise (formatted-message (G_ "~a updater doesn't support updating to a specific version, sorry.") "stackage"))) -- cgit v1.2.3