From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SKMOH9eIoWNyMwEAbAwnHQ (envelope-from ) for ; Tue, 20 Dec 2022 11:05:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id qGgwHteIoWNpfQAAG6o9tA (envelope-from ) for ; Tue, 20 Dec 2022 11:05:11 +0100 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 0D2B03FFF4 for ; Tue, 20 Dec 2022 11:05:11 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7Z2X-0004tf-1c; Tue, 20 Dec 2022 04:36:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7Z1c-0004dt-Nj for guix-patches@gnu.org; Tue, 20 Dec 2022 04:35:09 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p7Z1c-0002kd-ER for guix-patches@gnu.org; Tue, 20 Dec 2022 04:35:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p7Z1c-0003Qb-8F for guix-patches@gnu.org; Tue, 20 Dec 2022 04:35:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#57460] [PATCH v3 03/18] import: Issue error-message if version is given. Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 20 Dec 2022 09:35:04 +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 moreinfo To: 57460@debbugs.gnu.org Received: via spool by 57460-submit@debbugs.gnu.org id=B57460.167152888213038 (code B ref 57460); Tue, 20 Dec 2022 09:35:04 +0000 Received: (at 57460) by debbugs.gnu.org; 20 Dec 2022 09:34:42 +0000 Received: from localhost ([127.0.0.1]:43720 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7Z1F-0003OD-4a for submit@debbugs.gnu.org; Tue, 20 Dec 2022 04:34:42 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:59129) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7Z1D-0003NY-2m for 57460@debbugs.gnu.org; Tue, 20 Dec 2022 04:34:40 -0500 Received: from hermia.goebel-consult.de ([87.176.134.225]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MXGSU-1pOkS91GgQ-00Yhy4 for <57460@debbugs.gnu.org>; Tue, 20 Dec 2022 10:34:31 +0100 Received: from thisbe.goebel-consult.de (hermia.goebel-consult.de [192.168.110.7]) by hermia.goebel-consult.de (Postfix) with ESMTP id 432B2663CC; Tue, 20 Dec 2022 10:34:23 +0100 (CET) From: Hartmut Goebel Date: Tue, 20 Dec 2022 10:34:08 +0100 Message-Id: <88e627ef28e4025b8cb670461f827c59c1b89276.1671527962.git.h.goebel@crazy-compilers.com> X-Mailer: git-send-email 2.30.6 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:fNNbmREUa0P2uysajcHIAiHn7cVskWtiUN9JC26EUd0HKf/QGrS 3IZEjMMFoLiZvjSYvR0ZEdhz424M1ryiN3ZEq01ohPWT9zYX4JQK6yhiKo1E5A1qbwFSvy3 7zAf11lvrwZ6W8UkI4lyVyAFNx3VAi0Pu+ncZbu/YykYDvPZAGzHCbTSVngoRm+ZwKVOd0y Ym97aERDsBITaX7A1x70Q== UI-OutboundReport: notjunk:1;M01:P0:9bXuxuMtCp8=;mV21hqzGWJaYalG/WVR0Ky2Pud0 MsmsaNd016oIH9GRrn33KvUe+kMsw6pIBtX5ksC3qVnQG5LmOHd385ApNwCvkEIiKYC18uykT uyTx5EaQg852Bk80fxGROd4rDT1Y81nJDruZx/BQuugW5wRjh7n8DIc+K8+PlkGJt7sQnv5jZ D/1zQr3R1ZmdLwxD5wAS62G1uXo3ULHG3FiSHHwYSHR/RHQUYFbxSbeNoE2i8cYm/2ojC5M1W +F53eYzaXAIKaFVMNqPWYN+O0YlO8ZC05gkliKtMBjuvaTM2C0NQrdzlZ5H/p5ekF0d7g/RJw oLD1iFQ30wz2A6J+s7DKjpGGRd/u+EcI7F1LUbiK9200XBF1khH8gIK3RN1wKig+XKcc8F3b0 x/RnHIRKPSx0m2taZvyRpsiag1z/pej4RHkHzN2qv1EmAJ/Jrgb104QcOA9M2HJPuj73KRJPA nkbUUdNVsPSSO6ExUByC9q9Ej6Ie7uqSSx7F/JtC19DaIQbdkH96Pa52DFTafZ5ryHylvpaGT PgFU2tslfKCxWth9QthZaL6ymy+MbS+2ZZCuSOK64zfJZbzQ3t9pL/RMFzSwh45Ox+1Q600U1 SDoNsfvgE7vWVbhRIv2wfMaCjkqWWVprIWjt3tr5HvViEyUA6yaGG4KvSQQPCYXhcqpm/TXg2 M2aqzU7NTM0P1XXC40jHCPWGWeWG09YOgYBBQ+L0FA== 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671530711; a=rsa-sha256; cv=none; b=ojgVp/CRZsonCSQVwk3UyKrCB8FKYEZqRKkxsZZ0lo16o+vhbomvdCa7WbfpbuYtnG3c85 kaTYAH2Twy5bWy9cLn5jG23JRP/Ow3Oes4uG3r53vh8CZdBNfSGhlyZbeq5TQl96dJ1K67 x8Frb8qcA/3ZSsPD0hNK3hd1ATT3ltTyNZ7IxI4OL0tsReTu/z9wNspM7OI1QKYDRKMH0W KD60J09a7vYlmWM9YtMAd7rJiIEEn7UwsFTSzBmYRebNSvr/Bl9nJl+FNPFQwMd1Ogow2e FyMiHfrH3ydtbav48vqMjocO2qpnHAo8kUOGV/W+hKFENb5+lP8PW9frEgcfjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671530711; 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=IAaBJF43qauSe0JCnuCDKM0Ba3EiOjW1Kcxet78i3Uk=; b=KyHIQo4PfJjfDFNOQoTctixAcU9HXmcWNL4lRowBKAmv3STlO8Nn5DvWneUhav5mny/PoF Mo1f6qu1AfhKOKtqHo/KwoqPinN0DHcc/coXtYqB3mt9cvPd9zq7auBZfKgoG12bcYC2FI FVz7l3ypkJEckrNdTgU5n88TZm5ce22ONXqcihNMGWzDCTZeQ8em7kbVX/siALR0cWfPmG LRDkKamFNFUYeLH/5X4t+B6jL4p457oTgyL3tWu0eqbHeqwrQ6TdKnrzYXYF07eK+o5951 b0I61eBA6eNU5h6bzJ2sg7rtBSTA97sNrNUoUhvlNF0IG52NeslmfQrXu+Mu1Q== X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=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"; dmarc=none X-Migadu-Spam-Score: -2.49 X-Spam-Score: -2.49 X-Migadu-Queue-Id: 0D2B03FFF4 X-TUID: Xk9SvbGs5IIy 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/hackage.scm (latest-release), guix/import/minetest.scm (latest-minetest-release), guix/import/opam.scm (latest-release): Add #:version argument, 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 #:version argument and issue error if version is given. --- guix/import/cpan.scm | 9 ++++++++- guix/import/cran.scm | 19 +++++++++++++++---- guix/import/elpa.scm | 9 ++++++++- guix/import/hackage.scm | 10 +++++++++- guix/import/minetest.scm | 10 +++++++++- guix/import/opam.scm | 9 ++++++++- guix/import/stackage.scm | 8 +++++++- 7 files changed, 64 insertions(+), 10 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 473d8c4f5b..1ed3580315 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. ;;; @@ -693,8 +694,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)) @@ -713,20 +719,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/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.6