Skip to content

Commit 03807c8

Browse files
robinnewhouseLinuxJedi
authored andcommitted
Update test upgrade script for use with latest Fedora
Fedora 40 introdced wget2 as the default wget program, which caused a break in the functionality of the test_upgrade.sh script. Modified the archive.mariadb.org check so that it uses a one-line `curl` check to identify the correct repository URL. Additionally added rpm sources for the boost-program-options and openssl 1.1 and 1.0.2. This is necessary when building older versions of MariaDB (e.g., 10.4) on newer linux distributions (e.g., Fedora 39) that do not always have access to all required dependencies. In the above example older MariaDB versions are not compatible with OpenSSL 3.0+, so require an older version. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services.
1 parent 8aad19d commit 03807c8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/upgrade_from/test_upgrade.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,12 @@ install_mariadb_from_archive() {
117117
# The missing libraries depned on the latest distribution version, so that is found by scanning the MariaDB archive directory.
118118

119119
log Finding MariaDB RPM repository for version $version
120-
if ! $(wget --spider -r --no-parent --level 1 --quiet https://archive.mariadb.org/mariadb-$version/yum/fedora/ -P /tmp/); then
121-
log Could not find RPMs
120+
latest_distro=$(curl -s https://archive.mariadb.org/mariadb-$version/yum/fedora/ | (grep -Eo '^<a href="[0-9]+/">' || true) |
121+
sort -V | tail -n 1 | sed -n 's/^<a href="\([0-9]*\)\/">/\1/p')
122+
if [ -z $latest_distro ]; then
123+
log Could not find repository. Exiting.
122124
exit 1
123125
fi
124-
latest_distro=$(ls -1v /tmp/archive.mariadb.org/mariadb-$version/yum/fedora/ | tail -n 1)
125126
rpm_repository=https://archive.mariadb.org/mariadb-$version/yum/fedora/$latest_distro/$(uname -m)/
126127
log RPM repository: $rpm_repository
127128
# log Fedora distribution: $latest_distro # Currently only supports tests on Fedora
@@ -149,11 +150,17 @@ EOF
149150
fi
150151
# Install missing dependencies that are version/distro specific
151152
log "Installing missing libraries"
153+
[[ $latest_distro -le 26 ]] && dnf install -y http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/compat-openssl10-1.0.2o-4.el8.x86_64.rpm
152154
[[ $latest_distro -le 32 ]] && dnf install -y https://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/b/boost169-program-options-1.69.0-5.el8.x86_64.rpm
153155
[[ $latest_distro == 33 ]] && dnf install -y http://springdale.princeton.edu/data/springdale/7/x86_64/os/Computational/boost173-program-options-1.73.0-7.sdl7.x86_64.rpm
154156
[[ $latest_distro == 34 ]] && dnf install -y https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/boost-program-options-1.75.0-8.el9.x86_64.rpm \
155157
https://vault.centos.org/centos/8/AppStream/x86_64/os/Packages/liburing-1.0.7-3.el8.x86_64.rpm
156158
[[ $latest_distro == 35 ]] && dnf install -y https://archives.fedoraproject.org/pub/archive/fedora/linux/updates/36/Everything/x86_64/Packages/b/boost-program-options-1.76.0-12.fc36.x86_64.rpm
159+
[[ $latest_distro -le 35 ]] && dnf install -y https://dl.fedoraproject.org/pub/fedora/linux/releases/39/Everything/x86_64/os/Packages/o/openssl1.1-1.1.1q-5.fc39.x86_64.rpm
160+
# galera-4 needs boost-program-options-1.81.0. Try installing from default repository first.
161+
[[ $latest_distro -ge 39 ]] &&
162+
(dnf install -y boost-program-options-1.81.0 ||
163+
dnf install -y https://rpmfind.net/linux/fedora/linux/releases/39/Everything/x86_64/os/Packages/b/boost-program-options-1.81.0-8.fc39.x86_64.rpm)
157164
if [[ $major_version == "10.4" ]] && [[ $minor_version -ge 24 ]]; then
158165
log RPMs not available for version 10.4.24+ from this repository. You may try testing by installing from the .tar.gz binaries.
159166
exit 1

0 commit comments

Comments
 (0)