From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id IFaHDKJrC2MWeAEAbAwnHQ (envelope-from ) for ; Sun, 28 Aug 2022 15:20:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cEOBDKJrC2NNwgAA9RJhRA (envelope-from ) for ; Sun, 28 Aug 2022 15:20:34 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A82C323E81 for ; Sun, 28 Aug 2022 15:20:33 +0200 (CEST) Received: from localhost ([::1]:59250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oSIDI-0002of-Kb for larch@yhetil.org; Sun, 28 Aug 2022 09:20:32 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:7Buse58L+KjPwEGjSVZjyyPvVY7Dnm0AdqChBwaAX1tmTJLcrmg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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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1661692833; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=76a2tWiHDpW5qknW12kw5hoLccBBx+IrHQjDKvG6YOo=; b=VzlsFpu5PEm+Kx9CLL7C4jhfCvUT/aWWI4sxwju9W3AGS+5lk+XxbbdiKQ1XgyC2p4pds5 fY0qeK3aqFemxlHMYnKXKeVM+PDGaw2lZGzX6MQH8fCznP/IO/dbMaxSDSIgPqpu2k6xcd sL8BavdgplTfcxiIyd5Wnm5MATmzCRfe7ghGGEMRQURF3op/Kib2Jm4Ank/a2RHxNFEauB QwK6PwAjQ3mxv3b2M2/thUMgYmsD8LTK23QBZ+aDo0aYjryLamPNbbizeLJ4NvzZzsQhAm Sj1C6G479DJYgrY1SFtIdZev/+NYyyw17xQ4haSVujU1d0kw9P+IJwVQrvlvDw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661692833; a=rsa-sha256; cv=none; b=T7/U429ByQIQxN9iTvkjdcxY6aj9D2Emt/bj8kfEzNFmRPxm4fxSUMx/Na+yoNvRLu8RMR MyPxsysBykem4jQolEdrPhpTAxytAwqD2SHOikm2HX5OkXTg4ROGo4JowOrXDihxt8b8Q4 Cv21YtuHglZ2o1MPnEeZExukoJN3EoAUArORymIHy3boLTZKEQDJJNnIOmIZTESCpDsw9e JiGuC3svdh/fi13D99yhikWnkaS3D1F8Xz14ZmsP82Pl+Q1Vf0YYafsBgq/jgn+1HBQ99m UkaPEEHBV39FYir2pMVeG/FNrQYmITR43BN9fU20F4rWC6++uVKVdaw/9y5uUg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -0.80 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: A82C323E81 X-Spam-Score: -0.80 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6fCRQExpTjms 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))) -- 2.30.4