This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository buildscripts. commit 0fa0cbe89cd57ae853e9b9491afc9700be140a1f Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Feb 18 19:24:09 2023 +0100 bin/build-rpm-package: split out legacy check into separate function. --- bin/build-rpm-package | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/bin/build-rpm-package b/bin/build-rpm-package index cf92dd6..5bd226a 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -685,6 +685,27 @@ wrap_suse_major_version () { return "0" } +# Returns success if the passed major and minor OpenSuSE version number is a +# legacy release, failure otherwise. +opensuse_is_legacy () { + typeset major_version="${1:?"Error: no OpenSuSE major version passed to ${FUNCNAME}()."}" + typeset minor_version="${2:?"Error: no OpenSuSE minor version passed to ${FUNCNAME}()."}" + + # We're not printing a boolean value, but use the exit code, so the + # value must be zero for success (i.e., legacy) and non-zero for + # failure (i.e., non-legacy). + typeset -i ret='1' + + if [[ "${major_version}" != "9999" ]]; then + if [ "${major_version}" -lt "15" ] || + ( [ "${major_version}" -eq "15" ] && [ "${minor_version}" -eq "0" ] ); then + ret="0" + fi + fi + + return "${ret}" +} + # Creates an obs-build configuration inside the temporary working directory. # Takes the temporary working directory and a subdirectory containing the # obs-build configuration files. @@ -1017,12 +1038,7 @@ build_packages() { exit "1" fi - if [[ "${tmp_suse_major_version}" != "9999" ]]; then - if [ "${tmp_suse_major_version}" -lt "15" ] || - ( [ "${tmp_suse_major_version}" -eq "15" ] && [ "${tmp_suse_minor_version}" -eq "0" ] ); then - legacy_release="1" - fi - fi + opensuse_is_legacy "${tmp_suse_major_version}" "${tmp_suse_minor_version}" && legacy_release='1' if [ "${legacy_release}" -eq "1" ]; then download_url=( "${OPENSUSE_DOWNLOAD_ARCHIVE_URL[@]}" ) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/buildscripts.git