From patchwork Sun Aug 28 13:18:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hartmut Goebel X-Patchwork-Id: 42023 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BBF3427BBEB; Sun, 28 Aug 2022 14:20:33 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8CE4727BBE9 for ; Sun, 28 Aug 2022 14:20:32 +0100 (BST) Received: from localhost ([::1]:59250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oSIDH-0002of-F2 for patchwork@mira.cbaines.net; Sun, 28 Aug 2022 09:20:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSICq-0002lr-2n for guix-patches@gnu.org; Sun, 28 Aug 2022 09:20:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oSICp-0002cw-QS for guix-patches@gnu.org; Sun, 28 Aug 2022 09:20:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oSICp-0006xl-L9 for guix-patches@gnu.org; Sun, 28 Aug 2022 09:20:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57460] [PATCH 03/20] updaters: Issue error-message if version is given: Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 28 Aug 2022 13:20:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57460 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57460@debbugs.gnu.org Received: via spool by 57460-submit@debbugs.gnu.org id=B57460.166169274926485 (code B ref 57460); Sun, 28 Aug 2022 13:20:03 +0000 Received: (at 57460) by debbugs.gnu.org; 28 Aug 2022 13:19:09 +0000 Received: from localhost ([127.0.0.1]:57766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSIBw-0006t0-Fa for submit@debbugs.gnu.org; Sun, 28 Aug 2022 09:19:09 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:50431) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSIBp-0006rg-AF for 57460@debbugs.gnu.org; Sun, 28 Aug 2022 09:19:02 -0400 Received: from hermia.goebel-consult.de ([46.87.137.46]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N2E5Q-1pQGcT1XtW-013f06 for <57460@debbugs.gnu.org>; Sun, 28 Aug 2022 15:18:55 +0200 Received: from lenashee.fritz.box (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id 8547862E16; Sun, 28 Aug 2022 15:18:55 +0200 (CEST) From: Hartmut Goebel Date: Sun, 28 Aug 2022 15:18:29 +0200 Message-Id: <41578ce3ed904afa3f6b6d1d6db159d70b26f605.1661691694.git.h.goebel@crazy-compilers.com> X-Mailer: git-send-email 2.30.4 In-Reply-To: References: MIME-Version: 1.0 X-Provags-ID: V03:K1:7Buse58L+KjPwEGjSVZjyyPvVY7Dnm0AdqChBwaAX1tmTJLcrmg BW5+qpY3n6iyhB9E82aMzwaCRfhFGSLgTI5DNrnVSEeX88V8pna39f6goLUQHeyEO58tP9Y kO/PUuSYIaEQVgsiHF4GPhYlXWf5dpj3AZw0Ho7hCh7Vq+qAzOKbcfDGBuk9uG5x2X17t/g Q5FlGperxC7xrkZyfSvOg== X-UI-Out-Filterresults: notjunk:1;V03:K0:1Im6UrrRFF8=:/Z15Ug0dVsVN+SMeO/z1w8 X+brfCuIxsV2cNNvgceZ3wAbBJxB4uKd33Md6xw60G9y2bBop2gOMzSqchSXcVxzOitDwoK6C KuOfNVPV1K9T8H0udI4AHqwKz8CC0ZA88eeH3GD/DI9IVOB7iswi8QbLQR1W91pwkWr3m0tNi yHPcrgBJ6rdhlEKJEKXV3WwSj/lh3ZBob6+vVfUw27RgD47Z0BqVBZNnFE7dE4CstopuabYVJ I0A1tCyWh2ubDCuhljJ+pdsseiXCwH379pNjUBgT5QEwojdAvWf2VrTxpD71RCPMxyxKDsO9+ GBljaXJ8yolD+y7HDlOTpapcAnrEPl9AcNMnsp3PHnlwCCHDZYpuLIHvpQJfbcg7lkMllW3xl H9FlMNJ4Tne2M8PnT2Q4oKkRUyd1f5hfREU8n3muEgEJGHH3E8z8TI072ZC/xn6CxXMmxKrDv x6rWg5zWyNCgo6ylrXABIcsFkurzdlVz6Rky8/7ZFGoAMB6EbzSOrVZ4263KoVI8rCu8qWvRX TAEwpPaR7aMHFTkSf7J6kBzG2K9VuxsMIcfIAu1Y6M8aaRO9N4hwhd+ZrvH4jDqXDrwhPRLM/ l4XLlc2W+g3QYOhIiv+yKaNTUq/WlCVCwVNVTtU0QjiCvnv/g2oul//tMdSTARx9GIgxAfju/ DUqavfkUWj2Yd3Roc7FUz4KSVowEQCkzjILYaWBdhnH81eoAmOZE+aqJHjN7RPmDqZ+EM8Cpq 8cGhbk6/pExF25EGzhLkBI4OHNMRTV0WCfWDheP5G6p5XS1uC1t/Z3XgcMM= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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. : rename to . * 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 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice ;;; Copyright © 2020, 2021 Ludovic Courtès +;;; Copyright © 2022 Hartmut Goebel ;;; ;;; 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 record." ")")))) (url-predicate (cut regexp-exec cpan-rx <>)))) -(define (latest-release package) +(define* (latest-release package #:key (version #f)) "Return an 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 ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2021 Simon Tournier +;;; Copyright © 2022 Hartmut Goebel ;;; ;;; 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 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 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 ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2021 Simon Tournier +;;; Copyright © 2022 Hartmut Goebel ;;; ;;; 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 ''." (string-drop (package-name package) 6) (package-name package)))) -(define (latest-release package) +(define* (latest-release package #:key (version #f)) "Return an 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 ;;; Copyright © 2020 Martin Becze ;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2022 Hartmut Goebel ;;; ;;; 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 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 ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2019 Simon Tournier +;;; Copyright © 2022 Hartmut Goebel ;;; ;;; 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 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 +;;; Copyright © 2022 Hartmut Goebel ;;; ;;; 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 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 ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2021, 2022 Alice Brenon +;;; Copyright © 2022 Hartmut Goebel ;;; ;;; 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 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 ;;; Copyright © 2021 Xinglu Chem ;;; Copyright © 2021 Ludovic Courtès +;;; Copyright © 2022 Hartmut Goebel ;;; ;;; 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 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)))