]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
tools/ci-install.sh: on debian|ubuntu reduce the need for mingw package name changes
authorRalf Habacker <ralf.habacker@freenet.de>
Tue, 29 Mar 2022 07:36:54 +0000 (09:36 +0200)
committerSimon McVittie <smcv@collabora.com>
Tue, 13 Sep 2022 15:08:25 +0000 (16:08 +0100)
Instead of having to specify an exact version that needs to be adjusted
with each repository update, it is now possible to specify package names
without version or partially qualified versions, which reduces the
frequency of necessary adjustments.

This is achieved by searching for the package names in a previously
downloaded list of available packages.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
(cherry picked from commit 7e9d3708b1fea32c71ede2087083eeb179fc164b)

tools/ci-install.sh

index 21548cf5e76def648d9f5dc9e9b2f4f4f5dd9577..c2e550a92fb6c80043e012cdf74005d8ed1c0a13 100755 (executable)
@@ -196,6 +196,8 @@ if [ "$ci_local_packages" = yes ]; then
             mirror=https://repo.msys2.org/mingw/${ci_host%%-*}
             dep_prefix=$(pwd)/${ci_host}-prefix
             install -d "${dep_prefix}"
+            wget -O files.lst ${mirror}
+            sed 's,^<a href=",,g;s,">.*$,,g' files.lst | grep -v "\.db" | grep -v "\.files" | grep ".*zst$" | sort > filenames.lst
             packages=(
                 bzip2-1.0.8-2
                 expat-2.2.10-1
@@ -210,8 +212,13 @@ if [ "$ci_local_packages" = yes ]; then
                 zlib-1.2.11-8
             )
             for pkg in "${packages[@]}" ; do
-                wget ${mirror}/mingw-w64-${ci_host%%-*}-${pkg}-any.pkg.tar.zst
-                tar -C ${dep_prefix} --strip-components=1 -xvf mingw-w64-${ci_host%%-*}-${pkg}-any.pkg.tar.zst
+                filename=$(grep ${pkg} filenames.lst | tail -1)
+                if [ -z ${filename} ]; then
+                    echo "could not find filename for package '${pkg}'"
+                    exit 1
+                fi
+                wget ${mirror}/${filename}
+                tar -C ${dep_prefix} --strip-components=1 -xvf ${filename}
             done
 
             # limit access rights