Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix previous release detection #198

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions scripts/bash_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,21 @@ deb_setup_mariadb_mirror() {
bb_log_err "missing the branch variable"
exit 1
}
branch=$1
if [[ $branch == "$development_branch" ]]; then
#TOFIX - temp hack
prev_released=$((${branch/1[0-9]./} - 1))
if ((prev_released < 0)); then
branch="10.11"
branch_tmp=$1
major=${branch_tmp%.*}
minor=${branch_tmp##*.}
if [[ $minor == "0" ]]; then
if [[ $major == "11" ]]; then
prev_release="10.11"
else
branch="10.$prev_released"
bb_log_err "Unknown previous branch for $branch_tmp, please update this script"
exit 1
fi
bb_log_info "using previous $branch released version for development branch $1"
else
prev_release="$major.$((minor - 1))"
fi
branch=$prev_release
bb_log_info "using previous $branch released version for development branch $1"
bb_log_info "setup MariaDB repository for $branch branch"
command -v wget >/dev/null || {
bb_log_err "wget command not found"
Expand All @@ -209,8 +213,12 @@ deb_setup_mariadb_mirror() {
exit 1
}
else
bb_log_err "deb_setup_mariadb_mirror: $branch packages for $dist_name $version_name does not exist on https://deb.mariadb.org/"
exit 1
# the correct way of handling this would be to not even start the check
# since we know it will always fail. But apparently, it's not going to
# happen soon in BB. Once done though, replace the warning with an error
# and use a non-zero exit code.
bb_log_warn "deb_setup_mariadb_mirror: $branch packages for $dist_name $version_name does not exist on https://deb.mariadb.org/"
exit 0
fi
set +u
}
Expand Down