From: Hartmut Goebel <h.goebel@crazy-compilers.com>
To: 57460@debbugs.gnu.org
Subject: [bug#57460] [PATCH 03/20] updaters: Issue error-message if version is given:
Date: Sun, 28 Aug 2022 15:18:29 +0200 [thread overview]
Message-ID: <41578ce3ed904afa3f6b6d1d6db159d70b26f605.1661691694.git.h.goebel@crazy-compilers.com> (raw)
In-Reply-To: <cover.1661691694.git.h.goebel@crazy-compilers.com>
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/gem.scm(latest-release),
guix/import/hackage.scm(latest-release),
guix/import/minetest.scm(latest-minetest-release),
guix/import/opam.scm(latest-release): Add keyword argument 'version',
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 keyword argument 'version' and issue error if version is given.
---
guix/import/cpan.scm | 9 ++++++++-
guix/import/cran.scm | 19 +++++++++++++++----
guix/import/elpa.scm | 9 ++++++++-
guix/import/gem.scm | 10 +++++++++-
guix/import/hackage.scm | 10 +++++++++-
guix/import/minetest.scm | 10 +++++++++-
guix/import/opam.scm | 9 ++++++++-
guix/import/stackage.scm | 8 +++++++-
8 files changed, 73 insertions(+), 11 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
diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index 33305d68eb..eadced512f 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -640,8 +641,13 @@ s-expression corresponding to that package, or #f on failure."
(_ #f)))
(_ #f)))))
-(define (latest-cran-release pkg)
+(define* (latest-cran-release pkg #:key (version #f))
"Return an <upstream-source> for the latest release of the package PKG."
+ (when version
+ (error
+ (formatted-message
+ (G_ "~a provides only the latest version of each package, sorry.")
+ "CRAN")))
(define upstream-name
(package->upstream-name pkg))
@@ -660,20 +666,25 @@ s-expression corresponding to that package, or #f on failure."
(changed-inputs pkg
(description->package 'cran meta)))))))
-(define (latest-bioconductor-release pkg)
+(define* (latest-bioconductor-release pkg #:key (version #f))
"Return an <upstream-source> for the latest release of the package PKG."
+ (when version
+ (error
+ (formatted-message
+ (G_ "~a provides only the latest version of each package, sorry.")
+ "bioconductor.org")))
(define upstream-name
(package->upstream-name pkg))
- (define version
+ (define latest-version
(latest-bioconductor-package-version upstream-name))
(and version
;; Bioconductor does not provide signatures.
(upstream-source
(package (package-name pkg))
- (version version)
+ (version latest-version)
(urls (bioconductor-uri upstream-name version))
(input-changes
(changed-inputs
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 1dbdff9391..f9e9f2de53 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -7,6 +7,7 @@
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -35,6 +36,7 @@
#:use-module (srfi srfi-26)
#:use-module (srfi srfi-34)
#:use-module (srfi srfi-35)
+ #:use-module (guix diagnostics)
#:use-module ((guix download) #:select (download-to-store))
#:use-module (guix import utils)
#:use-module (guix http-client)
@@ -400,11 +402,16 @@ type '<elpa-package>'."
(string-drop (package-name package) 6)
(package-name package))))
-(define (latest-release package)
+(define* (latest-release package #:key (version #f))
"Return an <upstream-release> for the latest release of PACKAGE."
(define name (guix-package->elpa-name package))
(define repo (elpa-repository package))
+ (when version
+ (error
+ (formatted-message
+ (G_ "~a updater doesn't support updating to a specific version, sorry.")
+ "elpa")))
(match (elpa-package-info name repo)
(#f
;; No info, perhaps because PACKAGE is not truly an ELPA package.
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index 81ea4e8f9c..590fec3dcd 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -25,10 +26,12 @@
#:use-module (ice-9 match)
#:use-module (srfi srfi-1)
#:use-module (json)
+ #:use-module (guix diagnostics)
#:use-module ((guix download) #:prefix download:)
#:use-module (guix import utils)
#:use-module (guix import json)
#:use-module (guix packages)
+ #:use-module (guix i18n)
#:use-module (guix upstream)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix base16)
@@ -167,8 +170,13 @@ package on RubyGems."
(define gem-package?
(url-prefix-predicate "https://rubygems.org/downloads/"))
-(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.")
+ "gem")))
(let* ((gem-name (guix-package->gem-name package))
(gem (rubygems-fetch gem-name))
(version (gem-version gem))
diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm
index d56f52a221..3c2cd75db4 100644
--- a/guix/import/hackage.scm
+++ b/guix/import/hackage.scm
@@ -7,6 +7,7 @@
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2019 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -30,10 +31,12 @@
#:use-module (srfi srfi-34)
#:use-module (srfi srfi-26)
#:use-module (srfi srfi-1)
+ #:use-module (guix diagnostics)
#:use-module ((guix download) #:select (download-to-store url-fetch))
#:use-module ((guix utils) #:select (package-name->name+version
canonical-newline-port))
#:use-module (guix http-client)
+ #:use-module (guix i18n)
#:use-module (guix import utils)
#:use-module (guix import cabal)
#:use-module (guix store)
@@ -359,8 +362,13 @@ respectively."
(let ((hackage-rx (make-regexp "(https?://hackage.haskell.org|mirror://hackage/)")))
(url-predicate (cut regexp-exec hackage-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.")
+ "hackage")))
(let* ((hackage-name (guix-package->hackage-name package))
(cabal-meta (hackage-fetch hackage-name)))
(match cabal-meta
diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm
index 6581013215..1f1cfc834d 100644
--- a/guix/import/minetest.scm
+++ b/guix/import/minetest.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2021, 2022 Maxime Devos <maximedevos@telenet.be>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -25,6 +26,7 @@
#:use-module (srfi srfi-2)
#:use-module (srfi srfi-11)
#:use-module (srfi srfi-26)
+ #:use-module (guix diagnostics)
#:use-module ((guix packages) #:prefix package:)
#:use-module (guix upstream)
#:use-module (guix utils)
@@ -486,7 +488,7 @@ list of AUTHOR/NAME strings."
(and (string-prefix? "minetest-" (package:package-name pkg))
(assq-ref (package:package-properties pkg) 'upstream-name)))
-(define (latest-minetest-release pkg)
+(define* (latest-minetest-release pkg #:key (version #f))
"Return an <upstream-source> for the latest release of the package PKG,
or #false if the latest release couldn't be determined."
(define author/name
@@ -494,6 +496,12 @@ or #false if the latest release couldn't be determined."
(define contentdb-package (contentdb-fetch author/name)) ; TODO warn if #f?
(define release (latest-release author/name))
(define source (package:package-source pkg))
+
+ (when version
+ (error
+ (formatted-message
+ (G_ "~a updater doesn't support updating to a specific version, sorry.")
+ "minetest")))
(and contentdb-package release
(release-commit release) ; not always set
;; Only continue if both the old and new version number are both
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index 8a5aa4d8c6..59dbb7cb8b 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2021, 2022 Alice Brenon <alice.brenon@ens-lyon.fr>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -35,6 +36,7 @@
#:use-module ((guix build utils) #:select (dump-port find-files mkdir-p))
#:use-module (guix build-system)
#:use-module (guix build-system ocaml)
+ #:use-module (guix diagnostics)
#:use-module (guix http-client)
#:use-module (guix ui)
#:use-module (guix packages)
@@ -417,8 +419,13 @@ package in OPAM."
(member (build-system-name (package-build-system package)) '(dune ocaml))
(not (string-prefix? "ocaml4" (package-name package)))))
-(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.")
+ "opam")))
(and-let* ((opam-name (guix-package->opam-name package))
(opam-file (opam-fetch opam-name))
(version (assoc-ref opam-file "version"))
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index af9809304f..e54df95985 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
;;; Copyright © 2021 Xinglu Chem <public@yoctocell.xyz>
;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -139,9 +140,14 @@ included in the Stackage LTS release."
(mlambda ()
(stackage-lts-packages
(stackage-lts-info-fetch %default-lts-version)))))
- (lambda* (pkg)
+ (lambda* (pkg #:key (version #f))
"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
+ (formatted-message
+ (G_ "~a updater doesn't support updating to a specific version, sorry.")
+ "stackage")))
(let* ((hackage-name (guix-package->hackage-name pkg))
(version (lts-package-version (packages) hackage-name))
(name-version (hackage-name-version hackage-name version)))
--
2.30.4
next prev parent reply other threads:[~2022-08-28 13:20 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-28 13:15 [bug#57460] [PATCH 00/19] Refresh to specific version Hartmut Goebel
2022-08-28 13:18 ` [bug#57460] [PATCH 01/20] upstream-updater: Rename record field Hartmut Goebel
2022-08-28 13:18 ` [bug#57460] [PATCH 02/20] import: cpan: Remove unused exports Hartmut Goebel
2022-08-28 13:18 ` Hartmut Goebel [this message]
2022-08-28 13:18 ` [bug#57460] [PATCH 04/20] import: sourceforge: Issue error-message if version is given Hartmut Goebel
2022-08-28 13:22 ` Maxime Devos
2022-08-28 13:18 ` [bug#57460] [PATCH 05/20] refresh: Allow updating to a specific version (gnu-maintenance) Hartmut Goebel
2022-09-24 9:17 ` [bug#57460] [PATCH 00/19] Refresh to specific version Ludovic Courtès
2022-08-28 13:18 ` [bug#57460] [PATCH 06/20] refresh: Allow updating to a specific version (crate) Hartmut Goebel
2022-09-24 9:19 ` [bug#57460] [PATCH 00/19] Refresh to specific version Ludovic Courtès
2022-08-28 13:18 ` [bug#57460] [PATCH 07/20] refresh: Allow updating to a specific version (egg) Hartmut Goebel
2022-08-28 13:18 ` [bug#57460] [PATCH 08/20] refresh: Allow updating to a specific version (git) Hartmut Goebel
2022-09-24 9:24 ` [bug#57460] [PATCH 00/19] Refresh to specific version Ludovic Courtès
2022-08-28 13:18 ` [bug#57460] [PATCH 09/20] refresh: Allow updating to a specific version (github) Hartmut Goebel
2022-09-24 9:26 ` [bug#57460] [PATCH 00/19] Refresh to specific version Ludovic Courtès
2022-08-28 13:18 ` [bug#57460] [PATCH 10/20] refresh: Allow updating to a specific version (gnome) Hartmut Goebel
2022-09-24 9:29 ` [bug#57460] [PATCH 00/19] Refresh to specific version Ludovic Courtès
2022-09-24 10:25 ` Maxime Devos
2022-09-24 16:31 ` Ludovic Courtès
2022-08-28 13:18 ` [bug#57460] [PATCH 11/20] refresh: Allow updating to a specific version (hexpm) Hartmut Goebel
2022-08-28 13:18 ` [bug#57460] [PATCH 12/20] refresh: Allow updating to a specific version (kde) Hartmut Goebel
2022-09-24 9:34 ` [bug#57460] [PATCH 00/19] Refresh to specific version Ludovic Courtès
2022-08-28 13:18 ` [bug#57460] [PATCH 13/20] refresh: Allow updating to a specific version (launchpad) Hartmut Goebel
2022-08-28 13:18 ` [bug#57460] [PATCH 14/20] refresh: Allow updating to a specific version (pypi) Hartmut Goebel
2022-08-28 13:18 ` [bug#57460] [PATCH 15/20] refresh: Allow updating to a specific version (script) Hartmut Goebel
2022-08-28 13:26 ` Maxime Devos
2022-09-24 9:45 ` [bug#57460] [PATCH 00/19] Refresh to specific version Ludovic Courtès
2022-11-01 15:58 ` Hartmut Goebel
2022-11-22 7:33 ` Ludovic Courtès
2022-08-28 13:18 ` [bug#57460] [PATCH 16/20] refresh: Allow updating to a specific version (upstream) Hartmut Goebel
2022-08-28 13:18 ` [bug#57460] [PATCH 17/20] refresh: Allow updating to a specific version (documentation) Hartmut Goebel
2022-08-28 13:18 ` [bug#57460] [PATCH 18/20] TEMP REMOVE import: git: Restrict to non-github origins Hartmut Goebel
2022-08-28 17:26 ` Liliana Marie Prikler
2022-08-28 13:18 ` [bug#57460] [PATCH 19/20] TEMP REMOVE upstream: Output names of importers tried Hartmut Goebel
2022-08-28 13:18 ` [bug#57460] [PATCH 20/20] TEMP REMOVE Add test-script for refesh-with-version Hartmut Goebel
2022-08-28 13:30 ` [bug#57460] [PATCH 00/19] Refresh to specific version Maxime Devos
2022-09-24 9:48 ` Ludovic Courtès
2022-11-01 16:02 ` Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 00/18] " Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 01/18] upstream-updater: Rename record field Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 02/18] import: cpan: Remove unused exports Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 03/18] import: Issue error-message if version is given Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 04/18] import: sourceforge: " Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 05/18] gnu-maintenance: Allow updating to a specific version Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 06/18] import: crate: " Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 07/18] import: egg: " Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 08/18] import: gem: " Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 09/18] import: git: " Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 10/18] import: github: " Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 11/18] import: gnome: " Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 12/18] import: hexpm: " Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 13/18] import: kde: " Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 14/18] import: launchpad: " Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 15/18] import: pypi: " Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 16/18] refresh: " Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 17/18] upstream: " Hartmut Goebel
2022-12-20 9:34 ` [bug#57460] [PATCH v3 18/18] doc: Describe how to update " Hartmut Goebel
2022-12-23 22:42 ` [bug#57460] [PATCH 00/19] Refresh to " Ludovic Courtès
2022-12-23 22:45 ` Ludovic Courtès
2022-12-26 16:42 ` bug#57460: " Hartmut Goebel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41578ce3ed904afa3f6b6d1d6db159d70b26f605.1661691694.git.h.goebel@crazy-compilers.com \
--to=h.goebel@crazy-compilers.com \
--cc=57460@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.