[X2Go-Commits] [buildscripts] 01/01: bin/build-rpm-package: clean up multiple suse_get_major_version code sections and implement archive fetching for older OpenSuSE version.

git-admin at x2go.org git-admin at x2go.org
Sat Apr 15 16:34:57 CEST 2017


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository buildscripts.

commit 16b3e87827c401312ed581d380c998cbaea7dea8
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Sat Apr 15 16:33:17 2017 +0200

    bin/build-rpm-package: clean up multiple suse_get_major_version code sections and implement archive fetching for older OpenSuSE version.
---
 bin/build-rpm-package | 40 ++++++++++++++++++++++------------------
 1 file changed, 22 insertions(+), 18 deletions(-)

diff --git a/bin/build-rpm-package b/bin/build-rpm-package
index dfe68a1..8bc42f8 100755
--- a/bin/build-rpm-package
+++ b/bin/build-rpm-package
@@ -46,6 +46,7 @@ PACKAGES_WITHOUT_OTHERMIRROR="keyring"
 GNUPGHOME="${HOME}/.gnupg"
 
 OPENSUSE_DOWNLOAD_URL="http://download.opensuse.org/distribution/#LEAP##VERSION#/repo/oss/suse/"
+OPENSUSE_DOWNLOAD_ARCHIVE_URL="http://ftp.gwdg.de/pub/opensuse/discontinued/distribution/#LEAP##VERSION#/repo/oss/suse"
 SLE_DOWNLOAD_URL="/srv/mirrors/non-public/sle/#VERSION#/rpms/"
 
 test -z "${1}" && {
@@ -661,7 +662,6 @@ build_packages() {
 		l_CODENAMES="${CODENAMES:-$(cut -d":" -f2- <<< "${line/: /:}" | sed -e 's/,/ /g' | tr [:upper:] [:lower:])}"
 		grep -qs "${l_DIST}" <<< "${RPM_DISTS_SUPPORTED}" && {
 			for l_CODENAME in ${l_CODENAMES}; do
-
 				test -z "${CODENAMES}" || grep "${CODENAMES}" <<< "${line}" || break
 
 				# FIXME: Builds currently break without this. This should really be merged/transformed into an arch loop.
@@ -752,6 +752,7 @@ build_packages() {
 					BUILD_RESULT="/home/abuild/rpmbuild/"
 
 					typeset -i tmp_suse_major_version="0"
+					typeset -i tmp_suse_minor_version="0"
 					tmp_suse_major_version="$(get_generic_major_version "${l_CODENAME}")"
 
 					if [ "${?}" -ne "0" ]; then
@@ -759,8 +760,27 @@ build_packages() {
 						exit "1"
 					fi
 
+					tmp_suse_minor_version="$(get_generic_minor_version "${l_CODENAME}")"
+
+					if [ "${?}" -ne "0" ]; then
+						echo "Unable to extract minor SUSE version."
+						exit "1"
+					fi
+
 					if [ "x${l_DIST}" = "xopensuse" ]; then
-						DOWNLOAD_URL="$(sed -e "s/#VERSION#/${l_CODENAME}/" <<< "${OPENSUSE_DOWNLOAD_URL}")"
+						typeset -i legacy_release="0"
+						if [ "${tmp_suse_major_version}" -lt "13" ] ||
+						   ( [ "${tmp_suse_major_version}" -eq "13" ] && [ "${tmp_suse_minor_version}" -lt "2" ] ); then
+							legacy_release="1"
+						fi
+
+						if [ "${legacy_release}" -eq "1" ]; then
+							DOWNLOAD_URL="${OPENSUSE_DOWNLOAD_ARCHIVE_URL}"
+						else
+							DOWNLOAD_URL="${OPENSUSE_DOWNLOAD_URL}"
+						fi
+
+						DOWNLOAD_URL="$(sed -e "s/#VERSION#/${l_CODENAME}/" <<< "${DOWNLOAD_URL}")"
 
 						if [ "${tmp_suse_major_version}" -gt "13" ]; then
 							DOWNLOAD_URL="$(sed -e 's_#LEAP#_leap/_' <<< "${DOWNLOAD_URL}")"
@@ -802,14 +822,6 @@ build_packages() {
 								cp "${rpmfile}" "${PKGDIST}/${l_DIST}/${l_CODENAME}/x86_64/"
 							done
 
-							typeset -i tmp_suse_major_version="0"
-							tmp_suse_major_version="$(get_generic_major_version "${l_CODENAME}")"
-
-							if [ "${?}" -ne "0" ]; then
-								echo "Unable to extract SUSE version."
-								exit "1"
-							fi
-
 							typeset gpg_sign_with="${GPG_KEY}"
 							[ "${tmp_suse_major_version}" -lt "12" ] && gpg_sign_with="${GPG_KEY_EPEL5}"
 
@@ -889,14 +901,6 @@ build_packages() {
 								cp "${rpmfile}" "${PKGDIST}/${l_DIST}/${l_CODENAME}/i586/"
 							done
 
-							typeset -i tmp_suse_major_version="0"
-							tmp_suse_major_version="$(get_generic_major_version "${l_CODENAME}")"
-
-							if [ "${?}" -ne "0" ]; then
-								echo "Unable to extract SUSE version."
-								exit "1"
-							fi
-
 							typeset gpg_sign_with="${GPG_KEY}"
 							[ "${tmp_suse_major_version}" -lt "12" ] && gpg_sign_with="${GPG_KEY_EPEL5}"
 

--
Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git


More information about the x2go-commits mailing list