Subject: [PATCH 20/20] TEMP REMOVE Add test-script for refesh-with-version

From: Hartmut Goebel <[email-masked]>
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 [email-masked]")
+PKGS+=("generic-git [email-masked]") # (import/git)
+PKGS+=("generic-html [email-masked]")  # (gnu-maintenance)
+PKGS+=("github [email-masked]")       #
+PKGS+=("gnome [email-masked]")
+PKGS+=("gnu [email-masked]")        # (gnu-maintenance)
+PKGS+=("gnu-ftp [email-masked]")  # (gnu-maintenance)
+# hexpm see below
+PKGS+=("kde [email-masked]")
+PKGS+=("kernel.org [email-masked]")          # (gnu-maintenance) = html
+PKGS+=("launchpad [email-masked]")  # will fail due to changed archive filename
+PKGS+=("pypi [email-masked]")
+PKGS+=("savannah [email-masked]") # (gnu-maintenance) = html
+PKGS+=("xorg [email-masked]")        # (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 [email-masked]")
+PKGS+=("hexpm [email-masked]")
+# 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 [email-masked]  'bioconductor (cran.scm)' 'repo supports latest version only'
+try_fail [email-masked]             'cran'        'repo supports latest version only'
+try_fail [email-masked]      'cpan'     'importer does not support version'
+try_fail [email-masked] 'elpa'     'importer does not support version'
+try_fail [email-masked]         'gem'      'importer does not support version'
+try_fail [email-masked]     'hackage'  'importer does not support version'
+try_fail [email-masked]     'minetest' 'importer does not support version'
+try_fail [email-masked]              'opam'     'importer does not support version'
+try_fail [email-masked] '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 [email-masked] elm 'has no updater'
+try_fail texlive-sourcecodepro@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