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.
This commit is contained in:
Ludovic Courtès 2023-04-07 18:11:21 +02:00
parent b08cdfc6d3
commit adf95a810d
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
6 changed files with 10 additions and 6 deletions

View file

@ -28,6 +28,7 @@ (define-module (guix import cpan)
#: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 @@ (define cpan-package?
(define* (latest-release package #:key (version #f))
"Return an <upstream-source> 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")))

View file

@ -34,6 +34,7 @@ (define-module (guix import elpa)
#: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 @@ (define name (guix-package->elpa-name package))
(define repo (elpa-repository package))
(when version
(error
(raise
(formatted-message
(G_ "~a updater doesn't support updating to a specific version, sorry.")
"elpa")))

View file

@ -356,7 +356,7 @@ (define hackage-package?
(define* (latest-release package #:key (version #f))
"Return an <upstream-source> 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")))

View file

@ -22,6 +22,7 @@ (define-module (guix import minetest)
#: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 @@ (define release (latest-release author/name))
(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")))

View file

@ -29,6 +29,7 @@ (define-module (guix import opam)
#: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 @@ (define (opam-package? package)
(define* (latest-release package #:key (version #f))
"Return an <upstream-source> 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")))

View file

@ -145,7 +145,7 @@ (define latest-lts-release
"Return an <upstream-source> 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")))