Skip to content

Commit

Permalink
SUSE fixes
Browse files Browse the repository at this point in the history
- ID_LIKE may not exist
- upgrade command does not exist for zypper
- set delimiter for zypper packages -r output
- suppress libmecab diffs to account for old/new bb env diffs
- add krb5/judy/lzo to opensuse images to allow creating rpm packages for  lzo, oqgraph, and gssap
  • Loading branch information
RazvanLiviuVarzaru committed Oct 21, 2024
1 parent bd24e54 commit f57b9ea
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
3 changes: 3 additions & 0 deletions ci_build_images/opensuse.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ RUN zypper update -y \
git \
glibc-locale \
jemalloc-devel \
judy-devel \
krb5-devel \
libaio-devel \
libboost_filesystem1_75_0-devel \
libboost_program_options1_75_0-devel \
Expand All @@ -46,6 +48,7 @@ RUN zypper update -y \
libopenssl-3-devel \
liburing2-devel \
libxml2-devel \
lzo-devel \
pam-devel \
pcre2-devel \
perl-Net-SSLeay \
Expand Down
17 changes: 12 additions & 5 deletions scripts/bash_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ rpm_repoquery() {
set +u
# return full package list from repository
if [[ $ID_LIKE =~ ^suse* ]]; then
zypper packages -r "${repo_name}" | grep "MariaDB" | awk '{print $4}' #After cache is made, no need for sudo
zypper packages -r "${repo_name}" | grep "MariaDB" | awk -F ' \\| ' '{print $3}' #After cache is made, no need for sudo
else
repoquery --disablerepo=* --enablerepo="${repo_name}" -a -q |
cut -d ":" -f1 | sort -u | sed 's/-0//'
Expand Down Expand Up @@ -314,10 +314,12 @@ module_hotfixes = 1
gpgkey=https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF

set +u
#ID_LIKE may not exist
if [[ $ID_LIKE =~ ^suse* ]]; then
sudo zypper --gpg-auto-import-keys refresh mariadb
fi
set +u
}

deb_setup_bb_artifacts_mirror() {
Expand Down Expand Up @@ -581,13 +583,15 @@ check_upgraded_versions() {
#

# Remove after Q4 2024 release
sed -i '/libaio.so/d;liburing.so/d' ./reqs-*.cmp
sed -i '/libaio.so/d;liburing.so/d' ./ldd-*.cmp
sed -i '/libaio.so/d;/liburing.so/d' ./reqs-*.cmp
sed -i '/libaio.so/d;/liburing.so/d' ./ldd-*.cmp
sed -i '/lsof/d' ./reqs-*.cmp

#Account for mariadb-plugin-mroonga diffs in Debian-11
#Account for mariadb-plugin-mroonga diffs in Debian
sed -i '/liblz4-1/d' ./reqs-*.cmp
sed -i '/liblz4.so.1/d' ./ldd-*.cmp
sed -i '/libmecab2/d' ./reqs-*.cmp
sed -i '/libmecab.so.2/d' ./ldd-*.cmp

# End of temporary adjustments

Expand Down Expand Up @@ -654,12 +658,15 @@ collect_dependencies() {
pkgtype=$2
bb_log_info "Collecting dependencies for the ${old_or_new} server"
set +x
# Spider_package_list variable does not exist for RPM upgrades.
set +u
for p in ${package_list} ${spider_package_list} ; do
if [[ "$p" =~ columnstore ]] ; then
suffix="columnstore"
else
suffix="main"
fi
set -u

echo "-----------------" >> "./reqs-${suffix}.${old_or_new}"
echo "$p:" >> "./reqs-${suffix}.${old_or_new}"
Expand Down
8 changes: 7 additions & 1 deletion scripts/rpm-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,19 @@ bb_log_info "Package_list: $package_list"
# sudo rm -rf
# /etc/zypp/repos.d/SUSE_Linux_Enterprise_Server_12_SP3_x86_64:SLES12-SP3-Updates.repo
# /etc/zypp/repos.d/SUSE_Linux_Enterprise_Server_12_SP3_x86_64:SLES12-SP3-Pool.repo

# ID_LIKE may not exist
set +u
if [[ $ID_LIKE =~ ^suse* ]]; then
sudo "$pkg_cmd" clean --all
pkg_cmd_options="-n"
pkg_cmd_upgrade="update"
else
sudo "$pkg_cmd" clean all
pkg_cmd_options="-y"
pkg_cmd_upgrade="upgrade"
fi
set -u

# Install previous release
echo "$package_list" | xargs sudo "$pkg_cmd" "$pkg_cmd_options" install ||
Expand Down Expand Up @@ -263,7 +269,7 @@ if [[ $test_type == "major" ]]; then
echo "$package_list" | xargs sudo "$pkg_cmd" "$pkg_cmd_options" install
else
# minor upgrade (upgrade works)
echo "$package_list" | xargs sudo "$pkg_cmd" "$pkg_cmd_options" upgrade
echo "$package_list" | xargs sudo "$pkg_cmd" "$pkg_cmd_options" "$pkg_cmd_upgrade"
fi
# set +e

Expand Down

0 comments on commit f57b9ea

Please sign in to comment.