Skip to content

Commit

Permalink
Trust mariadb key after setting up the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
RazvanLiviuVarzaru committed Oct 18, 2024
1 parent 2d7a289 commit bd24e54
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion scripts/bash_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ rpm_repoquery() {
set +u
# return full package list from repository
if [[ $ID_LIKE =~ ^suse* ]]; then
sudo zypper --gpg-auto-import-keys packages -r "${repo_name}">/dev/null
zypper packages -r "${repo_name}" | grep "MariaDB" | awk '{print $4}' #After cache is made, no need for sudo
else
repoquery --disablerepo=* --enablerepo="${repo_name}" -a -q |
Expand Down Expand Up @@ -315,6 +314,9 @@ module_hotfixes = 1
gpgkey=https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF
if [[ $ID_LIKE =~ ^suse* ]]; then
sudo zypper --gpg-auto-import-keys refresh mariadb
fi
set +u
}

Expand Down
12 changes: 6 additions & 6 deletions scripts/rpm-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ bb_log_info "Package_list: $package_list"
# /etc/zypp/repos.d/SUSE_Linux_Enterprise_Server_12_SP3_x86_64:SLES12-SP3-Pool.repo
if [[ $ID_LIKE =~ ^suse* ]]; then
sudo "$pkg_cmd" clean --all
pkg_cmd_nonint="-n"
pkg_cmd_options="-n"
else
sudo "$pkg_cmd" clean all
pkg_cmd_nonint="-y"
pkg_cmd_options="-y"
fi

# Install previous release
echo "$package_list" | xargs sudo "$pkg_cmd" "$pkg_cmd_nonint" install ||
echo "$package_list" | xargs sudo "$pkg_cmd" "$pkg_cmd_options" install ||
bb_log_err "installation of a previous release failed, see the output above"
#fi

Expand Down Expand Up @@ -252,18 +252,18 @@ fi
if [[ $test_type == "major" ]]; then
bb_log_info "remove old packages for major upgrade"
packages_to_remove=$(rpm -qa | grep 'MariaDB-' | awk -F'-' '{print $1"-"$2}')
echo "$packages_to_remove" | xargs sudo "$pkg_cmd" "$pkg_cmd_nonint" remove
echo "$packages_to_remove" | xargs sudo "$pkg_cmd" "$pkg_cmd_options" remove
rpm -qa | grep -iE 'maria|mysql' || true
fi

rpm_setup_bb_galera_artifacts_mirror
rpm_setup_bb_artifacts_mirror
if [[ $test_type == "major" ]]; then
# major upgrade (remove then install)
echo "$package_list" | xargs sudo "$pkg_cmd" "$pkg_cmd_nonint" install
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_nonint" upgrade
echo "$package_list" | xargs sudo "$pkg_cmd" "$pkg_cmd_options" upgrade
fi
# set +e

Expand Down

0 comments on commit bd24e54

Please sign in to comment.