GNU bug report logs - #57460
[PATCH 00/19] Refresh to specific version

Previous Next

Package: guix-patches;

Reported by: Hartmut Goebel <h.goebel <at> crazy-compilers.com>

Date: Sun, 28 Aug 2022 13:16:02 UTC

Severity: normal

Tags: moreinfo, patch

Done: Hartmut Goebel <h.goebel <at> crazy-compilers.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57460 in the body.
You can then email your comments to 57460 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Hartmut Goebel <h.goebel <at> crazy-compilers.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 28 Aug 2022 13:16:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: guix-patches <at> gnu.org
Subject: [PATCH 00/19] Refresh to specific version
Date: Sun, 28 Aug 2022 15:15:34 +0200
This series now implements refreshing packages to a specific version,
see <https://lists.gnu.org/archive/html/guix-devel/2022-07/msg00061.html>.

+@example
+$ guix refresh trytond-party
… trytond-party would be upgraded from 6.2.0 to 6.4.0
+$ guix refresh -u trytond-party <at> 6.2.1
…
… trytond-party: updating from version 6.2.0 to version 6.2.1...
…
+@end example


The „main“ part of thhis series does the following:

* All updaters get a new keyword-argument "version"
* Updaters supporting updating to a specific version
  - will pass the version on to call functions and try to update to the
    specific version.
  - "latest-XX-release" functions have been renamed into "import-XX-release"
    to mirror the change
* Updaters not supporting updating to a specific version
  - will issue an error message if a version is given.
  - "latest-XX-release" functions keep the name
  

My plan is to squash the „main” patches into a single one after review (and
extend the commit-message from this post). WDYT?

For testing the change, please run "sh test-import-with-version.sh", which
will update one package for each importer/updater and report about those not
supporting updating to a specific version.


Hartmut Goebel (20):
  upstream-updater: Rename record field.
  import: cpan: Remove unused exports.
  updaters: Issue error-message if version is given:
  import: sourceforge: Issue error-message if version is given.
  refresh: Allow updating to a specific version (gnu-maintenance)
  refresh: Allow updating to a specific version (crate)
  refresh: Allow updating to a specific version (egg)
  refresh: Allow updating to a specific version (git)
  refresh: Allow updating to a specific version (github)
  refresh: Allow updating to a specific version (gnome)
  refresh: Allow updating to a specific version (hexpm)
  refresh: Allow updating to a specific version (kde)
  refresh: Allow updating to a specific version (launchpad)
  refresh: Allow updating to a specific version (pypi)
  refresh: Allow updating to a specific version (script)
  refresh: Allow updating to a specific version (upstream)
  refresh: Allow updating to a specific version (documentation)

These patches will not go into master. Their sole purpose is to carry the code
required to test this patch.

  TEMP REMOVE import: git: Restrict to non-github origins.
  TEMP REMOVE upstream: Output names of importers tried.
  TEMP REMOVE Add test-script for refesh-with-version

 doc/guix.texi               |  13 +++
 guix/gnu-maintenance.scm    | 152 ++++++++++++++++++++++--------------
 guix/import/cpan.scm        |  32 +++-----
 guix/import/cran.scm        |  23 ++++--
 guix/import/crate.scm       |   7 +-
 guix/import/egg.scm         |   7 +-
 guix/import/elpa.scm        |  11 ++-
 guix/import/gem.scm         |  12 ++-
 guix/import/git.scm         |  33 +++++---
 guix/import/github.scm      |  29 ++++---
 guix/import/gnome.scm       |  47 +++++++----
 guix/import/gnu.scm         |   2 +-
 guix/import/hackage.scm     |  12 ++-
 guix/import/hexpm.scm       |   6 +-
 guix/import/kde.scm         |  58 ++++++++------
 guix/import/launchpad.scm   |   7 +-
 guix/import/minetest.scm    |  12 ++-
 guix/import/opam.scm        |  11 ++-
 guix/import/pypi.scm        |  11 +--
 guix/import/stackage.scm    |  10 ++-
 guix/scripts/refresh.scm    |  40 +++++++---
 guix/upstream.scm           |  26 +++---
 test-import-with-version.sh |  98 +++++++++++++++++++++++
 tests/import-github.scm     |   2 +-
 tests/transformations.scm   |   8 +-
 25 files changed, 465 insertions(+), 204 deletions(-)
 create mode 100644 test-import-with-version.sh


base-commit: 84d191ea30eb7d97ee3f4d62f39c811ba77bb187
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:19:02 GMT) Full text and rfc822 format available.

Message #8 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 01/20] upstream-updater: Rename record field.
Date: Sun, 28 Aug 2022 15:18:27 +0200
The next commits will make the functions, which are currently importing the
latest version of a package, change into importing the latest or a given
version of the package (for those updaters supporting specifying a version).
Thus the name ‘latest‘ is no longer appropriate.

* guix/upstream.scm(upstream-updater) Rename field [latest] to
  [import]. (lookup-updater, package-latest-release) Adjust fieldname
  accordingly.
* guix/gnu-maintenance.scm(%gnu-updater, %gnu-ftp-updater,
  %savannah-updater, %sourceforge-updater, %xorg-updater,
  %kernel.org-updater, %generic-html-updater),
  guix/import/cpan.scm(%cpan-updater),
  guix/import/cran.scm(%cran-updater, %bioconductor-updater),
  guix/import/crate.scm(%crate-updater),
  guix/import/egg.scm(%egg-updater),
  guix/import/elpa.scm(%elpa-updater),
  guix/import/gem.scm(%gem-updater),
  guix/import/git.scm(%generic-git-updater),
  guix/import/github.scm(%github-updater),
  guix/import/gnome.scm(%gnome-updater),
  guix/import/hackage.scm(%hackage-updater),
  guix/import/hexpm.scm(%hexpm-updater),
  guix/import/kde.scm(%kde-updater),
  guix/import/launchpad.scm(%launchpad-updater),
  guix/import/minetest.scm(%minetest-updater),
  guix/import/opam.scm(%opam-updater),
  guix/import/pypi.scm(%pypi-updater),
  guix/import/stackage.scm(%stackage-updater),
  tests/import-github.scm(found-sexp)
  tests/transformations.scm("options->transformation, with-latest"):
  Adjust fieldname accordingly.
---
 guix/gnu-maintenance.scm  | 14 +++++++-------
 guix/import/cpan.scm      |  2 +-
 guix/import/cran.scm      |  4 ++--
 guix/import/crate.scm     |  2 +-
 guix/import/egg.scm       |  2 +-
 guix/import/elpa.scm      |  2 +-
 guix/import/gem.scm       |  2 +-
 guix/import/git.scm       |  2 +-
 guix/import/github.scm    |  2 +-
 guix/import/gnome.scm     |  2 +-
 guix/import/hackage.scm   |  2 +-
 guix/import/hexpm.scm     |  2 +-
 guix/import/kde.scm       |  2 +-
 guix/import/launchpad.scm |  2 +-
 guix/import/minetest.scm  |  2 +-
 guix/import/opam.scm      |  2 +-
 guix/import/pypi.scm      |  2 +-
 guix/import/stackage.scm  |  2 +-
 guix/upstream.scm         | 10 +++++-----
 tests/import-github.scm   |  2 +-
 tests/transformations.scm |  8 ++++----
 21 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index e7edbf6656..a278903a8d 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -830,7 +830,7 @@ the directory containing its source tarball."
    (name 'gnu)
    (description "Updater for GNU packages")
    (pred gnu-hosted?)
-   (latest latest-gnu-release)))
+   (import latest-gnu-release)))
 
 (define %gnu-ftp-updater
   ;; This is for GNU packages taken from alternate locations, such as
@@ -841,41 +841,41 @@ the directory containing its source tarball."
    (pred (lambda (package)
            (and (not (gnu-hosted? package))
                 (pure-gnu-package? package))))
-   (latest latest-release*)))
+   (import latest-release*)))
 
 (define %savannah-updater
   (upstream-updater
    (name 'savannah)
    (description "Updater for packages hosted on savannah.gnu.org")
    (pred (url-prefix-predicate "mirror://savannah/"))
-   (latest latest-savannah-release)))
+   (import latest-savannah-release)))
 
 (define %sourceforge-updater
   (upstream-updater
    (name 'sourceforge)
    (description "Updater for packages hosted on sourceforge.net")
    (pred (url-prefix-predicate "mirror://sourceforge/"))
-   (latest latest-sourceforge-release)))
+   (import latest-sourceforge-release)))
 
 (define %xorg-updater
   (upstream-updater
    (name 'xorg)
    (description "Updater for X.org packages")
    (pred (url-prefix-predicate "mirror://xorg/"))
-   (latest latest-xorg-release)))
+   (import latest-xorg-release)))
 
 (define %kernel.org-updater
   (upstream-updater
    (name 'kernel.org)
    (description "Updater for packages hosted on kernel.org")
    (pred (url-prefix-predicate "mirror://kernel.org/"))
-   (latest latest-kernel.org-release)))
+   (import latest-kernel.org-release)))
 
 (define %generic-html-updater
   (upstream-updater
    (name 'generic-html)
    (description "Updater that crawls HTML pages.")
    (pred html-updatable-package?)
-   (latest latest-html-updatable-release)))
+   (import latest-html-updatable-release)))
 
 ;;; gnu-maintenance.scm ends here
diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
index 87abe9c2f1..cb2d3dd410 100644
--- a/guix/import/cpan.scm
+++ b/guix/import/cpan.scm
@@ -358,4 +358,4 @@ in RELEASE, a <cpan-release> record."
    (name 'cpan)
    (description "Updater for CPAN packages")
    (pred cpan-package?)
-   (latest latest-release)))
+   (import latest-release)))
diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index 4e1ce7c010..33305d68eb 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -723,13 +723,13 @@ s-expression corresponding to that package, or #f on failure."
    (name 'cran)
    (description "Updater for CRAN packages")
    (pred cran-package?)
-   (latest latest-cran-release)))
+   (import latest-cran-release)))
 
 (define %bioconductor-updater
   (upstream-updater
    (name 'bioconductor)
    (description "Updater for Bioconductor packages")
    (pred bioconductor-package?)
-   (latest latest-bioconductor-release)))
+   (import latest-bioconductor-release)))
 
 ;;; cran.scm ends here
diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index c76d7e9c1a..51bfcd7bed 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -370,5 +370,5 @@ look up the development dependencs for the given crate."
    (name 'crate)
    (description "Updater for crates.io packages")
    (pred crate-package?)
-   (latest latest-release)))
+   (import latest-release)))
 
diff --git a/guix/import/egg.scm b/guix/import/egg.scm
index 52196583c4..aa689f8d84 100644
--- a/guix/import/egg.scm
+++ b/guix/import/egg.scm
@@ -348,6 +348,6 @@ not work."
    (name 'egg)
    (description "Updater for CHICKEN egg packages")
    (pred egg-package?)
-   (latest latest-release)))
+   (import latest-release)))
 
 ;;; egg.scm ends here
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 9399f45ebc..1dbdff9391 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -444,7 +444,7 @@ type '<elpa-package>'."
    (name 'elpa)
    (description "Updater for ELPA packages")
    (pred package-from-elpa-repository?)
-   (latest latest-release)))
+   (import latest-release)))
 
 (define elpa-guix-name (cut guix-name "emacs-" <>))
 
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index 0e5bb7e635..81ea4e8f9c 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -183,7 +183,7 @@ package on RubyGems."
    (name 'gem)
    (description "Updater for RubyGem packages")
    (pred gem-package?)
-   (latest latest-release)))
+   (import latest-release)))
 
 (define* (gem-recursive-import package-name #:optional version)
   (recursive-import package-name
diff --git a/guix/import/git.scm b/guix/import/git.scm
index 4cf404677c..bb5ba4d97e 100644
--- a/guix/import/git.scm
+++ b/guix/import/git.scm
@@ -226,4 +226,4 @@ tag, or #false and #false if the latest version could not be determined."
    (name 'generic-git)
    (description "Updater for packages hosted on Git repositories")
    (pred git-package?)
-   (latest latest-git-release)))
+   (import latest-git-release)))
diff --git a/guix/import/github.scm b/guix/import/github.scm
index e1a1af7133..ac6ef06eda 100644
--- a/guix/import/github.scm
+++ b/guix/import/github.scm
@@ -330,6 +330,6 @@ releases."
    (name 'github)
    (description "Updater for GitHub packages")
    (pred github-package?)
-   (latest latest-release)))
+   (import latest-release)))
 
 
diff --git a/guix/import/gnome.scm b/guix/import/gnome.scm
index 43966c1028..3562e17e0f 100644
--- a/guix/import/gnome.scm
+++ b/guix/import/gnome.scm
@@ -114,4 +114,4 @@ not be determined."
    (name 'gnome)
    (description "Updater for GNOME packages")
    (pred (url-prefix-predicate "mirror://gnome/"))
-   (latest latest-gnome-release)))
+   (import latest-gnome-release)))
diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm
index 878a7d2f9c..d56f52a221 100644
--- a/guix/import/hackage.scm
+++ b/guix/import/hackage.scm
@@ -381,6 +381,6 @@ respectively."
    (name 'hackage)
    (description "Updater for Hackage packages")
    (pred hackage-package?)
-   (latest latest-release)))
+   (import latest-release)))
 
 ;;; cabal.scm ends here
diff --git a/guix/import/hexpm.scm b/guix/import/hexpm.scm
index 2a7a9f3d82..3b63837393 100644
--- a/guix/import/hexpm.scm
+++ b/guix/import/hexpm.scm
@@ -344,4 +344,4 @@ latest version of PACKAGE-NAME."
    (name 'hexpm)
    (description "Updater for hex.pm packages")
    (pred (url-prefix-predicate hexpm-package-url))
-   (latest latest-release)))
+   (import latest-release)))
diff --git a/guix/import/kde.scm b/guix/import/kde.scm
index 6873418d62..510d823a4f 100644
--- a/guix/import/kde.scm
+++ b/guix/import/kde.scm
@@ -187,4 +187,4 @@ not be determined."
     (name 'kde)
     (description "Updater for KDE packages")
     (pred (url-prefix-predicate "mirror://kde/"))
-    (latest latest-kde-release)))
+    (import latest-kde-release)))
diff --git a/guix/import/launchpad.scm b/guix/import/launchpad.scm
index aeb447b0a5..b7e0295c4e 100644
--- a/guix/import/launchpad.scm
+++ b/guix/import/launchpad.scm
@@ -145,4 +145,4 @@ for example, 'linuxdcpp'. Return #f if there is no releases."
    (name 'launchpad)
    (description "Updater for Launchpad packages")
    (pred launchpad-package?)
-   (latest latest-release)))
+   (import latest-release)))
diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm
index 43cfb533e2..6581013215 100644
--- a/guix/import/minetest.scm
+++ b/guix/import/minetest.scm
@@ -513,4 +513,4 @@ or #false if the latest release couldn't be determined."
     (name 'minetest)
     (description "Updater for Minetest packages on ContentDB")
     (pred minetest-package?)
-    (latest latest-minetest-release)))
+    (import latest-minetest-release)))
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index b4b5a6eaad..8a5aa4d8c6 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -435,4 +435,4 @@ package in OPAM."
     (name 'opam)
     (description "Updater for OPAM packages")
     (pred opam-package?)
-    (latest latest-release)))
+    (import latest-release)))
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 4760fc3dae..3e3e949283 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -583,4 +583,4 @@ source.  To build it from source, refer to the upstream repository at
    (name 'pypi)
    (description "Updater for PyPI packages")
    (pred pypi-package?)
-   (latest latest-release)))
+   (import latest-release)))
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index 49be982a7f..af9809304f 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -175,6 +175,6 @@ PACKAGE or #f if the package is not included in the Stackage LTS release."
    (name 'stackage)
    (description "Updater for Stackage LTS packages")
    (pred stackage-lts-package?)
-   (latest latest-lts-release)))
+   (import latest-lts-release)))
 
 ;;; stackage.scm ends here
diff --git a/guix/upstream.scm b/guix/upstream.scm
index cbfd1aa609..6cee6440c3 100644
--- a/guix/upstream.scm
+++ b/guix/upstream.scm
@@ -66,7 +66,7 @@
             upstream-updater-name
             upstream-updater-description
             upstream-updater-predicate
-            upstream-updater-latest
+            upstream-updater-import
 
             upstream-input-change?
             upstream-input-change-name
@@ -240,7 +240,7 @@ correspond to the same version."
   (name        upstream-updater-name)
   (description upstream-updater-description)
   (pred        upstream-updater-predicate)
-  (latest      upstream-updater-latest))
+  (import      upstream-updater-import))
 
 (define (importer-modules)
   "Return the list of importer modules."
@@ -271,7 +271,7 @@ correspond to the same version."
   "Return an updater among UPDATERS that matches PACKAGE, or #f if none of
 them matches."
   (find (match-lambda
-          (($ <upstream-updater> name description pred latest)
+          (($ <upstream-updater> name description pred import)
            (pred package)))
         updaters))
 
@@ -284,9 +284,9 @@ them until one of them returns an upstream source.  It is the caller's
 responsibility to ensure that the returned source is newer than the current
 one."
   (any (match-lambda
-         (($ <upstream-updater> name description pred latest)
+         (($ <upstream-updater> name description pred import)
           (and (pred package)
-               (latest package))))
+               (import package))))
        updaters))
 
 (define* (package-latest-release* package
diff --git a/tests/import-github.scm b/tests/import-github.scm
index 4d3f8cfc7e..5100296540 100644
--- a/tests/import-github.scm
+++ b/tests/import-github.scm
@@ -92,7 +92,7 @@
 (define* (found-sexp old-version old-commit tags releases)
   (and=>
    (call-with-releases (lambda ()
-                         ((upstream-updater-latest %github-updater)
+                         ((upstream-updater-import %github-updater)
                           (example-package old-version old-commit)))
                        tags releases)
    upstream-source->sexp))
diff --git a/tests/transformations.scm b/tests/transformations.scm
index dbfe523518..ce29b1676c 100644
--- a/tests/transformations.scm
+++ b/tests/transformations.scm
@@ -470,10 +470,10 @@
                        (name 'dummy)
                        (pred (const #t))
                        (description "")
-                       (latest (const (upstream-source
-                                       (package "foo")
-                                       (version "42.0")
-                                       (urls '("http://example.org")))))))))
+                       (import (const (upstream-source
+                                         (package "foo")
+                                         (version "42.0")
+                                         (urls '("http://example.org")))))))))
         (let* ((p (dummy-package "foo" (version "1.0")))
                (t (options->transformation
                    `((with-latest . "foo")))))
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:02 GMT) Full text and rfc822 format available.

Message #11 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 02/20] import: cpan: Remove unused exports.
Date: Sun, 28 Aug 2022 15:18:28 +0200
* guix/import/cpan.scm(#:export): Remove unused exports.
---
 guix/import/cpan.scm | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
index cb2d3dd410..a929dc62e3 100644
--- a/guix/import/cpan.scm
+++ b/guix/import/cpan.scm
@@ -39,26 +39,7 @@
   #:use-module (guix packages)
   #:use-module (guix upstream)
   #:use-module (guix derivations)
-  #:export (cpan-dependency?
-            cpan-dependency-relationship
-            cpan-dependency-phase
-            cpan-dependency-module
-            cpan-dependency-version
-
-            cpan-release?
-            cpan-release-license
-            cpan-release-author
-            cpan-release-version
-            cpan-release-module
-            cpan-release-distribution
-            cpan-release-download-url
-            cpan-release-abstract
-            cpan-release-home-page
-            cpan-release-dependencies
-            json->cpan-release
-
-            cpan-fetch
-            cpan->guix-package
+  #:export (cpan->guix-package
             metacpan-url->mirror-url
             %cpan-updater
 
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:03 GMT) Full text and rfc822 format available.

Message #14 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 03/20] updaters: Issue error-message if version is given:
Date: Sun, 28 Aug 2022 15:18:29 +0200
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 <at> pompo.co>
 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2020, 2021 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> 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 <at> riseup.net>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> 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 <at> yoctocell.xyz>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> 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 <at> gnu.org>
 ;;; Copyright © 2020 Martin Becze <mjbecze <at> riseup.net>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> 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 <at> yoctocell.xyz>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
 ;;; Copyright © 2019 Simon Tournier <zimon.toutoune <at> gmail.com>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> 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 <at> telenet.be>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> 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 <at> yoctocell.xyz>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
 ;;; Copyright © 2021, 2022 Alice Brenon <alice.brenon <at> ens-lyon.fr>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> 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 <at> riseup.net>
 ;;; Copyright © 2021 Xinglu Chem <public <at> yoctocell.xyz>
 ;;; Copyright © 2021 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> 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





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:04 GMT) Full text and rfc822 format available.

Message #17 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 04/20] import: sourceforge: Issue error-message if version is
 given.
Date: Sun, 28 Aug 2022 15:18:30 +0200
Due to the complicated directory structure at sourceforce,
enabling the  sourceforge importer to update to a specific version
is very complicated to implement. Since only 2.0% of the
packages in guix are covered by this updater I dedided to now
implement this.

* guix/gnu-maintenance.scm(latest-sourceforge-release): Issue
  error-message if version is given.
---
 guix/gnu-maintenance.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index a278903a8d..8446a59fb5 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -34,6 +34,8 @@
   #:use-module ((guix http-client) #:hide (open-socket-for-uri))
   #:use-module (guix ftp-client)
   #:use-module (guix utils)
+  #:use-module (guix diagnostics)
+  #:use-module (guix i18n)
   #:use-module (guix memoization)
   #:use-module (guix records)
   #:use-module (guix upstream)
@@ -683,7 +685,7 @@ GNOME packages; EMMS is included though, because its releases are on gnu.org."
                                 #:directory directory)
            (cut adjusted-upstream-source <> rewrite))))
 
-(define (latest-sourceforge-release package)
+(define* (latest-sourceforge-release package #:key (version #f))
   "Return the latest release of PACKAGE."
   (define (uri-append uri extension)
     ;; Return URI with EXTENSION appended.
@@ -698,6 +700,12 @@ GNOME packages; EMMS is included though, because its releases are on gnu.org."
        ((200 302) #t)
        (else #f))))
 
+  (when version
+    (error
+     (formatted-message
+      (G_ "Updating to a specific version is not yet implemented for ~a, sorry.")
+      "sourceforge")))
+
   (let* ((name     (package-upstream-name package))
          (base     (string-append "https://sourceforge.net/projects/"
                                   name "/files"))
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:04 GMT) Full text and rfc822 format available.

Message #20 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 05/20] refresh: Allow updating to a specific version
 (gnu-maintenance)
Date: Sun, 28 Aug 2022 15:18:31 +0200
* guix/gnu-maintenance.scm
  (latest-ftp-release): Rename to (import-ftp-release),
  add keyword-argument 'version'.
  If version is given, try to find the respective version.
  (latest-html-release): Rename to (import-html-release),
  add keyword-argument 'version'.
  If version is given, try to find the respective version.
  (latest-gnu-release): Rename to (import-gnu-release),
  add keyword-argument 'version'. Refactor to first select archives for
  respective package, the find the requested or latest version, then create
  the upstream-source.
  (latest-release): Rename to (import-release),
  add keyword-argument 'version', pass on to import-ftp-release.
  (import-release*): Rename to (import-release*),
  add keyword-argument 'version', pass on to latest-release.
  (latest-savannah-release): Rename to (import-savannah-release),
  add keword-argument version, pass on to import-html-release.
  (latest-xorg-release): Rename to (import-xorg-release),
  add keword-argument version, pass on to import-ftp-release.
  (latest-kernel.org-release): Rename to (import-kernel.org-release),
  add keyword-argument 'version', pass on to import-html-release.
  (latest-html-updatable-release): Rename to (import-html-updatable-release),
  add keyword-argument 'version', pass on to import-html-release.
* guix/import/gnu.scm(gnu->guix-package): Adjust function call.
---
 guix/gnu-maintenance.scm | 140 +++++++++++++++++++++++----------------
 guix/import/gnu.scm      |   2 +-
 2 files changed, 84 insertions(+), 58 deletions(-)

diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 8446a59fb5..ea3394e9e8 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -328,8 +328,9 @@ name/directory pairs."
                             files)
                 result)))))))
 
-(define* (latest-ftp-release project
+(define* (import-ftp-release project
                              #:key
+                             (version #f)
                              (server "ftp.gnu.org")
                              (directory (string-append "/gnu/" project))
                              (file->signature (cut string-append <> ".sig")))
@@ -400,8 +401,11 @@ return the corresponding signature URL, or #f it signatures are unavailable."
 
       ;; Assume that SUBDIRS correspond to versions, and jump into the
       ;; one with the highest version number.
-      (let* ((release  (reduce latest-release #f
-                               (coalesce-sources releases)))
+      (let* ((release  (if version
+                           (car (filter (lambda (r) (string=? version (upstream-source-version r)))
+                                        (coalesce-sources releases)))
+                           (reduce latest-release #f
+                                   (coalesce-sources releases))))
              (result   (if (and result release)
                            (latest-release release result)
                            (or release result)))
@@ -413,13 +417,15 @@ return the corresponding signature URL, or #f it signatures are unavailable."
               (ftp-close conn)
               result))))))
 
-(define* (latest-release package
+(define* (import-release package
                          #:key
+                         (version #f)
                          (server "ftp.gnu.org")
                          (directory (string-append "/gnu/" package)))
   "Return the <upstream-source> for the latest version of PACKAGE or #f.
 PACKAGE must be the canonical name of a GNU package."
-  (latest-ftp-release package
+  (import-ftp-release package
+                      #:version version
                       #:server server
                       #:directory directory))
 
@@ -435,14 +441,15 @@ of EXP otherwise."
           (close-port port))
       #f)))
 
-(define (latest-release* package)
-  "Like 'latest-release', but (1) take a <package> object, and (2) ignore FTP
+(define* (import-release* package #:key (version #f))
+  "Like 'import-release', but (1) take a <package> object, and (2) ignore FTP
 errors that might occur when PACKAGE is not actually a GNU package, or not
 hosted on ftp.gnu.org, or not under that name (this is the case for
 \"emacs-auctex\", for instance.)"
   (let-values (((server directory)
                 (ftp-server/directory package)))
-    (false-if-ftp-error (latest-release (package-upstream-name package)
+    (false-if-ftp-error (import-release (package-upstream-name package)
+                                        #:version version
                                         #:server server
                                         #:directory directory))))
 
@@ -467,8 +474,9 @@ hosted on ftp.gnu.org, or not under that name (this is the case for
       (_
        links))))
 
-(define* (latest-html-release package
+(define* (import-html-release package
                               #:key
+                              (version #f)
                               (base-url "https://kernel.org/pub")
                               (directory (string-append "/" package))
                               file->signature)
@@ -538,13 +546,17 @@ are unavailable."
     (match candidates
       (() #f)
       ((first . _)
-       ;; Select the most recent release and return it.
-       (reduce (lambda (r1 r2)
-                 (if (version>? (upstream-source-version r1)
-                                (upstream-source-version r2))
-                     r1 r2))
-               first
-               (coalesce-sources candidates))))))
+       (if version
+           ;; find matching release version and return it
+           (car (filter (lambda (r) (string=? version (upstream-source-version r)))
+                        (coalesce-sources candidates)))
+           ;; Select the most recent release and return it.
+           (reduce (lambda (r1 r2)
+                         (if (version>? (upstream-source-version r1)
+                                        (upstream-source-version r2))
+                             r1 r2))
+                       first
+                       (coalesce-sources candidates)))))))
 
 
 ;;;
@@ -576,46 +588,55 @@ are unavailable."
            (call-with-gzip-input-port port
              (compose string->lines get-string-all))))))
 
-(define (latest-gnu-release package)
+(define* (import-gnu-release package #:key (version #f))
   "Return the latest release of PACKAGE, a GNU package available via
 ftp.gnu.org.
 
 This method does not rely on FTP access at all; instead, it browses the file
 list available from %GNU-FILE-LIST-URI over HTTP(S)."
+
+  (define (find-latest-archive-version archives)
+    (fold (lambda (file1 file2)
+            (if (and file2
+                     (version>? (tarball-sans-extension (basename file2))
+                                (tarball-sans-extension (basename file1))))
+                file2
+                file1))
+          #f
+          archives))
+
   (let-values (((server directory)
                 (ftp-server/directory package))
                ((name)
                 (package-upstream-name package)))
     (let* ((files    (ftp.gnu.org-files))
+           ;; select archives for this package
            (relevant (filter (lambda (file)
                                (and (string-prefix? "/gnu" file)
                                     (string-contains file directory)
                                     (release-file? name (basename file))))
-                             files)))
-      (match (sort relevant (lambda (file1 file2)
-                              (version>? (tarball-sans-extension
-                                          (basename file1))
-                                         (tarball-sans-extension
-                                          (basename file2)))))
-        ((and tarballs (reference _ ...))
-         (let* ((version  (tarball->version reference))
-                (tarballs (filter (lambda (file)
-                                    (string=? (tarball-sans-extension
-                                               (basename file))
-                                              (tarball-sans-extension
-                                               (basename reference))))
-                                  tarballs)))
-           (upstream-source
-            (package name)
-            (version version)
-            (urls (map (lambda (file)
-                         (string-append "mirror://gnu/"
-                                        (string-drop file
-                                                     (string-length "/gnu/"))))
-                       tarballs))
-            (signature-urls (map (cut string-append <> ".sig") urls)))))
-        (()
-         #f)))))
+                             files))
+           ;; find latest version
+           (version (or version
+                        (and (not (null? relevant))
+                             (tarball->version
+                              (find-latest-archive-version relevant)))))
+           ;; find archives matching this version
+           (archives (filter (lambda (file)
+                               (string=? version (tarball->version file)))
+                             relevant)))
+    (match archives
+           (() #f)
+           (_
+            (upstream-source
+             (package name)
+             (version version)
+             (urls (map (lambda (file)
+                          (string-append "mirror://gnu/"
+                                         (string-drop file
+                                                      (string-length "/gnu/"))))
+                        archives))
+             (signature-urls (map (cut string-append <> ".sig") urls))))))))
 
 (define %package-name-rx
   ;; Regexp for a package name, e.g., "foo-X.Y".  Since TeXmacs uses
@@ -668,7 +689,7 @@ GNOME packages; EMMS is included though, because its releases are on gnu.org."
   ;; HTML (unlike <https://download.savannah.nongnu.org/releases>.)
   "https://nongnu.freemirror.org/nongnu")
 
-(define (latest-savannah-release package)
+(define* (import-savannah-release package #:key (version #f))
   "Return the latest release of PACKAGE."
   (let* ((uri       (string->uri
                      (match (origin-uri (package-source package))
@@ -680,7 +701,8 @@ GNOME packages; EMMS is included though, because its releases are on gnu.org."
                                         "mirror://savannah")))
     ;; Note: We use the default 'file->signature', which adds ".sig", ".asc",
     ;; or whichever detached signature naming scheme PACKAGE uses.
-    (and=> (latest-html-release package
+    (and=> (import-html-release package
+                                #:version version
                                 #:base-url %savannah-base
                                 #:directory directory)
            (cut adjusted-upstream-source <> rewrite))))
@@ -744,21 +766,22 @@ GNOME packages; EMMS is included though, because its releases are on gnu.org."
         (when port
           (close-port port))))))
 
-(define (latest-xorg-release package)
+(define* (import-xorg-release package #:key (version #f))
   "Return the latest release of PACKAGE."
   (let ((uri (string->uri (origin-uri (package-source package)))))
     (false-if-ftp-error
-     (latest-ftp-release
+     (import-ftp-release
       (package-name package)
+      #:version version
       #:server "ftp.freedesktop.org"
       #:directory
       (string-append "/pub/xorg/" (dirname (uri-path uri)))))))
 
-(define (latest-kernel.org-release package)
+(define* (import-kernel.org-release package #:key (version #f))
   "Return the latest release of PACKAGE, the name of a kernel.org package."
   (define %kernel.org-base
     ;; This URL and sub-directories thereof are nginx-generated directory
-    ;; listings suitable for 'latest-html-release'.
+    ;; listings suitable for 'import-html-release'.
     "https://mirrors.edge.kernel.org/pub")
 
   (define (file->signature file)
@@ -772,7 +795,8 @@ GNOME packages; EMMS is included though, because its releases are on gnu.org."
          (directory (dirname (uri-path uri)))
          (rewrite   (url-prefix-rewrite %kernel.org-base
                                         "mirror://kernel.org")))
-    (and=> (latest-html-release package
+    (and=> (import-html-release package
+                                #:version version
                                 #:base-url %kernel.org-base
                                 #:directory directory
                                 #:file->signature file->signature)
@@ -801,7 +825,7 @@ GNOME packages; EMMS is included though, because its releases are on gnu.org."
       (or (assoc-ref (package-properties package) 'release-monitoring-url)
           (http-url? package)))))
 
-(define (latest-html-updatable-release package)
+(define* (import-html-updatable-release package #:key (version #f))
   "Return the latest release of PACKAGE.  Do that by crawling the HTML page of
 the directory containing its source tarball."
   (let* ((uri       (string->uri
@@ -817,10 +841,12 @@ the directory containing its source tarball."
                         ""
                         (dirname (uri-path uri))))
          (package   (package-upstream-name package)))
+
     (catch #t
       (lambda ()
         (guard (c ((http-get-error? c) #f))
-          (latest-html-release package
+          (import-html-release package
+                               #:version version
                                #:base-url base
                                #:directory directory)))
       (lambda (key . args)
@@ -838,7 +864,7 @@ the directory containing its source tarball."
    (name 'gnu)
    (description "Updater for GNU packages")
    (pred gnu-hosted?)
-   (import latest-gnu-release)))
+   (import import-gnu-release)))
 
 (define %gnu-ftp-updater
   ;; This is for GNU packages taken from alternate locations, such as
@@ -849,14 +875,14 @@ the directory containing its source tarball."
    (pred (lambda (package)
            (and (not (gnu-hosted? package))
                 (pure-gnu-package? package))))
-   (import latest-release*)))
+   (import import-release*)))
 
 (define %savannah-updater
   (upstream-updater
    (name 'savannah)
    (description "Updater for packages hosted on savannah.gnu.org")
    (pred (url-prefix-predicate "mirror://savannah/"))
-   (import latest-savannah-release)))
+   (import import-savannah-release)))
 
 (define %sourceforge-updater
   (upstream-updater
@@ -870,20 +896,20 @@ the directory containing its source tarball."
    (name 'xorg)
    (description "Updater for X.org packages")
    (pred (url-prefix-predicate "mirror://xorg/"))
-   (import latest-xorg-release)))
+   (import import-xorg-release)))
 
 (define %kernel.org-updater
   (upstream-updater
    (name 'kernel.org)
    (description "Updater for packages hosted on kernel.org")
    (pred (url-prefix-predicate "mirror://kernel.org/"))
-   (import latest-kernel.org-release)))
+   (import import-kernel.org-release)))
 
 (define %generic-html-updater
   (upstream-updater
    (name 'generic-html)
    (description "Updater that crawls HTML pages.")
    (pred html-updatable-package?)
-   (import latest-html-updatable-release)))
+   (import import-html-updatable-release)))
 
 ;;; gnu-maintenance.scm ends here
diff --git a/guix/import/gnu.scm b/guix/import/gnu.scm
index 2b9b71feb0..139c32a545 100644
--- a/guix/import/gnu.scm
+++ b/guix/import/gnu.scm
@@ -117,7 +117,7 @@ details.)"
     (unless package
       (raise (formatted-message (G_ "no GNU package found for ~a") name)))
 
-    (match (latest-release name)
+    (match (import-release name)
       ((? upstream-source? release)
        (let ((version (upstream-source-version release)))
          (gnu-package->sexp package release #:key-download key-download)))
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:05 GMT) Full text and rfc822 format available.

Message #23 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 06/20] refresh: Allow updating to a specific version (crate)
Date: Sun, 28 Aug 2022 15:18:32 +0200
* guix/import/crate.scm(latest-release): Rename to (import-release),
  add keyword-argument 'version'.
  If version is given, return an upstream-source for this version.
---
 guix/import/crate.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 51bfcd7bed..339eccd687 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2019, 2020, 2021 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2019, 2020 Martin Becze <mjbecze <at> riseup.net>
 ;;; Copyright © 2021 Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -354,11 +355,11 @@ look up the development dependencs for the given crate."
 (define crate-package?
   (url-predicate crate-url?))
 
-(define (latest-release package)
+(define* (import-release package #:key (version #f))
   "Return an <upstream-source> for the latest release of PACKAGE."
   (let* ((crate-name (guix-package->crate-name package))
          (crate      (lookup-crate crate-name))
-         (version    (crate-latest-version crate))
+         (version    (or version (crate-latest-version crate)))
          (url        (crate-uri crate-name version)))
     (upstream-source
      (package (package-name package))
@@ -370,5 +371,5 @@ look up the development dependencs for the given crate."
    (name 'crate)
    (description "Updater for crates.io packages")
    (pred crate-package?)
-   (import latest-release)))
+   (import import-release)))
 
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:06 GMT) Full text and rfc822 format available.

Message #26 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 07/20] refresh: Allow updating to a specific version (egg)
Date: Sun, 28 Aug 2022 15:18:33 +0200
* guix/import/egg.scm(latest-release): Rename to (import-release),
  add keyword-argument 'version'.
  If version is given, return an upstream-source for this version.
---
 guix/import/egg.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/guix/import/egg.scm b/guix/import/egg.scm
index aa689f8d84..3897de5acf 100644
--- a/guix/import/egg.scm
+++ b/guix/import/egg.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz>
 ;;; Copyright © 2021 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -333,10 +334,10 @@ not work."
 ;;; Updater.
 ;;;
 
-(define (latest-release package)
+(define* (import-release package #:key (version #f))
   "Return an @code{<upstream-source>} for the latest release of PACKAGE."
   (let* ((egg-name (guix-package->egg-name package))
-         (version (find-latest-version egg-name))
+         (version (or version (find-latest-version egg-name)))
          (source-url (egg-uri egg-name version)))
     (upstream-source
      (package (package-name package))
@@ -348,6 +349,6 @@ not work."
    (name 'egg)
    (description "Updater for CHICKEN egg packages")
    (pred egg-package?)
-   (import latest-release)))
+   (import import-release)))
 
 ;;; egg.scm ends here
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:06 GMT) Full text and rfc822 format available.

Message #29 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 08/20] refresh: Allow updating to a specific version (git)
Date: Sun, 28 Aug 2022 15:18:34 +0200
* guix/import/git.scm
  (latest-tag): Add keyword-argument 'version'. If version is given, try to
  find the respective version tag.
  (latest-git-tag-version): Add keyword-argument 'version' and pass it on to
  called functions.
  (latest-releease) Rename to (import-release), add keyword-argument 'version'
  and pass it on to called functions.
---
 guix/import/git.scm | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/guix/import/git.scm b/guix/import/git.scm
index bb5ba4d97e..fdac51edfd 100644
--- a/guix/import/git.scm
+++ b/guix/import/git.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
 ;;; Copyright © 2022 Maxime Devos <maximedevos <at> telenet.be>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -146,7 +147,8 @@ version corresponding to the tag, and the cdr is the name of the tag."
                            tags)
                entry<?))
 
-(define* (latest-tag url #:key prefix suffix delim pre-releases?)
+(define* (latest-tag url
+                     #:key prefix suffix delim pre-releases? (version #f))
   "Return the latest version and corresponding tag available from the Git
 repository at URL."
   (define (pre-release? tag)
@@ -169,11 +171,18 @@ repository at URL."
      ((null? versions->tags)
       (git-no-valid-tags-error))
      (else
-      (match (last versions->tags)
-        ((version . tag)
-         (values version tag)))))))
-
-(define (latest-git-tag-version package)
+      (let ((version-to-pick
+             (if version
+                 (filter (lambda (vt) (string=? version (car vt)))
+                         versions->tags)
+                 versions->tags)))
+        (if (null? version-to-pick)
+            (values #f #f)
+            (match (last version-to-pick)
+                   ((version . tag)
+                    (values version tag)))))))))
+
+(define* (latest-git-tag-version package #:key (version #f))
   "Given a PACKAGE, return the latest version of it and the corresponding git
 tag, or #false and #false if the latest version could not be determined."
   (guard (c ((or (git-no-tags-error? c) (git-no-valid-tags-error? c))
@@ -193,6 +202,7 @@ tag, or #false and #false if the latest version could not be determined."
            (url (git-reference-url (origin-uri source)))
            (property (cute assq-ref (package-properties package) <>)))
       (latest-tag url
+                  #:version version
                   #:prefix (property 'release-tag-prefix)
                   #:suffix (property 'release-tag-suffix)
                   #:delim (property 'release-tag-version-delimiter)
@@ -206,12 +216,13 @@ tag, or #false and #false if the latest version could not be determined."
           (git-reference? (origin-uri origin))))
     (_ #f)))
 
-(define (latest-git-release package)
+(define* (import-git-release package #:key (version #f))
   "Return an <upstream-source> for the latest release of PACKAGE."
   (let* ((name (package-name package))
          (old-version (package-version package))
          (old-reference (origin-uri (package-source package)))
-         (new-version new-version-tag (latest-git-tag-version package)))
+         (new-version new-version-tag
+                      (latest-git-tag-version package #:version version)))
     (and new-version new-version-tag
          (upstream-source
           (package name)
@@ -226,4 +237,4 @@ tag, or #false and #false if the latest version could not be determined."
    (name 'generic-git)
    (description "Updater for packages hosted on Git repositories")
    (pred git-package?)
-   (import latest-git-release)))
+   (import import-git-release)))
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:06 GMT) Full text and rfc822 format available.

Message #32 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 09/20] refresh: Allow updating to a specific version (github)
Date: Sun, 28 Aug 2022 15:18:35 +0200
* guix/import/github.scm(latest-released-version): Add keyword-argument
  'version'.  If version is given, try to find the respective release.
  (latest-releease) Rename to (import-release), add keyword-argument 'version'
  and pass it on to latest-released-version.
---
 guix/import/github.scm | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/guix/import/github.scm b/guix/import/github.scm
index ac6ef06eda..facdc96e24 100644
--- a/guix/import/github.scm
+++ b/guix/import/github.scm
@@ -249,7 +249,7 @@ Alternatively, you can wait until your rate limit is reset, or use the
                                            #:headers headers)))
                    (x x)))))))))
 
-(define (latest-released-version url package-name)
+(define* (latest-released-version url package-name #:key (version #f))
   "Return the newest released version and its tag given a string URL like
 'https://github.com/arq5x/bedtools2/archive/v2.24.0.tar.gz' and the name of
 the package e.g. 'bedtools2'.  Return #f (two values) if there are no
@@ -290,15 +290,21 @@ releases."
   (match (and=> (fetch-releases-or-tags url) vector->list)
     (#f (values #f #f))
     (json
-     (match (sort (filter-map release->version
-                              (match (remove pre-release? json)
-                                (() json)         ; keep everything
-                                (releases releases)))
-                  (lambda (x y) (version>? (car x) (car y))))
+     (let ((releases (filter-map release->version
+                                 (match (remove pre-release? json)
+                                        (() json)         ; keep everything
+                                        (releases releases)))))
+       (match (if version
+                  ;; find matching release version
+                  (filter (lambda (x) (string=? version (car x)))
+                          releases)
+                  ;; sort releases descending
+                  (sort releases
+                        (lambda (x y) (version>? (car x) (car y)))))
        (((latest-version . tag) . _) (values latest-version tag))
-       (() (values #f #f))))))
+       (() (values #f #f)))))))
 
-(define (latest-release pkg)
+(define* (import-release pkg #:key (version #f))
   "Return an <upstream-source> for the latest release of PKG."
   (define (github-uri uri)
     (match uri
@@ -313,7 +319,8 @@ releases."
          (source-uri (github-uri original-uri))
          (name (package-name pkg))
          (newest-version version-tag
-                         (latest-released-version source-uri name)))
+                         (latest-released-version source-uri name
+                                                  #:version version)))
     (if newest-version
         (upstream-source
          (package name)
@@ -330,6 +337,6 @@ releases."
    (name 'github)
    (description "Updater for GitHub packages")
    (pred github-package?)
-   (import latest-release)))
+   (import import-release)))
 
 
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:07 GMT) Full text and rfc822 format available.

Message #35 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 10/20] refresh: Allow updating to a specific version (gnome)
Date: Sun, 28 Aug 2022 15:18:36 +0200
* guix/import/gnome.scm(latest-gnome-release): Rename
  to (import-gnome-release), add keyword-argument 'version'. If version is
  given, try to find the respective version
  [find-latest-release]: New function, based on former code.
  [find-version-release]: New function.
---
 guix/import/gnome.scm | 47 ++++++++++++++++++++++++++++---------------
 1 file changed, 31 insertions(+), 16 deletions(-)

diff --git a/guix/import/gnome.scm b/guix/import/gnome.scm
index 3562e17e0f..496c253969 100644
--- a/guix/import/gnome.scm
+++ b/guix/import/gnome.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2019, 2021 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,7 +55,7 @@ source for metadata."
                                             name "/" relative-url))))
                         '("tar.lz" "tar.xz" "tar.bz2" "tar.gz")))))))
 
-(define (latest-gnome-release package)
+(define* (import-gnome-release package #:key (version #f))
   "Return the latest release of PACKAGE, a GNOME package, or #f if it could
 not be determined."
   (define %not-dot
@@ -72,6 +73,31 @@ not be determined."
     ;; Some packages like "NetworkManager" have camel-case names.
     (package-upstream-name package))
 
+  (define (find-latest-release releases)
+    (fold (match-lambda*
+           (((key . value) result)
+            (cond ((even-minor-version? key)
+                   (match result
+                          (#f
+                           (cons key value))
+                          ((newest . _)
+                           (if (version>? key newest)
+                               (cons key value)
+                               result))))
+                  (else
+                   result))))
+          #f
+          releases))
+
+  (define (find-version-release releases version)
+    (fold (match-lambda*
+           (((key . value) result)
+            (if (string=? key version)
+                (cons key value)
+                result)))
+          #f
+          releases))
+
   (guard (c ((http-get-error? c)
              (if (= 404 (http-get-error-code c))
                  #f
@@ -92,20 +118,9 @@ not be determined."
       (match json
         (#(4 releases _ ...)
          (let* ((releases (assoc-ref releases upstream-name))
-                (latest   (fold (match-lambda*
-                                  (((key . value) result)
-                                   (cond ((even-minor-version? key)
-                                          (match result
-                                            (#f
-                                             (cons key value))
-                                            ((newest . _)
-                                             (if (version>? key newest)
-                                                 (cons key value)
-                                                 result))))
-                                         (else
-                                          result))))
-                                #f
-                                releases)))
+                (latest (if version
+                            (find-version-release releases version)
+                            (find-latest-release releases))))
            (and latest
                 (jsonish->upstream-source upstream-name latest))))))))
 
@@ -114,4 +129,4 @@ not be determined."
    (name 'gnome)
    (description "Updater for GNOME packages")
    (pred (url-prefix-predicate "mirror://gnome/"))
-   (import latest-gnome-release)))
+   (import import-gnome-release)))
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:07 GMT) Full text and rfc822 format available.

Message #38 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 11/20] refresh: Allow updating to a specific version (hexpm)
Date: Sun, 28 Aug 2022 15:18:37 +0200
* guix/import/hexpm.scm(latest-release): Rename to (import-release),
  add keyword-argument 'version'.
  If version is given, return an upstream-source for this version.
---
 guix/import/hexpm.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/guix/import/hexpm.scm b/guix/import/hexpm.scm
index 3b63837393..652df5dd0e 100644
--- a/guix/import/hexpm.scm
+++ b/guix/import/hexpm.scm
@@ -328,11 +328,11 @@ latest version of PACKAGE-NAME."
 ;;; Updater
 ;;;
 
-(define (latest-release package)
+(define* (import-release package #:key (version #f))
   "Return an <upstream-source> for the latest release of PACKAGE."
   (let* ((hexpm-name (guix-package->hexpm-name package))
          (hexpm      (lookup-hexpm hexpm-name))
-         (version    (hexpm-latest-release hexpm))
+         (version    (or version (hexpm-latest-release hexpm)))
          (url        (hexpm-uri hexpm-name version)))
     (upstream-source
      (package (package-name package))
@@ -344,4 +344,4 @@ latest version of PACKAGE-NAME."
    (name 'hexpm)
    (description "Updater for hex.pm packages")
    (pred (url-prefix-predicate hexpm-package-url))
-   (import latest-release)))
+   (import import-release)))
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:08 GMT) Full text and rfc822 format available.

Message #41 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 12/20] refresh: Allow updating to a specific version (kde)
Date: Sun, 28 Aug 2022 15:18:38 +0200
* guix/import/kde.scm(latest-kde-release): Rename to (import-kde-release), add
  keyword-argument 'version'.  Rework the code to not sort the relevant files,
  but just find the requested or latest version.
  [find-latest-archive-version]: New function.
---
 guix/import/kde.scm | 58 ++++++++++++++++++++++++++-------------------
 1 file changed, 34 insertions(+), 24 deletions(-)

diff --git a/guix/import/kde.scm b/guix/import/kde.scm
index 510d823a4f..d364e44edb 100644
--- a/guix/import/kde.scm
+++ b/guix/import/kde.scm
@@ -28,6 +28,7 @@
   #:use-module (ice-9 match)
   #:use-module (ice-9 rdelim)
   #:use-module (ice-9 regex)
+  #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
   #:use-module (web uri)
 
@@ -149,42 +150,51 @@ Output:
       (string-join (map version->pattern directory-parts) "/")
       "/"))))
 
-(define (latest-kde-release package)
+(define* (import-kde-release package #:key (version #f))
   "Return the latest release of PACKAGE, a KDE package, or #f if it could
 not be determined."
+
+  (define (find-latest-archive-version archives)
+    (fold (lambda (file1 file2)
+            (if (and file2
+                     (version>? (tarball-sans-extension (basename file2))
+                                (tarball-sans-extension (basename file1))))
+                file2
+                file1))
+          #f
+          archives))
+
   (let* ((uri      (string->uri (origin-uri (package-source package))))
          (path-rx  (uri->kde-path-pattern uri))
          (name     (package-upstream-name package))
          (files    (download.kde.org-files))
+         ;; select archives for this package
          (relevant (filter (lambda (file)
                              (and (regexp-exec path-rx file)
                                   (release-file? name (basename file))))
-                           files)))
-    (match (sort relevant (lambda (file1 file2)
-                            (version>? (tarball-sans-extension
-                                        (basename file1))
-                                       (tarball-sans-extension
-                                        (basename file2)))))
-           ((and tarballs (reference _ ...))
-            (let* ((version  (tarball->version reference))
-                   (tarballs (filter (lambda (file)
-                                       (string=? (tarball-sans-extension
-                                                  (basename file))
-                                                 (tarball-sans-extension
-                                                  (basename reference))))
-                                     tarballs)))
-              (upstream-source
-               (package name)
-               (version version)
-               (urls (map (lambda (file)
-                            (string-append "mirror://kde/" file))
-                          tarballs)))))
-           (()
-            #f))))
+                           files))
+         ;; find latest version
+         (version (or version
+                      (and (not (null? relevant))
+                           (tarball->version (find-latest-archive-version relevant)))))
+         ;; find archives matching this version
+         (archives (filter (lambda (file)
+                             (string=? version (tarball->version file)))
+                           relevant)))
+    (match archives
+           (() #f)
+           (_
+            (upstream-source
+             (package name)
+             (version version)
+             (urls (map (lambda (file)
+                          (string-append "mirror://kde/" file))
+                        archives)))))))
+
 
 (define %kde-updater
   (upstream-updater
     (name 'kde)
     (description "Updater for KDE packages")
     (pred (url-prefix-predicate "mirror://kde/"))
-    (import latest-kde-release)))
+    (import import-kde-release)))
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:08 GMT) Full text and rfc822 format available.

Message #44 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 13/20] refresh: Allow updating to a specific version
 (launchpad)
Date: Sun, 28 Aug 2022 15:18:39 +0200
* guix/import/launchpad.scm(latest-release): Rename to (import-release),
  add keyword-argument 'version'.
  If version is given, return an upstream-source for this version.
---
 guix/import/launchpad.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/guix/import/launchpad.scm b/guix/import/launchpad.scm
index b7e0295c4e..2112eefe1d 100644
--- a/guix/import/launchpad.scm
+++ b/guix/import/launchpad.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2019, 2020 Arun Isaac <arunisaac <at> systemreboot.net>
 ;;; Copyright © 2021 Matthew James Kraai <kraai <at> ftbfs.org>
 ;;; Copyright © 2020 Brice Waegeneire <brice <at> waegenei.re>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -121,7 +122,7 @@ for example, 'linuxdcpp'. Return #f if there is no releases."
       (last (remove pre-release? (vector->list (assoc-ref json "entries"))))
       "version"))))
 
-(define (latest-release pkg)
+(define* (import-release pkg #:key (version #f))
   "Return an <upstream-source> for the latest release of PKG."
   (define (origin-launchpad-uri origin)
     (match (origin-uri origin)
@@ -132,7 +133,7 @@ for example, 'linuxdcpp'. Return #f if there is no releases."
   (let* ((source-uri (origin-launchpad-uri (package-source pkg)))
          (name (package-name pkg))
          (repository (launchpad-repository source-uri))
-         (newest-version (latest-released-version repository)))
+         (newest-version (or version (latest-released-version repository))))
     (if newest-version
         (upstream-source
          (package name)
@@ -145,4 +146,4 @@ for example, 'linuxdcpp'. Return #f if there is no releases."
    (name 'launchpad)
    (description "Updater for Launchpad packages")
    (pred launchpad-package?)
-   (import latest-release)))
+   (import import-release)))
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:09 GMT) Full text and rfc822 format available.

Message #47 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 14/20] refresh: Allow updating to a specific version (pypi)
Date: Sun, 28 Aug 2022 15:18:40 +0200
* guix/import/pypi.scm(latest-release): Rename to (import-release),
  add keyword-argument 'version' and pass it on to called functions.
---
 guix/import/pypi.scm | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 3e3e949283..1ab48de71b 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -13,6 +13,7 @@
 ;;; Copyright © 2021 Marius Bakke <marius <at> gnu.org>
 ;;; Copyright © 2022 Vivien Kraus <vivien <at> planete-kraus.eu>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -556,15 +557,15 @@ source.  To build it from source, refer to the upstream repository at
          (string-prefix? "https://pypi.org/packages" url)
          (string-prefix? "https://files.pythonhosted.org/packages" url)))))
 
-(define (latest-release package)
+(define* (import-release package #:key (version #f))
   "Return an <upstream-source> for the latest release of PACKAGE."
   (let* ((pypi-name    (guix-package->pypi-name package))
          (pypi-package (pypi-fetch pypi-name)))
     (and pypi-package
          (guard (c ((missing-source-error? c) #f))
            (let* ((info    (pypi-project-info pypi-package))
-                  (version (project-info-version info))
-                  (dist    (source-release pypi-package))
+                  (version (or version (project-info-version info)))
+                  (dist    (source-release pypi-package version))
                   (url     (distribution-url dist)))
              (upstream-source
               (urls (list url))
@@ -574,7 +575,7 @@ source.  To build it from source, refer to the upstream repository at
                    #f))
               (input-changes
                (changed-inputs package
-                               (pypi->guix-package pypi-name)))
+                               (pypi->guix-package pypi-name #:version version)))
               (package (package-name package))
               (version version)))))))
 
@@ -583,4 +584,4 @@ source.  To build it from source, refer to the upstream repository at
    (name 'pypi)
    (description "Updater for PyPI packages")
    (pred pypi-package?)
-   (import latest-release)))
+   (import import-release)))
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:09 GMT) Full text and rfc822 format available.

Message #50 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 15/20] refresh: Allow updating to a specific version (script)
Date: Sun, 28 Aug 2022 15:18:41 +0200
* guix/scripts/refresh.scm(options->packages)[args-packages]: Handle version
  specification in package name arguments.
  (update-package): Add keyword-argument 'version' and pass it on to called
  functions.
  (guix-refresh): When updating, pass the specified version (if any) to
  update-package.
  [package-list-without-versions, package-list-with-versions]: New functions.
---
 guix/scripts/refresh.scm | 40 +++++++++++++++++++++++++++++-----------
 1 file changed, 29 insertions(+), 11 deletions(-)

diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index 14329751f8..441e71a6e4 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2019 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2020 Simon Tournier <zimon.toutoune <at> gmail.com>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -224,7 +225,8 @@ update would trigger a complete rebuild."
                          (('argument . spec)
                           ;; Take either the specified version or the
                           ;; latest one.
-                          (specification->package spec))
+                          (let* ((name version (package-name->name+version spec)))
+                            (list (specification->package name) version)))
                          (('expression . exp)
                           (read/eval-package-expression exp))
                          (_ #f))
@@ -298,7 +300,7 @@ update would trigger a complete rebuild."
            (G_ "no updater for ~a~%")
            (package-name package)))
 
-(define* (update-package store package updaters
+(define* (update-package store package version updaters
                          #:key (key-download 'interactive) warn?)
   "Update the source file that defines PACKAGE with the new version.
 KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed
@@ -307,7 +309,7 @@ warn about packages that have no matching updater."
   (if (lookup-updater package updaters)
       (let ((version output source
                      (package-update store package updaters
-                                     #:key-download key-download))
+                                     #:key-download key-download #:version version))
             (loc (or (package-field-location package 'version)
                      (package-location package))))
         (when version
@@ -523,6 +525,18 @@ all are dependent packages: ~{~a~^ ~}~%")
       (lists
        (concatenate lists))))
 
+  (define (package-list-without-versions packages)
+    (map (match-lambda
+               ((package version) package)
+               (package package))
+              packages))
+
+  (define (package-list-with-versions packages)
+    (map (match-lambda
+               ((package version) (list package version))
+               (package (list package #f)))
+              packages))
+
   (let* ((opts            (parse-options))
          (update?         (assoc-ref opts 'update?))
          (updaters        (options->updaters opts))
@@ -540,12 +554,13 @@ all are dependent packages: ~{~a~^ ~}~%")
     (with-error-handling
       (with-store store
         (run-with-store store
+          (begin
           (mlet %store-monad ((packages (options->packages opts)))
             (cond
              (list-dependent?
-              (list-dependents packages))
+              (list-dependents (package-list-without-versions packages)))
              (list-transitive?
-              (list-transitive packages))
+              (list-transitive (package-list-without-versions packages)))
              (update?
               (parameterize ((%openpgp-key-server
                               (or (assoc-ref opts 'key-server)
@@ -558,13 +573,16 @@ all are dependent packages: ~{~a~^ ~}~%")
                                   (string-append (config-directory)
                                                  "/upstream/trustedkeys.kbx"))))
                 (for-each
-                 (cut update-package store <> updaters
-                      #:key-download key-download
-                      #:warn? warn?)
-                 packages)
+                 (cut apply
+                      (lambda (package version)
+                        (update-package store package version updaters
+                                        #:key-download key-download
+                                        #:warn? warn?))
+                      <>)
+                 (values (package-list-with-versions packages)))
                 (return #t)))
              (else
               (for-each (cut check-for-package-update <> updaters
                              #:warn? warn?)
-                        packages)
-              (return #t)))))))))
+                        (package-list-without-versions packages))
+              (return #t))))))))))
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:09 GMT) Full text and rfc822 format available.

Message #53 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 16/20] refresh: Allow updating to a specific version (upstream)
Date: Sun, 28 Aug 2022 15:18:42 +0200
* guix/upstream.scm(package-latest-release): Add keyword-argument 'version'
  and pass it on to the updater's 'import' function.
  (package-update): add keyword-argument 'version' and pass it on to
  package-latest-release.  Differentiate the error message issued when
  no package was found, depending on whether version was given or not.
---
 guix/upstream.scm | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/guix/upstream.scm b/guix/upstream.scm
index 6cee6440c3..faffb3347a 100644
--- a/guix/upstream.scm
+++ b/guix/upstream.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2019, 2022 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
 ;;; Copyright © 2021, 2022 Maxime Devos <maximedevos <at> telenet.be>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -277,7 +278,8 @@ them matches."
 
 (define* (package-latest-release package
                                  #:optional
-                                 (updaters (force %updaters)))
+                                 (updaters (force %updaters))
+                                 #:key (version #f))
   "Return an upstream source to update PACKAGE, a <package> object, or #f if
 none of UPDATERS matches PACKAGE.  When several updaters match PACKAGE, try
 them until one of them returns an upstream source.  It is the caller's
@@ -286,7 +288,7 @@ one."
   (any (match-lambda
          (($ <upstream-updater> name description pred import)
           (and (pred package)
-               (import package))))
+               (import package #:version version))))
        updaters))
 
 (define* (package-latest-release* package
@@ -490,13 +492,13 @@ SOURCE, an <upstream-source>."
 
 (define* (package-update store package
                          #:optional (updaters (force %updaters))
-                         #:key (key-download 'interactive))
+                         #:key (key-download 'interactive) (version #f))
   "Return the new version, the file name of the new version tarball, and input
 changes for PACKAGE; return #f (three values) when PACKAGE is up-to-date;
 raise an error when the updater could not determine available releases.
 KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed
 values: 'always', 'never', and 'interactive' (default)."
-  (match (package-latest-release package updaters)
+  (match (package-latest-release package updaters #:version version)
     ((? upstream-source? source)
      (if (version>? (upstream-source-version source)
                     (package-version package))
@@ -520,8 +522,11 @@ this method: ~s")
          (values #f #f #f)))
     (#f
      ;; Warn rather than abort so that other updates can still take place.
-     (warning (G_ "updater failed to determine available releases for ~a~%")
-              (package-name package))
+     (if version
+         (warning (G_ "updater failed to find release ~a@~a~%")
+                  (package-name package) version)
+         (warning (G_ "updater failed to determine available releases for ~a~%")
+                  (package-name package)))
      (values #f #f #f))))
 
 (define* (update-package-source package source hash)
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:10 GMT) Full text and rfc822 format available.

Message #56 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 17/20] refresh: Allow updating to a specific version
 (documentation)
Date: Sun, 28 Aug 2022 15:18:43 +0200
---
 doc/guix.texi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 7bce8a567c..c459fa6d4d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -13747,6 +13747,19 @@ gnu/packages/multiprecision.scm:40:12: 6.1.2 is already the latest version of gm
 
 @end table
 
+If for some reason you don't want to update to the latest version,
+you can update to a specific version by passing a package specification.
+However, not all updaters support this.
+
+@example
+$ guix refresh trytond-party
+gnu/packages/tryton.scm:2101:13: trytond-party would be upgraded from 6.2.0 to 6.4.0
+$ guix refresh -u trytond-party@@6.2.1
+@dots{}
+gnu/packages/tryton.scm:2101:13: trytond-party: updating from version 6.2.0 to version 6.2.1...
+@dots{}
+@end example
+
 Sometimes the upstream name differs from the package name used in Guix,
 and @command{guix refresh} needs a little help.  Most updaters honor the
 @code{upstream-name} property in package definitions, which can be used
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:10 GMT) Full text and rfc822 format available.

Message #59 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 18/20] TEMP REMOVE import: git: Restrict to non-github origins.
Date: Sun, 28 Aug 2022 15:18:44 +0200
This commit will be dropped and not be committed to the main branch!

'guix refresh -t generic-git' reported a lot of packages which are hosted at
github and are already handled by the github updater.  So whether the package
is updates using the github updater or the generic-git updater would be
non-deterministic.

And indeed 'guix refresh --list-updaters' without this change reported 31.2%
for the github updater and 34.9% for the generic-git updater.  With this
patch, it's only 3.7% for the generic-git updater.  (Still the sum of the
percent-values is 112%, anyhow better then the 146% prior to this change.)

Beside these statistical issues, this patch has another effect:  If the github
updater fails to pick a (later) version the generic-git updater was
triggered.  Anyhow: Why should the generic-git updater be able to find
a (later) version, if the github updater did not?

* guix/import/github.scm: Export 'github-package?'.
* guix/import/git.scm(git-package?): Also check for not github-package?.
---
 guix/import/git.scm    | 4 +++-
 guix/import/github.scm | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/guix/import/git.scm b/guix/import/git.scm
index fdac51edfd..02a851655d 100644
--- a/guix/import/git.scm
+++ b/guix/import/git.scm
@@ -25,6 +25,7 @@
   #:use-module (guix git)
   #:use-module (guix git-download)
   #:use-module (guix i18n)
+  #:use-module ((guix import github)  #:select (github-package?))
   #:use-module (guix packages)
   #:use-module (guix upstream)
   #:use-module (guix utils)
@@ -213,7 +214,8 @@ tag, or #false and #false if the latest version could not be determined."
   (match (package-source package)
     ((? origin? origin)
      (and (eq? (origin-method origin) git-fetch)
-          (git-reference? (origin-uri origin))))
+          (git-reference? (origin-uri origin))
+          (not (github-package? package))))
     (_ #f)))
 
 (define* (import-git-release package #:key (version #f))
diff --git a/guix/import/github.scm b/guix/import/github.scm
index facdc96e24..01aa23ba15 100644
--- a/guix/import/github.scm
+++ b/guix/import/github.scm
@@ -42,7 +42,7 @@
   #:use-module (guix http-client)
   #:use-module (web uri)
   #:use-module (web response)
-  #:export (%github-api %github-updater))
+  #:export (%github-api %github-updater github-package?))
 
 ;; For tests.
 (define %github-api (make-parameter "https://api.github.com"))
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:20:11 GMT) Full text and rfc822 format available.

Message #62 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 19/20] TEMP REMOVE upstream: Output names of importers tried.
Date: Sun, 28 Aug 2022 15:18:45 +0200
This commit will be dropped and not be committed to the main branch!
---
 guix/upstream.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/guix/upstream.scm b/guix/upstream.scm
index faffb3347a..4a6b37bbf2 100644
--- a/guix/upstream.scm
+++ b/guix/upstream.scm
@@ -288,6 +288,7 @@ one."
   (any (match-lambda
          (($ <upstream-updater> name description pred import)
           (and (pred package)
+               (display (string-append "trying importer " (symbol->string name) "\n"))
                (import package #:version version))))
        updaters))
 
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:21:02 GMT) Full text and rfc822 format available.

Message #65 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH 20/20] TEMP REMOVE Add test-script for refesh-with-version
Date: Sun, 28 Aug 2022 15:18:46 +0200
This commit will be dropped and not be committed to the main branch!
---
 test-import-with-version.sh | 98 +++++++++++++++++++++++++++++++++++++
 1 file changed, 98 insertions(+)
 create mode 100644 test-import-with-version.sh

diff --git a/test-import-with-version.sh b/test-import-with-version.sh
new file mode 100644
index 0000000000..3aa09dda68
--- /dev/null
+++ b/test-import-with-version.sh
@@ -0,0 +1,98 @@
+echo -n "Number of importers: "
+ls guix/import/*.scm | wc -l
+
+echo -n "Number of updaters : "
+grep upstream-updater guix/import/*.scm | wc -l
+
+echo
+
+PKGS=()
+# chicken see below
+PKGS+=("crate rust-sequoia-openpgp <at> 1.7.0")
+PKGS+=("generic-git remmina <at> 1.4.25") # (import/git)
+PKGS+=("generic-html xclock <at> 1.1.0")  # (gnu-maintenance)
+PKGS+=("github libwacom <at> 1.12")       #
+PKGS+=("gnome gtranslator <at> 41.0")
+PKGS+=("gnu help2man <at> 1.49.1")        # (gnu-maintenance)
+PKGS+=("gnu-ftp libgpg-error <at> 1.43")  # (gnu-maintenance)
+# hexpm see below
+PKGS+=("kde plasma-framework <at> 5.96.0")
+PKGS+=("kernel.org iw <at> 5.3")          # (gnu-maintenance) = html
+PKGS+=("launchpad soundconverter <at> 4.0.0")  # will fail due to changed archive filename
+PKGS+=("pypi trytond-party <at> 6.4.0")
+PKGS+=("savannah libpipeline <at> 1.5.4") # (gnu-maintenance) = html
+PKGS+=("xorg libxi <at> 1.7.99.2")        # (gnu-maintenance) = ftp
+
+
+for pkg in "${PKGS[@]}" ; do
+    echo "------------------------------------------" $pkg
+    pkg=${pkg//* }
+    nv=${pkg%@*}
+    ./pre-inst-env guix refresh $nv
+    ./pre-inst-env guix refresh -u $pkg
+    make make-go 2> /dev/null  # avoid "source file newer" messages
+done
+
+echo
+echo
+echo
+echo "=============================================="
+echo 'For these packages there is no newer version between the current one in guix'
+echo 'and the later one available upstream. Thus we need to "downgrade" the'
+echo 'version first. And to show that I specific version will be fetched, we'
+echo '"refresh" to an older version.'
+echo "---------------------------------------------"
+echo
+
+PKGS=()
+PKGS+=("egg chicken-srfi-13 <at> 0.3")
+PKGS+=("hexpm erlang-relx <at> 4.5.0")
+# HACK
+sed -i -e s/"0\.3\.2"/"0.0.0"/ gnu/packages/chicken.scm
+sed -i -e s/"4\.6\.0"/"0.0.0"/ gnu/packages/erlang.scm
+make make-go 2> /dev/null  # avoid "source file newer" messages
+
+for pkg in "${PKGS[@]}" ; do
+    echo "---------------------------------------------" $pkg
+    pkg=${pkg//* }
+    nv=${pkg%@*}
+    ./pre-inst-env guix refresh -u $pkg
+    ./pre-inst-env guix refresh $nv
+    make make-go 2> /dev/null  # avoid "source file newer" messages
+done
+
+function try_fail () {
+    pkg=$1 ; shift
+    repo=$1 ; shift
+    echo "---------------------------------------------" $repo $pkg
+    echo -- "  shall fail since" $repo $1
+    ./pre-inst-env guix refresh -u $pkg
+    echo
+}
+
+echo
+echo
+echo "=============================================="
+echo 'These updates issue an error when trying to update to a specific version:'
+try_fail r-tximeta <at> 1.5.4  'bioconductor (cran.scm)' 'repo supports latest version only'
+try_fail r-sungeo <at> 0.2.290             'cran'        'repo supports latest version only'
+try_fail perl-socket-msghdr <at> 0.10      'cpan'     'importer does not support version'
+try_fail emacs-vertico-posframe <at> 0.5.9 'elpa'     'importer does not support version'
+try_fail ruby-commander <at> 4.5.0         'gem'      'importer does not support version'
+try_fail ghc-singleton-bool <at> 0.2.3     'hackage'  'importer does not support version'
+try_fail minetest-advtrains <at> 2.5.0     'minetest' 'importer does not support version'
+try_fail ocaml-cudf <at> 0.11              'opam'     'importer does not support version'
+try_fail xplanet <at> 1.4.0 'sourceforge (gnu-maintenance)' 'to complicated to implement'
+
+echo
+echo
+echo "=============================================="
+echo 'These importers do not have an updater:'
+echo -- ' - json  -- n/a'
+echo -- ' - elm  -- has no updater and "elm-package-origin" sources are hosted at github'
+# try_fail elm-http <at> 2.0.0 elm 'has no updater'
+try_fail texlive-sourcecodepro <at> 60101 'texlive' 'has no updater'
+echo
+echo "=============================================="
+echo 'For these importers the  updater is not yet implemented:'
+echo -- ' - stackage  ---  unclear how to handle LTS version'
-- 
2.30.4





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:23:01 GMT) Full text and rfc822 format available.

Message #68 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>, 57460 <at> debbugs.gnu.org
Subject: Re: [bug#57460] [PATCH 04/20] import: sourceforge: Issue
 error-message if version is given.
Date: Sun, 28 Aug 2022 15:22:15 +0200
[Message part 1 (text/plain, inline)]
On 28-08-2022 15:18, Hartmut Goebel wrote:
> Due to the complicated directory structure at sourceforce,
> enabling the  sourceforge importer to update to a specific version
> is very complicated to implement. Since only 2.0% of the
> packages in guix are covered by this updater I dedided to now
> implement this.
Nitpick: now -> not?
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:27:02 GMT) Full text and rfc822 format available.

Message #71 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>, 57460 <at> debbugs.gnu.org
Subject: Re: [bug#57460] [PATCH 15/20] refresh: Allow updating to a specific
 version (script)
Date: Sun, 28 Aug 2022 15:26:06 +0200
[Message part 1 (text/plain, inline)]
On 28-08-2022 15:18, Hartmut Goebel wrote:
> +                          (let* ((name version (package-name->name+version spec)))
> +                            (list (specification->package name) version)))
Nitpick: there is only a single clause, so 'let' would suffice, no need 
for let*.
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 13:31:02 GMT) Full text and rfc822 format available.

Message #74 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>, 57460 <at> debbugs.gnu.org
Subject: Re: [bug#57460] [PATCH 00/19] Refresh to specific version
Date: Sun, 28 Aug 2022 15:30:48 +0200
[Message part 1 (text/plain, inline)]
On 28-08-2022 15:15, Hartmut Goebel wrote:

> This series now implements refreshing packages to a specific version,
> see <https://lists.gnu.org/archive/html/guix-devel/2022-07/msg00061.html>.

I have looked at the patches and they all seem reasonable to me 
(although not verified locally) -- only two nitpicks but they don't 
affect the semantics at all.

Greetings,
Maxime.
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sun, 28 Aug 2022 17:27:02 GMT) Full text and rfc822 format available.

Message #77 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>, 57460 <at> debbugs.gnu.org
Subject: Re: [PATCH 18/20] TEMP REMOVE import: git: Restrict to non-github
 origins.
Date: Sun, 28 Aug 2022 19:26:11 +0200
Am Sonntag, dem 28.08.2022 um 15:18 +0200 schrieb Hartmut Goebel:
> Anyhow: Why should the generic-git updater be able to find
> a (later) version, if the github updater did not?
Because someone at Microsoft could mess up the API in a way that yields
empty results while keeping regular git unchanged.  I think fallbacks
are nice to have, they are already rare enough to find in Guix.

> And indeed 'guix refresh --list-updaters' without this change
> reported 31.2% for the github updater and 34.9% for the generic-git
> updater.  With this patch, it's only 3.7% for the generic-git
> updater.  (Still the sum of the percent-values is 112%, anyhow better
> then the 146% prior to this change.)
Perhaps instead of generating a lazy sum, we should (via an appropriate
option) generate a histogram counting/reporting the packages covered by
0,1,2,... updaters.

Cheers 





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sat, 24 Sep 2022 09:19:01 GMT) Full text and rfc822 format available.

Message #80 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 57460 <at> debbugs.gnu.org
Subject: Re: bug#57460: [PATCH 00/19] Refresh to specific version
Date: Sat, 24 Sep 2022 11:17:52 +0200
Hi,

Hartmut Goebel <h.goebel <at> crazy-compilers.com> skribis:

> * guix/gnu-maintenance.scm
>   (latest-ftp-release): Rename to (import-ftp-release),
>   add keyword-argument 'version'.

Nipick: should be “Rename to 'import-ftp-release' and add #:version
argument.”  (Likewise below.)

> * guix/import/gnu.scm(gnu->guix-package): Adjust function call.
                       ^
Missing space.

> +      (let* ((release  (if version
> +                           (car (filter (lambda (r) (string=? version (upstream-source-version r)))
> +                                        (coalesce-sources releases)))

As you probably know, ‘car’ is frowned upon (info "(guix) Data Types and
Pattern Matching").  Instead, you probably want to write:

  (find (lambda (upstream)
          (string=? (upstream-source-version upstream) version))
        (coalesce-sources releases))

Otherwise LGTM.

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sat, 24 Sep 2022 09:20:02 GMT) Full text and rfc822 format available.

Message #83 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 57460 <at> debbugs.gnu.org
Subject: Re: bug#57460: [PATCH 00/19] Refresh to specific version
Date: Sat, 24 Sep 2022 11:19:49 +0200
For the commit subject line, please use something like:

  import: crate: Allow updates to a specific version.

(When in doubt about the subject prefix, check ‘git log’ on the file.)

Hartmut Goebel <h.goebel <at> crazy-compilers.com> skribis:

> * guix/import/crate.scm(latest-release): Rename to (import-release),
>   add keyword-argument 'version'.

Same comment as before.

Otherwise LGTM.




Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sat, 24 Sep 2022 09:25:02 GMT) Full text and rfc822 format available.

Message #86 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 57460 <at> debbugs.gnu.org
Subject: Re: bug#57460: [PATCH 00/19] Refresh to specific version
Date: Sat, 24 Sep 2022 11:24:37 +0200
Hartmut Goebel <h.goebel <at> crazy-compilers.com> skribis:

> * guix/import/git.scm
>   (latest-tag): Add keyword-argument 'version'. If version is given, try to
>   find the respective version tag.
>   (latest-git-tag-version): Add keyword-argument 'version' and pass it on to
>   called functions.
>   (latest-releease) Rename to (import-release), add keyword-argument 'version'
>   and pass it on to called functions.

(Same comment as before.)

> +(define* (latest-tag url
> +                     #:key prefix suffix delim pre-releases? (version #f))
>    "Return the latest version and corresponding tag available from the Git
>  repository at URL."

Please augment the docstring to explain the meaning of #:version.

> +      (let ((version-to-pick
> +             (if version
> +                 (filter (lambda (vt) (string=? version (car vt)))
> +                         versions->tags)
> +                 versions->tags)))

Rather:

  (let ((versions (if version
                      (filter (match-lambda
                                ((candidate-version . tag)
                                 (string=? version candidate-version)))
                              versions->tag)
                      versions->tag)))
    (if (null? versions) …))

> +            (match (last version-to-pick)
> +                   ((version . tag)
> +                    (values version tag)))))))))

Please adjust the indentation of the ‘match’ form so it matches what is
done elsewhere.

Otherwise LGTM.

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sat, 24 Sep 2022 09:27:02 GMT) Full text and rfc822 format available.

Message #89 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 57460 <at> debbugs.gnu.org
Subject: Re: bug#57460: [PATCH 00/19] Refresh to specific version
Date: Sat, 24 Sep 2022 11:26:19 +0200
Hartmut Goebel <h.goebel <at> crazy-compilers.com> skribis:

> * guix/import/github.scm(latest-released-version): Add keyword-argument
>   'version'.  If version is given, try to find the respective release.
>   (latest-releease) Rename to (import-release), add keyword-argument 'version'
>   and pass it on to latest-released-version.

(Same comment as before.)

> -     (match (sort (filter-map release->version
> -                              (match (remove pre-release? json)
> -                                (() json)         ; keep everything
> -                                (releases releases)))
> -                  (lambda (x y) (version>? (car x) (car y))))
> +     (let ((releases (filter-map release->version
> +                                 (match (remove pre-release? json)
> +                                        (() json)         ; keep everything
> +                                        (releases releases)))))

Please reindent the ‘match’ form as above.

> +       (match (if version
> +                  ;; find matching release version
> +                  (filter (lambda (x) (string=? version (car x)))
> +                          releases)

Same as earlier: prefer ‘match-lambda’ over ‘car’.

Otherwise LGTM.




Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sat, 24 Sep 2022 09:30:02 GMT) Full text and rfc822 format available.

Message #92 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 57460 <at> debbugs.gnu.org
Subject: Re: bug#57460: [PATCH 00/19] Refresh to specific version
Date: Sat, 24 Sep 2022 11:29:24 +0200
Hartmut Goebel <h.goebel <at> crazy-compilers.com> skribis:

> * guix/import/gnome.scm(latest-gnome-release): Rename
>   to (import-gnome-release), add keyword-argument 'version'. If version is
>   given, try to find the respective version
>   [find-latest-release]: New function, based on former code.
>   [find-version-release]: New function.

[...]

> +  (define (find-latest-release releases)
> +    (fold (match-lambda*
> +           (((key . value) result)
> +            (cond ((even-minor-version? key)
> +                   (match result
> +                          (#f
> +                           (cons key value))
> +                          ((newest . _)
> +                           (if (version>? key newest)
> +                               (cons key value)
> +                               result))))

Please reindent ‘match’ as it was.

> +  (define (find-version-release releases version)
> +    (fold (match-lambda*
> +           (((key . value) result)
> +            (if (string=? key version)
> +                (cons key value)
> +                result)))
> +          #f
> +          releases))

I guess we could start at the first match instead of traversing all the
list, no?  How about:

  (define (find-version-release releases version)
    (find (match-lambda
            ((key . value)
             (string=? key version)))
          releases))

?

Otherwise LGTM.




Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sat, 24 Sep 2022 09:36:01 GMT) Full text and rfc822 format available.

Message #95 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 57460 <at> debbugs.gnu.org
Subject: Re: bug#57460: [PATCH 00/19] Refresh to specific version
Date: Sat, 24 Sep 2022 11:34:53 +0200
Hartmut Goebel <h.goebel <at> crazy-compilers.com> skribis:

> * guix/import/kde.scm(latest-kde-release): Rename to (import-kde-release), add
>   keyword-argument 'version'.  Rework the code to not sort the relevant files,
>   but just find the requested or latest version.
>   [find-latest-archive-version]: New function.

(Same comment.)
[...]

> +         ;; find latest version
> +         (version (or version
> +                      (and (not (null? relevant))
> +                           (tarball->version (find-latest-archive-version relevant)))))
> +         ;; find archives matching this version
> +         (archives (filter (lambda (file)
> +                             (string=? version (tarball->version file)))
> +                           relevant)))

I think you can remove the comments or make them proper sentences
(capitalized and with a period).  I’d prefer to keep the name ‘tarballs’
rather than ‘archives’ because it’s less ambiguous IMO.

> +    (match archives
> +           (() #f)
> +           (_

Please reindent it as it was.




Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sat, 24 Sep 2022 09:46:02 GMT) Full text and rfc822 format available.

Message #98 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 57460 <at> debbugs.gnu.org
Subject: Re: bug#57460: [PATCH 00/19] Refresh to specific version
Date: Sat, 24 Sep 2022 11:45:37 +0200
Hartmut Goebel <h.goebel <at> crazy-compilers.com> skribis:

> * guix/scripts/refresh.scm(options->packages)[args-packages]: Handle version
>   specification in package name arguments.
>   (update-package): Add keyword-argument 'version' and pass it on to called
>   functions.
>   (guix-refresh): When updating, pass the specified version (if any) to
>   update-package.
>   [package-list-without-versions, package-list-with-versions]: New functions.

[...]

>                           (('argument . spec)
>                            ;; Take either the specified version or the
>                            ;; latest one.
> -                          (specification->package spec))
> +                          (let* ((name version (package-name->name+version spec)))
> +                            (list (specification->package name) version)))

That changes the semantics of ‘guix refresh’.  Until now, “guix refresh
guile <at> 2.0” or “guix refresh -l guile <at> 2.0” would look specifically at
Guile 2.0.  Now, “guix refresh -l guile <at> 2.0” would report dependents of
Guile 3.0.

So instead of reusing the version string that shows up here, I’d suggest
adding a new command-line option, say -T/--target-version.  The downside
is that it wouldn’t work when multiple packages are specified on the
command line.

Another option would be to introduce special syntax, like an equal sign:

  guix refresh guile=3.0.4
  guix refresh guile <at> 2.0=2.0.8

For that we’d introduce a new ‘specification->package-update’ that would
return a <package-update> record with two fields: the package to
upgrade, and the target version.

WDYT?

> +  (define (package-list-without-versions packages)
> +    (map (match-lambda
> +               ((package version) package)
> +               (package package))
> +              packages))
> +
> +  (define (package-list-with-versions packages)
> +    (map (match-lambda
> +               ((package version) (list package version))
> +               (package (list package #f)))
> +              packages))

I always find it a bad sign when one has to write specific list-fiddling
procedures; usually it indicates we’re missing a record type or
something.

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sat, 24 Sep 2022 09:50:02 GMT) Full text and rfc822 format available.

Message #101 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 57460 <at> debbugs.gnu.org, Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#57460: [PATCH 00/19] Refresh to specific version
Date: Sat, 24 Sep 2022 11:48:52 +0200
Hi!

Maxime Devos <maximedevos <at> telenet.be> skribis:

> On 28-08-2022 15:15, Hartmut Goebel wrote:
>
>> This series now implements refreshing packages to a specific version,
>> see <https://lists.gnu.org/archive/html/guix-devel/2022-07/msg00061.html>.
>
> I have looked at the patches and they all seem reasonable to me
> (although not verified locally) -- only two nitpicks but they don't
> affect the semantics at all.

I had some further comments as you saw, but most of them are cosmetic.
:-)  I think this patch series is a much welcome improvement, and it’s
almost ready.

The one thing that needs to be sorted out is the version syntax in ‘guix
refresh’, but it sounds like we should be able to do that without too
much difficulty.

Apologies for the delay in reviewing, and thanks for this work!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sat, 24 Sep 2022 10:26:02 GMT) Full text and rfc822 format available.

Message #104 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Ludovic Courtès <ludo <at> gnu.org>,
 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 57460 <at> debbugs.gnu.org
Subject: Re: [bug#57460] [PATCH 00/19] Refresh to specific version
Date: Sat, 24 Sep 2022 12:25:28 +0200
[Message part 1 (text/plain, inline)]

On 24-09-2022 11:29, Ludovic Courtès wrote:
> Hartmut Goebel <h.goebel <at> crazy-compilers.com> skribis:
> 
>> * guix/import/gnome.scm(latest-gnome-release): Rename
>>    to (import-gnome-release), add keyword-argument 'version'. If version is
>>    given, try to find the respective version
>>    [find-latest-release]: New function, based on former code.
>>    [find-version-release]: New function.
> 
> [...]
> 
>> +  (define (find-latest-release releases)
>> +    (fold (match-lambda*
>> +           (((key . value) result)
>> +            (cond ((even-minor-version? key)
>> +                   (match result
>> +                          (#f
>> +                           (cons key value))
>> +                          ((newest . _)
>> +                           (if (version>? key newest)
>> +                               (cons key value)
>> +                               result))))
> 
> Please reindent ‘match’ as it was.

"guix style" is IMO not usable here 
(<https://issues.guix.gnu.org/58040>: "guix style" puts closing 
parentheses on the wrong line").

>> +  (define (find-version-release releases version)
>> +    (fold (match-lambda*
>> +           (((key . value) result)
>> +            (if (string=? key version)
>> +                (cons key value)
>> +                result)))
>> +          #f
>> +          releases))
> 
> I guess we could start at the first match instead of traversing all the
> list, no?  How about:
> 
>    (define (find-version-release releases version)
>      (find (match-lambda
>              ((key . value)
>               (string=? key version)))
>            releases))
> 
> ?

(1) according to "guix style", this should be

(define (find-version-release releases version)
  (find (match-lambda
          ((key . value) (string=? key version))) releases))


(2)  Isn't this an inline definition of 'assoc' (except for replacing 
equal? by string=?)?

(use-modules (srfi srfi-1)) ; the third argument is only documented in 
SRFI-1 Asosciation Lists
(define (find-version-release releases version)
  (assoc version releases string=?)

Some code duplication can be avoided here.

Greetings,
Maxime.
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Sat, 24 Sep 2022 16:32:02 GMT) Full text and rfc822 format available.

Message #107 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: Hartmut Goebel <h.goebel <at> crazy-compilers.com>, 57460 <at> debbugs.gnu.org
Subject: Re: [bug#57460] [PATCH 00/19] Refresh to specific version
Date: Sat, 24 Sep 2022 18:31:24 +0200
Maxime Devos <maximedevos <at> telenet.be> skribis:

> "guix style" is IMO not usable here
> (<https://issues.guix.gnu.org/58040>: "guix style" puts closing
> parentheses on the wrong line").

‘guix style’ has shortcomings, which is why I didn’t mention it.
Initially it had a much narrower scope though.  :-)

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 01 Nov 2022 15:59:01 GMT) Full text and rfc822 format available.

Message #110 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 57460 <at> debbugs.gnu.org
Subject: Re: bug#57460: [PATCH 00/19] Refresh to specific version
Date: Tue, 1 Nov 2022 16:58:37 +0100
[Message part 1 (text/plain, inline)]
Hi Ludo,

attached please find a new patch addressing this and implementing a 
record time. (Thanks for the tip, this makes the code muche easier.)

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel <at> crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |
[v2-0015-refresh-Allow-updating-to-a-specific-version.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 01 Nov 2022 16:03:02 GMT) Full text and rfc822 format available.

Message #113 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 57460 <at> debbugs.gnu.org, Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#57460: [PATCH 00/19] Refresh to specific version
Date: Tue, 1 Nov 2022 17:02:38 +0100
Am 24.09.22 um 11:48 schrieb Ludovic Courtès:
> The one thing that needs to be sorted out is the version syntax in ‘guix
> refresh’, but it sounds like we should be able to do that without too
> much difficulty.

I addresses this and just submitted an updated version (of this change 
only).

Although I'd prefer '==' two equal-signs instead of just one to be 
future-proof for the case we want to add other specifiers ('<', '<=', 
'>=', >')

> Apologies for the delay in reviewing, and thanks for this work!

Never mind, I was busy anyway ;-)

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel <at> crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 22 Nov 2022 07:34:01 GMT) Full text and rfc822 format available.

Message #116 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 57460 <at> debbugs.gnu.org
Subject: Re: bug#57460: [PATCH 00/19] Refresh to specific version
Date: Tue, 22 Nov 2022 08:33:38 +0100
Hi Hartmut

Hartmut Goebel <h.goebel <at> crazy-compilers.com> skribis:

> From c748a25193d8f9ee29b9d281f542fb1d0d3f4ec1 Mon Sep 17 00:00:00 2001
> Message-Id: <c748a25193d8f9ee29b9d281f542fb1d0d3f4ec1.1667318125.git.h.goebel <at> crazy-compilers.com>
> From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
> Date: Fri, 24 Jun 2022 20:40:57 +0200
> Subject: [PATCH v2] refresh: Allow updating to a specific version.
>
> * guix/scripts/refresh.scm (options->packages)[args-packages]: Handle version
>   specification in package name arguments.
>   (update-package): Add #:version argument and pass it on to called functions.
>   (guix-refresh): When updating, pass the specified version (if any) to
>   update-package.
>   [package-list-without-versions, package-list-with-versions]: New functions.

Thanks for this updated patch!


[...]

> -(define (options->packages opts)
> +(define (options->package-specs opts)
>    "Return the list of packages requested by OPTS, honoring options like
>  '--recursive'."

In Guix, “package spec” refers to the syntax that
‘specification->package’ accepts, like “guile” or “guile <at> 2.2”.  So we’ll
have to use another name throughout.  How about “update spec” or
“refresh spec” for the string, and just “update” for the record?

> +(define-record-type* <package-spec> package-spec make-package-spec
> +  package-spec?
> +  (package   package-spec-package) ; package
> +  (target    package-spec-target)) ; target version

Since there are just two fields, it may be simpler to use SRFI-9:

  (define-record-type <update>
    (update package version)
    update?
    (package update-package)
    (version update-version))

Thanks,
Ludo’.




Added tag(s) moreinfo. Request was from Christopher Baines <mail <at> cbaines.net> to control <at> debbugs.gnu.org. (Wed, 23 Nov 2022 09:12:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:35:02 GMT) Full text and rfc822 format available.

Message #121 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Cc: Ludovic Courtes <ludo <at> gnu.org>
Subject: [PATCH v3 00/18] Refresh to specific version
Date: Tue, 20 Dec 2022 10:34:21 +0100
Hi Ludo,

I now at last found time for updating the patch series. Following is the
complete series as I would push it.

> In Guix, “package spec” refers to the syntax that
> ‘specification->package’ accepts, like “guile” or “guile <at> 2.2”.  So we’ll
> have to use another name throughout.  How about “update spec” or
> “refresh spec” for the string, and just “update” for the record?

Using "update" resulted in a conflict with the existing "update-package"
function. Using "refesh" would have names the accessor "refresh-package",
which sounds irritating for me (same for "update". Thus I decided to call the
record "update-spec" and the function "update-string->update.spec" (the name
is use only once).

WDYT?

> Since there are just two fields, it may be simpler to use SRFI-9:

Done.

I also tested the patches with (an updated version of) the test-script I
posted in the first version of the series.


Hartmut Goebel (18):
  upstream-updater: Rename record field.
  import: cpan: Remove unused exports.
  import: Issue error-message if version is given.
  import: sourceforge: Issue error-message if version is given.
  gnu-maintenance: Allow updating to a specific version.
  import: crate: Allow updating to a specific version.
  import: egg: Allow updating to a specific version.
  import: gem: Allow updating to a specific version.
  import: git: Allow updating to a specific version.
  import: github: Allow updating to a specific version.
  import: gnome: Allow updating to a specific version.
  import: hexpm: Allow updating to a specific version.
  import: kde: Allow updating to a specific version.
  import: launchpad: Allow updating to a specific version.
  import: pypi: Allow updating to a specific version.
  refresh: Allow updating to a specific version.
  upstream: Allow updating to a specific version.
  doc: Describe how to update to a specific version.

 doc/guix.texi             |  19 ++++
 guix/gnu-maintenance.scm  | 183 ++++++++++++++++++++++++--------------
 guix/import/cpan.scm      |  32 +++----
 guix/import/cran.scm      |  23 +++--
 guix/import/crate.scm     |  10 ++-
 guix/import/egg.scm       |  10 ++-
 guix/import/elpa.scm      |  11 ++-
 guix/import/gem.scm       |   7 +-
 guix/import/git.scm       |  39 +++++---
 guix/import/github.scm    |  36 +++++---
 guix/import/gnome.scm     |  47 ++++++----
 guix/import/gnu.scm       |   2 +-
 guix/import/hackage.scm   |  12 ++-
 guix/import/hexpm.scm     |   9 +-
 guix/import/kde.scm       |  61 +++++++------
 guix/import/launchpad.scm |  10 ++-
 guix/import/minetest.scm  |  12 ++-
 guix/import/opam.scm      |  11 ++-
 guix/import/pypi.scm      |  14 +--
 guix/import/stackage.scm  |  10 ++-
 guix/scripts/refresh.scm  |  49 +++++++---
 guix/upstream.scm         |  25 +++---
 tests/import-github.scm   |   2 +-
 tests/transformations.scm |   8 +-
 24 files changed, 416 insertions(+), 226 deletions(-)


base-commit: d241517d2cadac3122301b6260c0dfc9f3b383d6
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:35:03 GMT) Full text and rfc822 format available.

Message #124 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 01/18] upstream-updater: Rename record field.
Date: Tue, 20 Dec 2022 10:34:06 +0100
The next commits will make the functions, which are currently importing the
latest version of a package, change into importing the latest or a given
version of the package (for those updaters supporting specifying a version).
Thus the name ‘latest‘ is no longer appropriate.

* guix/upstream.scm (upstream-updater) Rename field [latest] to
  [import]. (lookup-updater, package-latest-release) Adjust fieldname
  accordingly.
* guix/gnu-maintenance.scm (%gnu-updater, %gnu-ftp-updater,
  %savannah-updater, %sourceforge-updater, %xorg-updater,
  %kernel.org-updater, %generic-html-updater),
  guix/import/cpan.scm (%cpan-updater),
  guix/import/cran.scm (%cran-updater, %bioconductor-updater),
  guix/import/crate.scm (%crate-updater),
  guix/import/egg.scm (%egg-updater),
  guix/import/elpa.scm (%elpa-updater),
  guix/import/gem.scm (%gem-updater),
  guix/import/git.scm (%generic-git-updater),
  guix/import/github.scm (%github-updater),
  guix/import/gnome.scm (%gnome-updater),
  guix/import/hackage.scm (%hackage-updater),
  guix/import/hexpm.scm (%hexpm-updater),
  guix/import/kde.scm (%kde-updater),
  guix/import/launchpad.scm (%launchpad-updater),
  guix/import/minetest.scm (%minetest-updater),
  guix/import/opam.scm (%opam-updater),
  guix/import/pypi.scm (%pypi-updater),
  guix/import/stackage.scm (%stackage-updater),
  tests/import-github.scm (found-sexp)
  tests/transformations.scm ("options->transformation, with-latest"):
  Adjust fieldname accordingly.
---
 guix/gnu-maintenance.scm  | 14 +++++++-------
 guix/import/cpan.scm      |  2 +-
 guix/import/cran.scm      |  4 ++--
 guix/import/crate.scm     |  2 +-
 guix/import/egg.scm       |  2 +-
 guix/import/elpa.scm      |  2 +-
 guix/import/gem.scm       |  2 +-
 guix/import/git.scm       |  2 +-
 guix/import/github.scm    |  2 +-
 guix/import/gnome.scm     |  2 +-
 guix/import/hackage.scm   |  2 +-
 guix/import/hexpm.scm     |  2 +-
 guix/import/kde.scm       |  2 +-
 guix/import/launchpad.scm |  2 +-
 guix/import/minetest.scm  |  2 +-
 guix/import/opam.scm      |  2 +-
 guix/import/pypi.scm      |  2 +-
 guix/import/stackage.scm  |  2 +-
 guix/upstream.scm         | 10 +++++-----
 tests/import-github.scm   |  2 +-
 tests/transformations.scm |  8 ++++----
 21 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 2881a6be43..3067ee18b3 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -848,7 +848,7 @@ the directory containing its source tarball."
    (name 'gnu)
    (description "Updater for GNU packages")
    (pred gnu-hosted?)
-   (latest latest-gnu-release)))
+   (import latest-gnu-release)))
 
 (define %gnu-ftp-updater
   ;; This is for GNU packages taken from alternate locations, such as
@@ -859,41 +859,41 @@ the directory containing its source tarball."
    (pred (lambda (package)
            (and (not (gnu-hosted? package))
                 (pure-gnu-package? package))))
-   (latest latest-release*)))
+   (import latest-release*)))
 
 (define %savannah-updater
   (upstream-updater
    (name 'savannah)
    (description "Updater for packages hosted on savannah.gnu.org")
    (pred (url-prefix-predicate "mirror://savannah/"))
-   (latest latest-savannah-release)))
+   (import latest-savannah-release)))
 
 (define %sourceforge-updater
   (upstream-updater
    (name 'sourceforge)
    (description "Updater for packages hosted on sourceforge.net")
    (pred (url-prefix-predicate "mirror://sourceforge/"))
-   (latest latest-sourceforge-release)))
+   (import latest-sourceforge-release)))
 
 (define %xorg-updater
   (upstream-updater
    (name 'xorg)
    (description "Updater for X.org packages")
    (pred (url-prefix-predicate "mirror://xorg/"))
-   (latest latest-xorg-release)))
+   (import latest-xorg-release)))
 
 (define %kernel.org-updater
   (upstream-updater
    (name 'kernel.org)
    (description "Updater for packages hosted on kernel.org")
    (pred (url-prefix-predicate "mirror://kernel.org/"))
-   (latest latest-kernel.org-release)))
+   (import latest-kernel.org-release)))
 
 (define %generic-html-updater
   (upstream-updater
    (name 'generic-html)
    (description "Updater that crawls HTML pages.")
    (pred html-updatable-package?)
-   (latest latest-html-updatable-release)))
+   (import latest-html-updatable-release)))
 
 ;;; gnu-maintenance.scm ends here
diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
index 87abe9c2f1..cb2d3dd410 100644
--- a/guix/import/cpan.scm
+++ b/guix/import/cpan.scm
@@ -358,4 +358,4 @@ in RELEASE, a <cpan-release> record."
    (name 'cpan)
    (description "Updater for CPAN packages")
    (pred cpan-package?)
-   (latest latest-release)))
+   (import latest-release)))
diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index 48fbc1dccb..473d8c4f5b 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -776,13 +776,13 @@ s-expression corresponding to that package, or #f on failure."
    (name 'cran)
    (description "Updater for CRAN packages")
    (pred cran-package?)
-   (latest latest-cran-release)))
+   (import latest-cran-release)))
 
 (define %bioconductor-updater
   (upstream-updater
    (name 'bioconductor)
    (description "Updater for Bioconductor packages")
    (pred bioconductor-package?)
-   (latest latest-bioconductor-release)))
+   (import latest-bioconductor-release)))
 
 ;;; cran.scm ends here
diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index c76d7e9c1a..51bfcd7bed 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -370,5 +370,5 @@ look up the development dependencs for the given crate."
    (name 'crate)
    (description "Updater for crates.io packages")
    (pred crate-package?)
-   (latest latest-release)))
+   (import latest-release)))
 
diff --git a/guix/import/egg.scm b/guix/import/egg.scm
index 0d6d72c465..2ad48c3399 100644
--- a/guix/import/egg.scm
+++ b/guix/import/egg.scm
@@ -348,6 +348,6 @@ not work."
    (name 'egg)
    (description "Updater for CHICKEN egg packages")
    (pred egg-package?)
-   (latest latest-release)))
+   (import latest-release)))
 
 ;;; egg.scm ends here
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 9399f45ebc..1dbdff9391 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -444,7 +444,7 @@ type '<elpa-package>'."
    (name 'elpa)
    (description "Updater for ELPA packages")
    (pred package-from-elpa-repository?)
-   (latest latest-release)))
+   (import latest-release)))
 
 (define elpa-guix-name (cut guix-name "emacs-" <>))
 
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index ad1343bff4..1c6c55baa6 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -189,7 +189,7 @@ package on RubyGems."
    (name 'gem)
    (description "Updater for RubyGem packages")
    (pred gem-package?)
-   (latest latest-release)))
+   (import latest-release)))
 
 (define* (gem-recursive-import package-name #:optional version)
   (recursive-import package-name
diff --git a/guix/import/git.scm b/guix/import/git.scm
index 4cf404677c..bb5ba4d97e 100644
--- a/guix/import/git.scm
+++ b/guix/import/git.scm
@@ -226,4 +226,4 @@ tag, or #false and #false if the latest version could not be determined."
    (name 'generic-git)
    (description "Updater for packages hosted on Git repositories")
    (pred git-package?)
-   (latest latest-git-release)))
+   (import latest-git-release)))
diff --git a/guix/import/github.scm b/guix/import/github.scm
index e1a1af7133..ac6ef06eda 100644
--- a/guix/import/github.scm
+++ b/guix/import/github.scm
@@ -330,6 +330,6 @@ releases."
    (name 'github)
    (description "Updater for GitHub packages")
    (pred github-package?)
-   (latest latest-release)))
+   (import latest-release)))
 
 
diff --git a/guix/import/gnome.scm b/guix/import/gnome.scm
index 9d8cd8ec76..09c6dbbd0d 100644
--- a/guix/import/gnome.scm
+++ b/guix/import/gnome.scm
@@ -130,4 +130,4 @@ https://discourse.gnome.org/t/new-gnome-versioning-scheme/4235"
    (name 'gnome)
    (description "Updater for GNOME packages")
    (pred (url-prefix-predicate "mirror://gnome/"))
-   (latest latest-gnome-release)))
+   (import latest-gnome-release)))
diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm
index 878a7d2f9c..d56f52a221 100644
--- a/guix/import/hackage.scm
+++ b/guix/import/hackage.scm
@@ -381,6 +381,6 @@ respectively."
    (name 'hackage)
    (description "Updater for Hackage packages")
    (pred hackage-package?)
-   (latest latest-release)))
+   (import latest-release)))
 
 ;;; cabal.scm ends here
diff --git a/guix/import/hexpm.scm b/guix/import/hexpm.scm
index 2a7a9f3d82..3b63837393 100644
--- a/guix/import/hexpm.scm
+++ b/guix/import/hexpm.scm
@@ -344,4 +344,4 @@ latest version of PACKAGE-NAME."
    (name 'hexpm)
    (description "Updater for hex.pm packages")
    (pred (url-prefix-predicate hexpm-package-url))
-   (latest latest-release)))
+   (import latest-release)))
diff --git a/guix/import/kde.scm b/guix/import/kde.scm
index 6873418d62..510d823a4f 100644
--- a/guix/import/kde.scm
+++ b/guix/import/kde.scm
@@ -187,4 +187,4 @@ not be determined."
     (name 'kde)
     (description "Updater for KDE packages")
     (pred (url-prefix-predicate "mirror://kde/"))
-    (latest latest-kde-release)))
+    (import latest-kde-release)))
diff --git a/guix/import/launchpad.scm b/guix/import/launchpad.scm
index aeb447b0a5..b7e0295c4e 100644
--- a/guix/import/launchpad.scm
+++ b/guix/import/launchpad.scm
@@ -145,4 +145,4 @@ for example, 'linuxdcpp'. Return #f if there is no releases."
    (name 'launchpad)
    (description "Updater for Launchpad packages")
    (pred launchpad-package?)
-   (latest latest-release)))
+   (import latest-release)))
diff --git a/guix/import/minetest.scm b/guix/import/minetest.scm
index 43cfb533e2..6581013215 100644
--- a/guix/import/minetest.scm
+++ b/guix/import/minetest.scm
@@ -513,4 +513,4 @@ or #false if the latest release couldn't be determined."
     (name 'minetest)
     (description "Updater for Minetest packages on ContentDB")
     (pred minetest-package?)
-    (latest latest-minetest-release)))
+    (import latest-minetest-release)))
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index b4b5a6eaad..8a5aa4d8c6 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -435,4 +435,4 @@ package in OPAM."
     (name 'opam)
     (description "Updater for OPAM packages")
     (pred opam-package?)
-    (latest latest-release)))
+    (import latest-release)))
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 4760fc3dae..3e3e949283 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -583,4 +583,4 @@ source.  To build it from source, refer to the upstream repository at
    (name 'pypi)
    (description "Updater for PyPI packages")
    (pred pypi-package?)
-   (latest latest-release)))
+   (import latest-release)))
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm
index 49be982a7f..af9809304f 100644
--- a/guix/import/stackage.scm
+++ b/guix/import/stackage.scm
@@ -175,6 +175,6 @@ PACKAGE or #f if the package is not included in the Stackage LTS release."
    (name 'stackage)
    (description "Updater for Stackage LTS packages")
    (pred stackage-lts-package?)
-   (latest latest-lts-release)))
+   (import latest-lts-release)))
 
 ;;; stackage.scm ends here
diff --git a/guix/upstream.scm b/guix/upstream.scm
index 32736940aa..3b576898ec 100644
--- a/guix/upstream.scm
+++ b/guix/upstream.scm
@@ -66,7 +66,7 @@
             upstream-updater-name
             upstream-updater-description
             upstream-updater-predicate
-            upstream-updater-latest
+            upstream-updater-import
 
             upstream-input-change?
             upstream-input-change-name
@@ -241,7 +241,7 @@ correspond to the same version."
   (name        upstream-updater-name)
   (description upstream-updater-description)
   (pred        upstream-updater-predicate)
-  (latest      upstream-updater-latest))
+  (import      upstream-updater-import))
 
 (define (importer-modules)
   "Return the list of importer modules."
@@ -272,7 +272,7 @@ correspond to the same version."
   "Return an updater among UPDATERS that matches PACKAGE, or #f if none of
 them matches."
   (find (match-lambda
-          (($ <upstream-updater> name description pred latest)
+          (($ <upstream-updater> name description pred import)
            (pred package)))
         updaters))
 
@@ -285,9 +285,9 @@ them until one of them returns an upstream source.  It is the caller's
 responsibility to ensure that the returned source is newer than the current
 one."
   (any (match-lambda
-         (($ <upstream-updater> name description pred latest)
+         (($ <upstream-updater> name description pred import)
           (and (pred package)
-               (latest package))))
+               (import package))))
        updaters))
 
 (define* (package-latest-release* package
diff --git a/tests/import-github.scm b/tests/import-github.scm
index 4d3f8cfc7e..5100296540 100644
--- a/tests/import-github.scm
+++ b/tests/import-github.scm
@@ -92,7 +92,7 @@
 (define* (found-sexp old-version old-commit tags releases)
   (and=>
    (call-with-releases (lambda ()
-                         ((upstream-updater-latest %github-updater)
+                         ((upstream-updater-import %github-updater)
                           (example-package old-version old-commit)))
                        tags releases)
    upstream-source->sexp))
diff --git a/tests/transformations.scm b/tests/transformations.scm
index 47b1fc650d..5c136e1d48 100644
--- a/tests/transformations.scm
+++ b/tests/transformations.scm
@@ -488,10 +488,10 @@
                        (name 'dummy)
                        (pred (const #t))
                        (description "")
-                       (latest (const (upstream-source
-                                       (package "foo")
-                                       (version "42.0")
-                                       (urls '("http://example.org")))))))))
+                       (import (const (upstream-source
+                                         (package "foo")
+                                         (version "42.0")
+                                         (urls '("http://example.org")))))))))
         (let* ((p (dummy-package "foo" (version "1.0")))
                (t (options->transformation
                    `((with-latest . "foo")))))
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:35:04 GMT) Full text and rfc822 format available.

Message #127 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 03/18] import: Issue error-message if version is given.
Date: Tue, 20 Dec 2022 10:34:08 +0100
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. <version>: rename to <latest-version>.
* 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 <alex <at> pompo.co>
 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2020, 2021 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> 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 473d8c4f5b..1ed3580315 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2020 Martin Becze <mjbecze <at> riseup.net>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; 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 <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))
@@ -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 <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 <at> yoctocell.xyz>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> 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/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 <at> yoctocell.xyz>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
 ;;; Copyright © 2019 Simon Tournier <zimon.toutoune <at> gmail.com>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> 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 <at> telenet.be>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> 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 <at> yoctocell.xyz>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
 ;;; Copyright © 2021, 2022 Alice Brenon <alice.brenon <at> ens-lyon.fr>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> 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 <at> riseup.net>
 ;;; Copyright © 2021 Xinglu Chem <public <at> yoctocell.xyz>
 ;;; Copyright © 2021 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> 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.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:35:04 GMT) Full text and rfc822 format available.

Message #130 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 04/18] import: sourceforge: Issue error-message if version
 is given.
Date: Tue, 20 Dec 2022 10:34:09 +0100
Due to the complicated directory structure at sourceforce,
enabling the  sourceforge importer to update to a specific version
is very complicated to implement. Since only 2.0% of the
packages in guix are covered by this updater I dedided to not
implement this.

* guix/gnu-maintenance.scm (latest-sourceforge-release): Add #:version
  argument.  Issue error-message if version is given.
---
 guix/gnu-maintenance.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 3067ee18b3..e414de8e28 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -37,6 +37,8 @@
   #:autoload   (guix download) (%mirrors)
   #:use-module (guix ftp-client)
   #:use-module (guix utils)
+  #:use-module (guix diagnostics)
+  #:use-module (guix i18n)
   #:use-module (guix memoization)
   #:use-module (guix records)
   #:use-module (guix upstream)
@@ -705,7 +707,7 @@ GNOME packages; EMMS is included though, because its releases are on gnu.org."
                          #:base-url %savannah-base
                          #:directory directory)))
 
-(define (latest-sourceforge-release package)
+(define* (latest-sourceforge-release package #:key (version #f))
   "Return the latest release of PACKAGE."
   (define (uri-append uri extension)
     ;; Return URI with EXTENSION appended.
@@ -720,6 +722,12 @@ GNOME packages; EMMS is included though, because its releases are on gnu.org."
        ((200 302) #t)
        (else #f))))
 
+  (when version
+    (error
+     (formatted-message
+      (G_ "Updating to a specific version is not yet implemented for ~a, sorry.")
+      "sourceforge")))
+
   (let* ((name     (package-upstream-name package))
          (base     (string-append "https://sourceforge.net/projects/"
                                   name "/files"))
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:35:05 GMT) Full text and rfc822 format available.

Message #133 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 02/18] import: cpan: Remove unused exports.
Date: Tue, 20 Dec 2022 10:34:07 +0100
* guix/import/cpan.scm (#:export): Remove unused exports.
---
 guix/import/cpan.scm | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
index cb2d3dd410..a929dc62e3 100644
--- a/guix/import/cpan.scm
+++ b/guix/import/cpan.scm
@@ -39,26 +39,7 @@
   #:use-module (guix packages)
   #:use-module (guix upstream)
   #:use-module (guix derivations)
-  #:export (cpan-dependency?
-            cpan-dependency-relationship
-            cpan-dependency-phase
-            cpan-dependency-module
-            cpan-dependency-version
-
-            cpan-release?
-            cpan-release-license
-            cpan-release-author
-            cpan-release-version
-            cpan-release-module
-            cpan-release-distribution
-            cpan-release-download-url
-            cpan-release-abstract
-            cpan-release-home-page
-            cpan-release-dependencies
-            json->cpan-release
-
-            cpan-fetch
-            cpan->guix-package
+  #:export (cpan->guix-package
             metacpan-url->mirror-url
             %cpan-updater
 
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:35:05 GMT) Full text and rfc822 format available.

Message #136 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 05/18] gnu-maintenance: Allow updating to a specific
 version.
Date: Tue, 20 Dec 2022 10:34:10 +0100
* guix/gnu-maintenance.scm
  (latest-ftp-release): Rename to … (import-ftp-release) … this,
  add #:version argument.
  If version is given, try to find the respective version.
  (latest-html-release): Rename to … (import-html-release) … this,
  add #:version argument.
  If version is given, try to find the respective version.
  (latest-gnu-release): Rename to … (import-gnu-release) … this,
  add #:version argument. Refactor to first select archives for
  respective package, the find the requested or latest version, then create
  the upstream-source.
  (latest-release): Rename to … (import-release) … this,
  add #:version argument, pass on to … (import-ftp-release) … this.
  (import-release*): Rename to … (import-release*) … this,
  add #:version argument, pass on to … (latest-release) … this.
  (latest-savannah-release): Rename to … (import-savannah-release) … this,
  add keword-argument version, pass on to … (import-html-release) … this.
  (latest-xorg-release): Rename to … (import-xorg-release) … this,
  add keword-argument version, pass on to … (import-ftp-release) … this.
  (latest-kernel.org-release): Rename to … (import-kernel.org-release) … this,
  add #:version argument, pass on to … (import-html-release) … this.
  (latest-html-updatable-release): Rename to … (import-html-updatable-release)
  … this, add #:version argument, pass on to … (import-html-release) … this.
* guix/import/gnu.scm(gnu->guix-package): Adjust function call.
---
 guix/gnu-maintenance.scm | 171 ++++++++++++++++++++++++---------------
 guix/import/gnu.scm      |   2 +-
 2 files changed, 105 insertions(+), 68 deletions(-)

diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index e414de8e28..e26702599d 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -333,14 +333,17 @@ name/directory pairs."
                             files)
                 result)))))))
 
-(define* (latest-ftp-release project
+(define* (import-ftp-release project
                              #:key
+                             (version #f)
                              (server "ftp.gnu.org")
                              (directory (string-append "/gnu/" project))
                              (file->signature (cut string-append <> ".sig")))
   "Return an <upstream-source> for the latest release of PROJECT on SERVER
-under DIRECTORY, or #f.  Use FTP-OPEN and FTP-CLOSE to open (resp. close) FTP
-connections; this can be useful to reuse connections.
+under DIRECTORY, or #f. Optionally include a VERSION string to fetch a specific version.
+
+Use FTP-OPEN and FTP-CLOSE to open (resp. close) FTP connections; this can be
+useful to reuse connections.
 
 FILE->SIGNATURE must be a procedure; it is passed a source file URL and must
 return the corresponding signature URL, or #f it signatures are unavailable."
@@ -407,8 +410,12 @@ return the corresponding signature URL, or #f it signatures are unavailable."
 
       ;; Assume that SUBDIRS correspond to versions, and jump into the
       ;; one with the highest version number.
-      (let* ((release  (reduce latest-release #f
-                               (coalesce-sources releases)))
+      (let* ((release  (if version
+                           (find (lambda (upstream)
+                                   (string=? (upstream-source-version upstream) version))
+                                 (coalesce-sources releases))
+                           (reduce latest-release #f
+                                   (coalesce-sources releases))))
              (result   (if (and result release)
                            (latest-release release result)
                            (or release result)))
@@ -420,13 +427,16 @@ return the corresponding signature URL, or #f it signatures are unavailable."
               (ftp-close conn)
               result))))))
 
-(define* (latest-release package
+(define* (import-release package
                          #:key
+                         (version #f)
                          (server "ftp.gnu.org")
                          (directory (string-append "/gnu/" package)))
   "Return the <upstream-source> for the latest version of PACKAGE or #f.
-PACKAGE must be the canonical name of a GNU package."
-  (latest-ftp-release package
+PACKAGE must be the canonical name of a GNU package. Optionally include a
+VERSION string to fetch a specific version."
+  (import-ftp-release package
+                      #:version version
                       #:server server
                       #:directory directory))
 
@@ -442,14 +452,15 @@ of EXP otherwise."
           (close-port port))
       #f)))
 
-(define (latest-release* package)
-  "Like 'latest-release', but (1) take a <package> object, and (2) ignore FTP
+(define* (import-release* package #:key (version #f))
+  "Like 'import-release', but (1) take a <package> object, and (2) ignore FTP
 errors that might occur when PACKAGE is not actually a GNU package, or not
 hosted on ftp.gnu.org, or not under that name (this is the case for
 \"emacs-auctex\", for instance.)"
   (let-values (((server directory)
                 (ftp-server/directory package)))
-    (false-if-ftp-error (latest-release (package-upstream-name package)
+    (false-if-ftp-error (import-release (package-upstream-name package)
+                                        #:version version
                                         #:server server
                                         #:directory directory))))
 
@@ -474,14 +485,18 @@ hosted on ftp.gnu.org, or not under that name (this is the case for
       (_
        links))))
 
-(define* (latest-html-release package
+(define* (import-html-release package
                               #:key
+                              (version #f)
                               (base-url "https://kernel.org/pub")
                               (directory (string-append "/" package))
                               file->signature)
   "Return an <upstream-source> for the latest release of PACKAGE (a string) on
-SERVER under DIRECTORY, or #f.  BASE-URL should be the URL of an HTML page,
-typically a directory listing as found on 'https://kernel.org/pub'.
+SERVER under DIRECTORY, or #f. Optionally include a VERSION string to fetch a
+specific version.
+
+BASE-URL should be the URL of an HTML page, typically a directory listing as
+found on 'https://kernel.org/pub'.
 
 When FILE->SIGNATURE is omitted or #f, guess the detached signature file name,
 if any.  Otherwise, FILE->SIGNATURE must be a procedure; it is passed a source
@@ -554,13 +569,18 @@ are unavailable."
     (match candidates
       (() #f)
       ((first . _)
-       ;; Select the most recent release and return it.
-       (reduce (lambda (r1 r2)
-                 (if (version>? (upstream-source-version r1)
-                                (upstream-source-version r2))
-                     r1 r2))
-               first
-               (coalesce-sources candidates))))))
+       (if version
+           ;; find matching release version and return it
+           (find (lambda (upstream)
+                   (string=? (upstream-source-version upstream) version))
+                 (coalesce-sources candidates))
+           ;; Select the most recent release and return it.
+           (reduce (lambda (r1 r2)
+                         (if (version>? (upstream-source-version r1)
+                                        (upstream-source-version r2))
+                             r1 r2))
+                       first
+                       (coalesce-sources candidates)))))))
 
 
 ;;;
@@ -592,9 +612,9 @@ are unavailable."
            (call-with-gzip-input-port port
              (compose string->lines get-string-all))))))
 
-(define (latest-gnu-release package)
+(define* (import-gnu-release package #:key (version #f))
   "Return the latest release of PACKAGE, a GNU package available via
-ftp.gnu.org.
+ftp.gnu.org. Optionally include a VERSION string to fetch a specific version.
 
 This method does not rely on FTP access at all; instead, it browses the file
 list available from %GNU-FILE-LIST-URI over HTTP(S)."
@@ -604,42 +624,50 @@ list available from %GNU-FILE-LIST-URI over HTTP(S)."
   (define (better-tarball? tarball1 tarball2)
     (string=? (file-extension tarball1) archive-type))
 
+  (define (find-latest-tarball-version tarballs)
+    (fold (lambda (file1 file2)
+            (if (and file2
+                     (version>? (tarball-sans-extension (basename file2))
+                                (tarball-sans-extension (basename file1))))
+                file2
+                file1))
+          #f
+          tarballs))
+
   (let-values (((server directory)
                 (ftp-server/directory package))
                ((name)
                 (package-upstream-name package)))
     (let* ((files    (ftp.gnu.org-files))
+           ;; select tarballs for this package
            (relevant (filter (lambda (file)
                                (and (string-prefix? "/gnu" file)
                                     (string-contains file directory)
                                     (release-file? name (basename file))))
-                             files)))
-      (match (sort relevant (lambda (file1 file2)
-                              (version>? (tarball-sans-extension
-                                          (basename file1))
-                                         (tarball-sans-extension
-                                          (basename file2)))))
-        ((and tarballs (reference _ ...))
-         (let* ((version  (tarball->version reference))
-                (tarballs (filter (lambda (file)
-                                    (string=? (tarball-sans-extension
-                                               (basename file))
-                                              (tarball-sans-extension
-                                               (basename reference))))
-                                  tarballs)))
-           (upstream-source
-            (package name)
-            (version version)
-            (urls (map (lambda (file)
-                         (string-append "mirror://gnu/"
-                                        (string-drop file
-                                                     (string-length "/gnu/"))))
+                             files))
+           ;; find latest version
+           (version (or version
+                        (and (not (null? relevant))
+                             (tarball->version
+                              (find-latest-tarball-version relevant)))))
+           ;; find tarballs matching this version
+           (tarballs (filter (lambda (file)
+                               (string=? version (tarball->version file)))
+                             relevant)))
+    (match tarballs
+           (() #f)
+           (_
+            (upstream-source
+             (package name)
+             (version version)
+             (urls (map (lambda (file)
+                          (string-append "mirror://gnu/"
+                                         (string-drop file
+                                                      (string-length "/gnu/"))))
                        ;; Sort so that the tarball with the same compression
                        ;; format as currently used in PACKAGE comes first.
                        (sort tarballs better-tarball?)))
-            (signature-urls (map (cut string-append <> ".sig") urls)))))
-        (()
-         #f)))))
+             (signature-urls (map (cut string-append <> ".sig") urls))))))))
 
 (define %package-name-rx
   ;; Regexp for a package name, e.g., "foo-X.Y".  Since TeXmacs uses
@@ -693,8 +721,9 @@ GNOME packages; EMMS is included though, because its releases are on gnu.org."
   ;; HTML (unlike <https://download.savannah.nongnu.org/releases>.)
   "https://de.freedif.org/savannah/")
 
-(define (latest-savannah-release package)
-  "Return the latest release of PACKAGE."
+(define* (import-savannah-release package #:key (version #f))
+  "Return the latest release of PACKAGE. Optionally include a VERSION string
+to fetch a specific version."
   (let* ((uri       (string->uri
                      (match (origin-uri (package-source package))
                        ((? string? uri) uri)
@@ -703,12 +732,14 @@ GNOME packages; EMMS is included though, because its releases are on gnu.org."
          (directory (dirname (uri-path uri))))
     ;; Note: We use the default 'file->signature', which adds ".sig", ".asc",
     ;; or whichever detached signature naming scheme PACKAGE uses.
-    (latest-html-release package
+    (import-html-release package
+                         #:version version
                          #:base-url %savannah-base
                          #:directory directory)))
 
 (define* (latest-sourceforge-release package #:key (version #f))
-  "Return the latest release of PACKAGE."
+  "Return the latest release of PACKAGE. Optionally include a VERSION string
+to fetch a specific version."
   (define (uri-append uri extension)
     ;; Return URI with EXTENSION appended.
     (build-uri (uri-scheme uri)
@@ -766,21 +797,24 @@ GNOME packages; EMMS is included though, because its releases are on gnu.org."
         (when port
           (close-port port))))))
 
-(define (latest-xorg-release package)
-  "Return the latest release of PACKAGE."
+(define* (import-xorg-release package #:key (version #f))
+  "Return the latest release of PACKAGE.  Optionally include a VERSION string
+to fetch a specific version."
   (let ((uri (string->uri (origin-uri (package-source package)))))
     (false-if-ftp-error
-     (latest-ftp-release
+     (import-ftp-release
       (package-name package)
+      #:version version
       #:server "ftp.freedesktop.org"
       #:directory
       (string-append "/pub/xorg/" (dirname (uri-path uri)))))))
 
-(define (latest-kernel.org-release package)
-  "Return the latest release of PACKAGE, the name of a kernel.org package."
+(define* (import-kernel.org-release package #:key (version #f))
+  "Return the latest release of PACKAGE, the name of a kernel.org package.
+Optionally include a VERSION string to fetch a specific version."
   (define %kernel.org-base
     ;; This URL and sub-directories thereof are nginx-generated directory
-    ;; listings suitable for 'latest-html-release'.
+    ;; listings suitable for 'import-html-release'.
     "https://mirrors.edge.kernel.org/pub")
 
   (define (file->signature file)
@@ -792,7 +826,8 @@ GNOME packages; EMMS is included though, because its releases are on gnu.org."
                        ((uri mirrors ...) uri))))
          (package   (package-upstream-name package))
          (directory (dirname (uri-path uri))))
-    (latest-html-release package
+    (import-html-release package
+                         #:version version
                          #:base-url %kernel.org-base
                          #:directory directory
                          #:file->signature file->signature)))
@@ -819,9 +854,10 @@ GNOME packages; EMMS is included though, because its releases are on gnu.org."
       (or (assoc-ref (package-properties package) 'release-monitoring-url)
           (http-url? package)))))
 
-(define (latest-html-updatable-release package)
+(define* (import-html-updatable-release package #:key (version #f))
   "Return the latest release of PACKAGE.  Do that by crawling the HTML page of
-the directory containing its source tarball."
+the directory containing its source tarball.  Optionally include a VERSION
+string to fetch a specific version."
   (let* ((uri       (string->uri
                      (match (origin-uri (package-source package))
                        ((? string? url) url)
@@ -838,7 +874,8 @@ the directory containing its source tarball."
     (catch #t
       (lambda ()
         (guard (c ((http-get-error? c) #f))
-          (latest-html-release package
+          (import-html-release package
+                               #:version version
                                #:base-url base
                                #:directory directory)))
       (lambda (key . args)
@@ -856,7 +893,7 @@ the directory containing its source tarball."
    (name 'gnu)
    (description "Updater for GNU packages")
    (pred gnu-hosted?)
-   (import latest-gnu-release)))
+   (import import-gnu-release)))
 
 (define %gnu-ftp-updater
   ;; This is for GNU packages taken from alternate locations, such as
@@ -867,14 +904,14 @@ the directory containing its source tarball."
    (pred (lambda (package)
            (and (not (gnu-hosted? package))
                 (pure-gnu-package? package))))
-   (import latest-release*)))
+   (import import-release*)))
 
 (define %savannah-updater
   (upstream-updater
    (name 'savannah)
    (description "Updater for packages hosted on savannah.gnu.org")
    (pred (url-prefix-predicate "mirror://savannah/"))
-   (import latest-savannah-release)))
+   (import import-savannah-release)))
 
 (define %sourceforge-updater
   (upstream-updater
@@ -888,20 +925,20 @@ the directory containing its source tarball."
    (name 'xorg)
    (description "Updater for X.org packages")
    (pred (url-prefix-predicate "mirror://xorg/"))
-   (import latest-xorg-release)))
+   (import import-xorg-release)))
 
 (define %kernel.org-updater
   (upstream-updater
    (name 'kernel.org)
    (description "Updater for packages hosted on kernel.org")
    (pred (url-prefix-predicate "mirror://kernel.org/"))
-   (import latest-kernel.org-release)))
+   (import import-kernel.org-release)))
 
 (define %generic-html-updater
   (upstream-updater
    (name 'generic-html)
    (description "Updater that crawls HTML pages.")
    (pred html-updatable-package?)
-   (import latest-html-updatable-release)))
+   (import import-html-updatable-release)))
 
 ;;; gnu-maintenance.scm ends here
diff --git a/guix/import/gnu.scm b/guix/import/gnu.scm
index 2b9b71feb0..139c32a545 100644
--- a/guix/import/gnu.scm
+++ b/guix/import/gnu.scm
@@ -117,7 +117,7 @@ details.)"
     (unless package
       (raise (formatted-message (G_ "no GNU package found for ~a") name)))
 
-    (match (latest-release name)
+    (match (import-release name)
       ((? upstream-source? release)
        (let ((version (upstream-source-version release)))
          (gnu-package->sexp package release #:key-download key-download)))
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:35:06 GMT) Full text and rfc822 format available.

Message #139 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 06/18] import: crate: Allow updating to a specific version.
Date: Tue, 20 Dec 2022 10:34:11 +0100
* guix/import/crate.scm (latest-release): Rename to 'import-release',
  add #:version argument.
  If version is given, return an upstream-source for this version.
---
 guix/import/crate.scm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 51bfcd7bed..339dbcd74c 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2019, 2020, 2021 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2019, 2020 Martin Becze <mjbecze <at> riseup.net>
 ;;; Copyright © 2021 Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -354,11 +355,12 @@ look up the development dependencs for the given crate."
 (define crate-package?
   (url-predicate crate-url?))
 
-(define (latest-release package)
-  "Return an <upstream-source> for the latest release of PACKAGE."
+(define* (import-release package #:key (version #f))
+  "Return an <upstream-source> for the latest release of PACKAGE. Optionally
+include a VERSION string to fetch a specific version."
   (let* ((crate-name (guix-package->crate-name package))
          (crate      (lookup-crate crate-name))
-         (version    (crate-latest-version crate))
+         (version    (or version (crate-latest-version crate)))
          (url        (crate-uri crate-name version)))
     (upstream-source
      (package (package-name package))
@@ -370,5 +372,5 @@ look up the development dependencs for the given crate."
    (name 'crate)
    (description "Updater for crates.io packages")
    (pred crate-package?)
-   (import latest-release)))
+   (import import-release)))
 
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:35:07 GMT) Full text and rfc822 format available.

Message #142 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 07/18] import: egg: Allow updating to a specific version.
Date: Tue, 20 Dec 2022 10:34:12 +0100
* guix/import/egg.scm (latest-release): Rename to 'import-release',
  add #:version argument.
  If version is given, return an upstream-source for this version.
---
 guix/import/egg.scm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/guix/import/egg.scm b/guix/import/egg.scm
index 2ad48c3399..10a40fe4f8 100644
--- a/guix/import/egg.scm
+++ b/guix/import/egg.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz>
 ;;; Copyright © 2021 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -333,10 +334,11 @@ not work."
 ;;; Updater.
 ;;;
 
-(define (latest-release package)
-  "Return an @code{<upstream-source>} for the latest release of PACKAGE."
+(define* (import-release package #:key (version #f))
+  "Return an @code{<upstream-source>} for the latest release of PACKAGE.
+Optionally include a VERSION string to fetch a specific version."
   (let* ((egg-name (guix-package->egg-name package))
-         (version (find-latest-version egg-name))
+         (version (or version (find-latest-version egg-name)))
          (source-url (egg-uri egg-name version)))
     (upstream-source
      (package (package-name package))
@@ -348,6 +350,6 @@ not work."
    (name 'egg)
    (description "Updater for CHICKEN egg packages")
    (pred egg-package?)
-   (import latest-release)))
+   (import import-release)))
 
 ;;; egg.scm ends here
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:35:07 GMT) Full text and rfc822 format available.

Message #145 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 08/18] import: gem: Allow updating to a specific version.
Date: Tue, 20 Dec 2022 10:34:13 +0100
* guix/import/gem.scm (latest-release): Rename to 'import-release',
  add #:version argument.
  If version is given, return an upstream-source for this version.
---
 guix/import/gem.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index 1c6c55baa6..8ad0662628 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2020 Martin Becze <mjbecze <at> riseup.net>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
 ;;; Copyright © 2022 Taiju HIGASHI <higashi <at> taiju.info>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -173,11 +174,11 @@ package on RubyGems."
 (define gem-package?
   (url-prefix-predicate "https://rubygems.org/downloads/"))
 
-(define (latest-release package)
+(define* (import-release package #:key (version #f))
   "Return an <upstream-source> for the latest release of PACKAGE."
   (let* ((gem-name (guix-package->gem-name package))
          (gem      (rubygems-fetch gem-name))
-         (version  (gem-version gem))
+         (version  (or version (gem-version gem)))
          (url      (rubygems-uri gem-name version)))
     (upstream-source
      (package (package-name package))
@@ -189,7 +190,7 @@ package on RubyGems."
    (name 'gem)
    (description "Updater for RubyGem packages")
    (pred gem-package?)
-   (import latest-release)))
+   (import import-release)))
 
 (define* (gem-recursive-import package-name #:optional version)
   (recursive-import package-name
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:35:07 GMT) Full text and rfc822 format available.

Message #148 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 09/18] import: git: Allow updating to a specific version.
Date: Tue, 20 Dec 2022 10:34:14 +0100
* guix/import/git.scm
  (latest-tag): Add #:version argument. If version is given, try to
  find the respective version tag.
  (latest-git-tag-version): Add #:version argument and pass it on to
  called functions.
  (latest-releease) Rename to 'import-release', add #:version argument
  and pass it on to called functions.
---
 guix/import/git.scm | 39 +++++++++++++++++++++++++++------------
 1 file changed, 27 insertions(+), 12 deletions(-)

diff --git a/guix/import/git.scm b/guix/import/git.scm
index bb5ba4d97e..c15943bd7c 100644
--- a/guix/import/git.scm
+++ b/guix/import/git.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
 ;;; Copyright © 2022 Maxime Devos <maximedevos <at> telenet.be>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -146,9 +147,11 @@ version corresponding to the tag, and the cdr is the name of the tag."
                            tags)
                entry<?))
 
-(define* (latest-tag url #:key prefix suffix delim pre-releases?)
+(define* (latest-tag url
+                     #:key prefix suffix delim pre-releases? (version #f))
   "Return the latest version and corresponding tag available from the Git
-repository at URL."
+repository at URL. Optionally include a VERSION string to fetch a specific
+version."
   (define (pre-release? tag)
     (any (cut regexp-exec <> tag)
          %pre-release-rx))
@@ -169,13 +172,22 @@ repository at URL."
      ((null? versions->tags)
       (git-no-valid-tags-error))
      (else
-      (match (last versions->tags)
-        ((version . tag)
-         (values version tag)))))))
-
-(define (latest-git-tag-version package)
+      (let ((versions (if version
+                          (filter (match-lambda
+                                   ((candidate-version . tag)
+                                    (string=? version candidate-version)))
+                                  versions->tags)
+                          versions->tags)))
+        (if (null? versions)
+            (values #f #f)
+            (match (last versions)
+              ((version . tag)
+               (values version tag)))))))))
+
+(define* (latest-git-tag-version package #:key (version #f))
   "Given a PACKAGE, return the latest version of it and the corresponding git
-tag, or #false and #false if the latest version could not be determined."
+tag, or #false and #false if the latest version could not be determined.
+Optionally include a VERSION string to fetch a specific version."
   (guard (c ((or (git-no-tags-error? c) (git-no-valid-tags-error? c))
              (warning (or (package-field-location package 'source)
                           (package-location package))
@@ -193,6 +205,7 @@ tag, or #false and #false if the latest version could not be determined."
            (url (git-reference-url (origin-uri source)))
            (property (cute assq-ref (package-properties package) <>)))
       (latest-tag url
+                  #:version version
                   #:prefix (property 'release-tag-prefix)
                   #:suffix (property 'release-tag-suffix)
                   #:delim (property 'release-tag-version-delimiter)
@@ -206,12 +219,14 @@ tag, or #false and #false if the latest version could not be determined."
           (git-reference? (origin-uri origin))))
     (_ #f)))
 
-(define (latest-git-release package)
-  "Return an <upstream-source> for the latest release of PACKAGE."
+(define* (import-git-release package #:key (version #f))
+  "Return an <upstream-source> for the latest release of PACKAGE.
+Optionally include a VERSION string to fetch a specific version."
   (let* ((name (package-name package))
          (old-version (package-version package))
          (old-reference (origin-uri (package-source package)))
-         (new-version new-version-tag (latest-git-tag-version package)))
+         (new-version new-version-tag
+                      (latest-git-tag-version package #:version version)))
     (and new-version new-version-tag
          (upstream-source
           (package name)
@@ -226,4 +241,4 @@ tag, or #false and #false if the latest version could not be determined."
    (name 'generic-git)
    (description "Updater for packages hosted on Git repositories")
    (pred git-package?)
-   (import latest-git-release)))
+   (import import-git-release)))
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:35:08 GMT) Full text and rfc822 format available.

Message #151 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 10/18] import: github: Allow updating to a specific version.
Date: Tue, 20 Dec 2022 10:34:15 +0100
* guix/import/github.scm (latest-released-version): Add #:version argument.
  If version is given, try to find the respective release.
  (latest-releease) Rename to 'import-release', add #:version argument
  and pass it on to 'latest-released-version'.
---
 guix/import/github.scm | 36 ++++++++++++++++++++++++------------
 1 file changed, 24 insertions(+), 12 deletions(-)

diff --git a/guix/import/github.scm b/guix/import/github.scm
index ac6ef06eda..a1bda5ec43 100644
--- a/guix/import/github.scm
+++ b/guix/import/github.scm
@@ -249,11 +249,13 @@ Alternatively, you can wait until your rate limit is reset, or use the
                                            #:headers headers)))
                    (x x)))))))))
 
-(define (latest-released-version url package-name)
+(define* (latest-released-version url package-name #:key (version #f))
   "Return the newest released version and its tag given a string URL like
 'https://github.com/arq5x/bedtools2/archive/v2.24.0.tar.gz' and the name of
 the package e.g. 'bedtools2'.  Return #f (two values) if there are no
-releases."
+releases.
+
+Optionally include a VERSION string to fetch a specific version."
   (define (pre-release? x)
     (assoc-ref x "prerelease"))
 
@@ -290,16 +292,25 @@ releases."
   (match (and=> (fetch-releases-or-tags url) vector->list)
     (#f (values #f #f))
     (json
-     (match (sort (filter-map release->version
-                              (match (remove pre-release? json)
-                                (() json)         ; keep everything
-                                (releases releases)))
-                  (lambda (x y) (version>? (car x) (car y))))
+     (let ((releases (filter-map release->version
+                                 (match (remove pre-release? json)
+                                   (() json)         ; keep everything
+                                   (releases releases)))))
+       (match (if version
+                  ;; Find matching release version.
+                  (filter (match-lambda
+                           ((candidate-version . tag)
+                            (string=? version candidate-version)))
+                          releases)
+                  ;; Sort releases descending.
+                  (sort releases
+                        (lambda (x y) (version>? (car x) (car y)))))
        (((latest-version . tag) . _) (values latest-version tag))
-       (() (values #f #f))))))
+       (() (values #f #f)))))))
 
-(define (latest-release pkg)
-  "Return an <upstream-source> for the latest release of PKG."
+(define* (import-release pkg #:key (version #f))
+  "Return an <upstream-source> for the latest release of PKG.
+Optionally include a VERSION string to fetch a specific version."
   (define (github-uri uri)
     (match uri
       ((? string? url)
@@ -313,7 +324,8 @@ releases."
          (source-uri (github-uri original-uri))
          (name (package-name pkg))
          (newest-version version-tag
-                         (latest-released-version source-uri name)))
+                         (latest-released-version source-uri name
+                                                  #:version version)))
     (if newest-version
         (upstream-source
          (package name)
@@ -330,6 +342,6 @@ releases."
    (name 'github)
    (description "Updater for GitHub packages")
    (pred github-package?)
-   (import latest-release)))
+   (import import-release)))
 
 
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:35:08 GMT) Full text and rfc822 format available.

Message #154 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 11/18] import: gnome: Allow updating to a specific version.
Date: Tue, 20 Dec 2022 10:34:16 +0100
* guix/import/gnome.scm (latest-gnome-release): Rename
  to 'import-gnome-release', add #:version argument. If version is
  given, try to find the respective version
  [find-latest-release]: New function, based on former code.
  [find-version-release]: New function.
---
 guix/import/gnome.scm | 47 +++++++++++++++++++++++++++----------------
 1 file changed, 30 insertions(+), 17 deletions(-)

diff --git a/guix/import/gnome.scm b/guix/import/gnome.scm
index 09c6dbbd0d..3c5a96fdde 100644
--- a/guix/import/gnome.scm
+++ b/guix/import/gnome.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2019, 2021 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -57,9 +58,10 @@ source for metadata."
                                             name "/" relative-url))))
                         '("tar.lz" "tar.xz" "tar.bz2" "tar.gz")))))))
 
-(define (latest-gnome-release package)
+(define* (import-gnome-release package #:key (version #f))
   "Return the latest release of PACKAGE, a GNOME package, or #f if it could
-not be determined."
+not be determined. Optionally include a VERSION string to fetch a specific
+version."
   (define %not-dot
     (char-set-complement (char-set #\.)))
 
@@ -88,6 +90,28 @@ https://discourse.gnome.org/t/new-gnome-versioning-scheme/4235"
     ;; Some packages like "NetworkManager" have camel-case names.
     (package-upstream-name package))
 
+  (define (find-latest-release releases)
+    (fold (match-lambda*
+           (((key . value) result)
+            (cond ((release-version? key)
+                   (match result
+                     (#f
+                      (cons key value))
+                     ((newest . _)
+                      (if (version>? key newest)
+                          (cons key value)
+                          result))))
+                  (else
+                   result))))
+          #f
+          releases))
+
+  (define (find-version-release releases version)
+    (find (match-lambda
+            ((key . value)
+             (string=? key version)))
+          releases))
+
   (guard (c ((http-get-error? c)
              (if (= 404 (http-get-error-code c))
                  #f
@@ -108,20 +132,9 @@ https://discourse.gnome.org/t/new-gnome-versioning-scheme/4235"
       (match json
         (#(4 releases _ ...)
          (let* ((releases (assoc-ref releases upstream-name))
-                (latest   (fold (match-lambda*
-                                  (((key . value) result)
-                                   (cond ((release-version? key)
-                                          (match result
-                                            (#f
-                                             (cons key value))
-                                            ((newest . _)
-                                             (if (version>? key newest)
-                                                 (cons key value)
-                                                 result))))
-                                         (else
-                                          result))))
-                                #f
-                                releases)))
+                (latest (if version
+                            (find-version-release releases version)
+                            (find-latest-release releases))))
            (and latest
                 (jsonish->upstream-source upstream-name latest))))))))
 
@@ -130,4 +143,4 @@ https://discourse.gnome.org/t/new-gnome-versioning-scheme/4235"
    (name 'gnome)
    (description "Updater for GNOME packages")
    (pred (url-prefix-predicate "mirror://gnome/"))
-   (import latest-gnome-release)))
+   (import import-gnome-release)))
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:35:09 GMT) Full text and rfc822 format available.

Message #157 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 12/18] import: hexpm: Allow updating to a specific version.
Date: Tue, 20 Dec 2022 10:34:17 +0100
* guix/import/hexpm.scm (latest-release): Rename to 'import-release',
  add #:version argument.
  If version is given, return an upstream-source for this version.
---
 guix/import/hexpm.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/guix/import/hexpm.scm b/guix/import/hexpm.scm
index 3b63837393..8a009fd245 100644
--- a/guix/import/hexpm.scm
+++ b/guix/import/hexpm.scm
@@ -328,11 +328,12 @@ latest version of PACKAGE-NAME."
 ;;; Updater
 ;;;
 
-(define (latest-release package)
-  "Return an <upstream-source> for the latest release of PACKAGE."
+(define* (import-release package #:key (version #f))
+  "Return an <upstream-source> for the latest release of PACKAGE. Optionally
+include a VERSION string to fetch a specific version."
   (let* ((hexpm-name (guix-package->hexpm-name package))
          (hexpm      (lookup-hexpm hexpm-name))
-         (version    (hexpm-latest-release hexpm))
+         (version    (or version (hexpm-latest-release hexpm)))
          (url        (hexpm-uri hexpm-name version)))
     (upstream-source
      (package (package-name package))
@@ -344,4 +345,4 @@ latest version of PACKAGE-NAME."
    (name 'hexpm)
    (description "Updater for hex.pm packages")
    (pred (url-prefix-predicate hexpm-package-url))
-   (import latest-release)))
+   (import import-release)))
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:36:01 GMT) Full text and rfc822 format available.

Message #160 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 13/18] import: kde: Allow updating to a specific version.
Date: Tue, 20 Dec 2022 10:34:18 +0100
* guix/import/kde.scm (latest-kde-release): Rename to 'import-kde-release',
  add #:version argument.  Rework the code to not sort the relevant files,
  but just find the requested or latest version.
  [find-latest-archive-version]: New function.
---
 guix/import/kde.scm | 61 ++++++++++++++++++++++++++-------------------
 1 file changed, 36 insertions(+), 25 deletions(-)

diff --git a/guix/import/kde.scm b/guix/import/kde.scm
index 510d823a4f..3566312eca 100644
--- a/guix/import/kde.scm
+++ b/guix/import/kde.scm
@@ -28,6 +28,7 @@
   #:use-module (ice-9 match)
   #:use-module (ice-9 rdelim)
   #:use-module (ice-9 regex)
+  #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
   #:use-module (web uri)
 
@@ -149,42 +150,52 @@ Output:
       (string-join (map version->pattern directory-parts) "/")
       "/"))))
 
-(define (latest-kde-release package)
+(define* (import-kde-release package #:key (version #f))
   "Return the latest release of PACKAGE, a KDE package, or #f if it could
-not be determined."
+not be determined. Optionally include a VERSION string to fetch a specific
+version."
+
+  (define (find-latest-archive-version archives)
+    (fold (lambda (file1 file2)
+            (if (and file2
+                     (version>? (tarball-sans-extension (basename file2))
+                                (tarball-sans-extension (basename file1))))
+                file2
+                file1))
+          #f
+          archives))
+
   (let* ((uri      (string->uri (origin-uri (package-source package))))
          (path-rx  (uri->kde-path-pattern uri))
          (name     (package-upstream-name package))
          (files    (download.kde.org-files))
+         ;; select archives for this package
          (relevant (filter (lambda (file)
                              (and (regexp-exec path-rx file)
                                   (release-file? name (basename file))))
-                           files)))
-    (match (sort relevant (lambda (file1 file2)
-                            (version>? (tarball-sans-extension
-                                        (basename file1))
-                                       (tarball-sans-extension
-                                        (basename file2)))))
-           ((and tarballs (reference _ ...))
-            (let* ((version  (tarball->version reference))
-                   (tarballs (filter (lambda (file)
-                                       (string=? (tarball-sans-extension
-                                                  (basename file))
-                                                 (tarball-sans-extension
-                                                  (basename reference))))
-                                     tarballs)))
-              (upstream-source
-               (package name)
-               (version version)
-               (urls (map (lambda (file)
-                            (string-append "mirror://kde/" file))
-                          tarballs)))))
-           (()
-            #f))))
+                           files))
+         ;; Find latest version.
+         (version (or version
+                      (and (not (null? relevant))
+                           (tarball->version (find-latest-archive-version relevant)))))
+         ;; Find archives matching this version.
+         (tarballs (filter (lambda (file)
+                             (string=? version (tarball->version file)))
+                           relevant)))
+    (match tarballs
+      (() #f)
+      (_
+       (upstream-source
+        (package name)
+        (version version)
+        (urls (map (lambda (file)
+                     (string-append "mirror://kde/" file))
+                   tarballs)))))))
+
 
 (define %kde-updater
   (upstream-updater
     (name 'kde)
     (description "Updater for KDE packages")
     (pred (url-prefix-predicate "mirror://kde/"))
-    (import latest-kde-release)))
+    (import import-kde-release)))
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:36:02 GMT) Full text and rfc822 format available.

Message #163 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 14/18] import: launchpad: Allow updating to a specific
 version.
Date: Tue, 20 Dec 2022 10:34:19 +0100
* guix/import/launchpad.scm (latest-release): Rename to 'import-release',
  add #:version argument.
  If version is given, return an upstream-source for this version.
---
 guix/import/launchpad.scm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/guix/import/launchpad.scm b/guix/import/launchpad.scm
index b7e0295c4e..01953ea69c 100644
--- a/guix/import/launchpad.scm
+++ b/guix/import/launchpad.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2019, 2020 Arun Isaac <arunisaac <at> systemreboot.net>
 ;;; Copyright © 2021 Matthew James Kraai <kraai <at> ftbfs.org>
 ;;; Copyright © 2020 Brice Waegeneire <brice <at> waegenei.re>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -121,8 +122,9 @@ for example, 'linuxdcpp'. Return #f if there is no releases."
       (last (remove pre-release? (vector->list (assoc-ref json "entries"))))
       "version"))))
 
-(define (latest-release pkg)
-  "Return an <upstream-source> for the latest release of PKG."
+(define* (import-release pkg #:key (version #f))
+  "Return an <upstream-source> for the latest release of PKG. Optionally
+include a VERSION string to fetch a specific version."
   (define (origin-launchpad-uri origin)
     (match (origin-uri origin)
       ((? string? url) url) ; surely a Launchpad URL
@@ -132,7 +134,7 @@ for example, 'linuxdcpp'. Return #f if there is no releases."
   (let* ((source-uri (origin-launchpad-uri (package-source pkg)))
          (name (package-name pkg))
          (repository (launchpad-repository source-uri))
-         (newest-version (latest-released-version repository)))
+         (newest-version (or version (latest-released-version repository))))
     (if newest-version
         (upstream-source
          (package name)
@@ -145,4 +147,4 @@ for example, 'linuxdcpp'. Return #f if there is no releases."
    (name 'launchpad)
    (description "Updater for Launchpad packages")
    (pred launchpad-package?)
-   (import latest-release)))
+   (import import-release)))
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:36:02 GMT) Full text and rfc822 format available.

Message #166 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 15/18] import: pypi: Allow updating to a specific version.
Date: Tue, 20 Dec 2022 10:34:20 +0100
* guix/import/pypi.scm (latest-release): Rename to 'import-release',
  add #:version argument and pass it on to called functions.
---
 guix/import/pypi.scm | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 3e3e949283..0e5998b36e 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -13,6 +13,7 @@
 ;;; Copyright © 2021 Marius Bakke <marius <at> gnu.org>
 ;;; Copyright © 2022 Vivien Kraus <vivien <at> planete-kraus.eu>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -556,15 +557,16 @@ source.  To build it from source, refer to the upstream repository at
          (string-prefix? "https://pypi.org/packages" url)
          (string-prefix? "https://files.pythonhosted.org/packages" url)))))
 
-(define (latest-release package)
-  "Return an <upstream-source> for the latest release of PACKAGE."
+(define* (import-release package #:key (version #f))
+  "Return an <upstream-source> for the latest release of PACKAGE. Optionally
+include a VERSION string to fetch a specific version."
   (let* ((pypi-name    (guix-package->pypi-name package))
          (pypi-package (pypi-fetch pypi-name)))
     (and pypi-package
          (guard (c ((missing-source-error? c) #f))
            (let* ((info    (pypi-project-info pypi-package))
-                  (version (project-info-version info))
-                  (dist    (source-release pypi-package))
+                  (version (or version (project-info-version info)))
+                  (dist    (source-release pypi-package version))
                   (url     (distribution-url dist)))
              (upstream-source
               (urls (list url))
@@ -574,7 +576,7 @@ source.  To build it from source, refer to the upstream repository at
                    #f))
               (input-changes
                (changed-inputs package
-                               (pypi->guix-package pypi-name)))
+                               (pypi->guix-package pypi-name #:version version)))
               (package (package-name package))
               (version version)))))))
 
@@ -583,4 +585,4 @@ source.  To build it from source, refer to the upstream repository at
    (name 'pypi)
    (description "Updater for PyPI packages")
    (pred pypi-package?)
-   (import latest-release)))
+   (import import-release)))
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:36:02 GMT) Full text and rfc822 format available.

Message #169 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 16/18] refresh: Allow updating to a specific version.
Date: Tue, 20 Dec 2022 10:34:21 +0100
* guix/scripts/refresh.scm (options->packages)[args-packages]: Handle version
  specification in package name arguments.
  (update-package): Add #:version argument and pass it on to called functions.
  (guix-refresh): When updating, pass the specified version (if any) to
  update-package.
  [package-list-without-versions, package-list-with-versions]: New functions.
---
 guix/scripts/refresh.scm | 49 ++++++++++++++++++++++++++++++----------
 1 file changed, 37 insertions(+), 12 deletions(-)

diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index 14329751f8..e0b94ce48d 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2019 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2020 Simon Tournier <zimon.toutoune <at> gmail.com>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -46,6 +47,7 @@
   #:use-module (ice-9 vlist)
   #:use-module (ice-9 format)
   #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-26)
   #:use-module (srfi srfi-37)
   #:use-module (srfi srfi-71)
@@ -181,7 +183,7 @@ specified with `--select'.\n"))
   (newline)
   (show-bug-report-information))
 
-(define (options->packages opts)
+(define (options->update-specs opts)
   "Return the list of packages requested by OPTS, honoring options like
 '--recursive'."
   (define core-package?
@@ -224,7 +226,7 @@ update would trigger a complete rebuild."
                          (('argument . spec)
                           ;; Take either the specified version or the
                           ;; latest one.
-                          (specification->package spec))
+                          (update-specification->update-spec spec))
                          (('expression . exp)
                           (read/eval-package-expression exp))
                          (_ #f))
@@ -254,6 +256,25 @@ update would trigger a complete rebuild."
       (with-monad %store-monad
         (return packages))))
 
+
+;;;
+;;; Utilities.
+;;;
+
+(define-record-type <update-spec>
+  (update-spec package version)
+  update?
+  (package update-spec-package)
+  (version update-spec-version))
+
+(define (update-specification->update-spec spec)
+  "Given SPEC, a package name like \"guile <at> 2.0=2.0.8\", return a <update>
+record with two fields: the package to upgrade, and the target version."
+  (match (string-rindex spec #\=)
+    (#f  (update-spec (specification->package spec) #f))
+    (idx (update-spec (specification->package (substring spec 0 idx))
+                      (substring spec (1+ idx))))))
+
 
 ;;;
 ;;; Updates.
@@ -298,7 +319,7 @@ update would trigger a complete rebuild."
            (G_ "no updater for ~a~%")
            (package-name package)))
 
-(define* (update-package store package updaters
+(define* (update-package store package version updaters
                          #:key (key-download 'interactive) warn?)
   "Update the source file that defines PACKAGE with the new version.
 KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed
@@ -307,7 +328,7 @@ warn about packages that have no matching updater."
   (if (lookup-updater package updaters)
       (let ((version output source
                      (package-update store package updaters
-                                     #:key-download key-download))
+                                     #:key-download key-download #:version version))
             (loc (or (package-field-location package 'version)
                      (package-location package))))
         (when version
@@ -540,12 +561,12 @@ all are dependent packages: ~{~a~^ ~}~%")
     (with-error-handling
       (with-store store
         (run-with-store store
-          (mlet %store-monad ((packages (options->packages opts)))
+          (mlet %store-monad ((update-specs (options->update-specs opts)))
             (cond
              (list-dependent?
-              (list-dependents packages))
+              (list-dependents (map update-spec-package update-specs)))
              (list-transitive?
-              (list-transitive packages))
+              (list-transitive (map update-spec-package update-specs)))
              (update?
               (parameterize ((%openpgp-key-server
                               (or (assoc-ref opts 'key-server)
@@ -558,13 +579,17 @@ all are dependent packages: ~{~a~^ ~}~%")
                                   (string-append (config-directory)
                                                  "/upstream/trustedkeys.kbx"))))
                 (for-each
-                 (cut update-package store <> updaters
-                      #:key-download key-download
-                      #:warn? warn?)
-                 packages)
+                 (lambda (update)
+                   (update-package store
+                                   (update-spec-package update)
+                                   (update-spec-version update)
+                                   updaters
+                                   #:key-download key-download
+                                   #:warn? warn?))
+                 update-specs)
                 (return #t)))
              (else
               (for-each (cut check-for-package-update <> updaters
                              #:warn? warn?)
-                        packages)
+                        (map update-spec-package update-specs))
               (return #t)))))))))
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:36:03 GMT) Full text and rfc822 format available.

Message #172 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 17/18] upstream: Allow updating to a specific version.
Date: Tue, 20 Dec 2022 10:34:22 +0100
* guix/upstream.scm(package-latest-release): Add keyword-argument 'version'
  and pass it on to the updater's 'import' function.
  (package-update): add keyword-argument 'version' and pass it on to
  package-latest-release.  Differentiate the error message issued when
  no package was found, depending on whether version was given or not.
---
 guix/upstream.scm | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/guix/upstream.scm b/guix/upstream.scm
index 3b576898ec..f3ab9ab78b 100644
--- a/guix/upstream.scm
+++ b/guix/upstream.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2019, 2022 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
 ;;; Copyright © 2021, 2022 Maxime Devos <maximedevos <at> telenet.be>
+;;; Copyright © 2022 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -278,7 +279,8 @@ them matches."
 
 (define* (package-latest-release package
                                  #:optional
-                                 (updaters (force %updaters)))
+                                 (updaters (force %updaters))
+                                 #:key (version #f))
   "Return an upstream source to update PACKAGE, a <package> object, or #f if
 none of UPDATERS matches PACKAGE.  When several updaters match PACKAGE, try
 them until one of them returns an upstream source.  It is the caller's
@@ -287,7 +289,7 @@ one."
   (any (match-lambda
          (($ <upstream-updater> name description pred import)
           (and (pred package)
-               (import package))))
+               (import package #:version version))))
        updaters))
 
 (define* (package-latest-release* package
@@ -494,13 +496,13 @@ SOURCE, an <upstream-source>."
 
 (define* (package-update store package
                          #:optional (updaters (force %updaters))
-                         #:key (key-download 'interactive))
+                         #:key (key-download 'interactive) (version #f))
   "Return the new version, the file name of the new version tarball, and input
 changes for PACKAGE; return #f (three values) when PACKAGE is up-to-date;
 raise an error when the updater could not determine available releases.
 KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed
 values: 'always', 'never', and 'interactive' (default)."
-  (match (package-latest-release package updaters)
+  (match (package-latest-release package updaters #:version version)
     ((? upstream-source? source)
      (if (version>? (upstream-source-version source)
                     (package-version package))
@@ -524,8 +526,11 @@ this method: ~s")
          (values #f #f #f)))
     (#f
      ;; Warn rather than abort so that other updates can still take place.
-     (warning (G_ "updater failed to determine available releases for ~a~%")
-              (package-name package))
+     (if version
+         (warning (G_ "updater failed to find release ~a@~a~%")
+                  (package-name package) version)
+         (warning (G_ "updater failed to determine available releases for ~a~%")
+                  (package-name package)))
      (values #f #f #f))))
 
 (define* (update-package-source package source hash)
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Tue, 20 Dec 2022 09:36:03 GMT) Full text and rfc822 format available.

Message #175 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460 <at> debbugs.gnu.org
Subject: [PATCH v3 18/18] doc: Describe how to update to a specific version.
Date: Tue, 20 Dec 2022 10:34:23 +0100
---
 doc/guix.texi | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index c031c8d880..8bca0e1098 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -13932,6 +13932,25 @@ gnu/packages/multiprecision.scm:40:12: 6.1.2 is already the latest version of gm
 
 @end table
 
+If for some reason you don't want to update to the latest version,
+you can update to a specific version
+by appending an equal-sign and the desired version number
+to the package specification.
+However, not all updaters support this.
+
+@example
+$ guix refresh trytond-party
+gnu/packages/guile.scm:392:2: guile would be upgraded from 3.0.3 to 3.0.5
+$ guix refresh -u guile=3.0.4
+@dots{}
+gnu/packages/guile.scm:392:2: guile: updating from version 3.0.3 to version 3.0.4...
+@dots{}
+$ guix refresh -u guile@@2.0=2.0.12
+@dots{}
+gnu/packages/guile.scm:147:2: guile: updating from version 2.0.10 to version 2.0.12...
+@dots{}
+@end example
+
 Sometimes the upstream name differs from the package name used in Guix,
 and @command{guix refresh} needs a little help.  Most updaters honor the
 @code{upstream-name} property in package definitions, which can be used
-- 
2.30.6





Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Fri, 23 Dec 2022 22:44:01 GMT) Full text and rfc822 format available.

Message #178 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 57460 <at> debbugs.gnu.org
Subject: Re: bug#57460: [PATCH 00/19] Refresh to specific version
Date: Fri, 23 Dec 2022 23:42:52 +0100
Hartmut Goebel <h.goebel <at> crazy-compilers.com> skribis:

> ---
>  doc/guix.texi | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)

Please add a commit log.

> +If for some reason you don't want to update to the latest version,
> +you can update to a specific version
> +by appending an equal-sign and the desired version number
> +to the package specification.
> +However, not all updaters support this.

s/equal-sign/equal sign/

(You might want to “fill” the paragraph too, to avoid those spurious
line breaks.)

Maybe replace the last sentence with something more practical like:

  Note that not all updaters support this; an error is reported when an
  updater cannot refresh to the specified version.

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#57460; Package guix-patches. (Fri, 23 Dec 2022 22:46:01 GMT) Full text and rfc822 format available.

Message #181 received at 57460 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 57460 <at> debbugs.gnu.org
Subject: Re: bug#57460: [PATCH 00/19] Refresh to specific version
Date: Fri, 23 Dec 2022 23:45:42 +0100
Hi,

Hartmut Goebel <h.goebel <at> crazy-compilers.com> skribis:

>> In Guix, “package spec” refers to the syntax that
>> ‘specification->package’ accepts, like “guile” or “guile <at> 2.2”.  So we’ll
>> have to use another name throughout.  How about “update spec” or
>> “refresh spec” for the string, and just “update” for the record?
>
> Using "update" resulted in a conflict with the existing "update-package"
> function. Using "refesh" would have names the accessor "refresh-package",
> which sounds irritating for me (same for "update". Thus I decided to call the
> record "update-spec" and the function "update-string->update.spec" (the name
> is use only once).
>
> WDYT?

Sounds good!

>> Since there are just two fields, it may be simpler to use SRFI-9:
>
> Done.
>
> I also tested the patches with (an updated version of) the test-script I
> posted in the first version of the series.

Excellent.  I posted suggestions for the last patch (doc); you can
adjust it and push the whole series.

Thank you!

Ludo’.




Reply sent to Hartmut Goebel <h.goebel <at> crazy-compilers.com>:
You have taken responsibility. (Mon, 26 Dec 2022 16:43:01 GMT) Full text and rfc822 format available.

Notification sent to Hartmut Goebel <h.goebel <at> crazy-compilers.com>:
bug acknowledged by developer. (Mon, 26 Dec 2022 16:43:01 GMT) Full text and rfc822 format available.

Message #186 received at 57460-close <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 57460-close <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: bug#57460: [PATCH 00/19] Refresh to specific version
Date: Mon, 26 Dec 2022 17:42:08 +0100
Hi,

Many thanks for the review. I followed your latest suggestions. and 
pushed as 7c476873e0300711bf92668cf01abd28f7295ead

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel <at> crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 24 Jan 2023 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.