[X2Go-Commits] [buildscripts] 02/02: bin/build-rpm-package: only run createsusetagsrepo once for all architectures at the end of the upload run.

git-admin at x2go.org git-admin at x2go.org
Fri Nov 25 08:57:52 CET 2016


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

x2go pushed a commit to branch master
in repository buildscripts.

commit cb33618c2df85e0f3e459dee48844dccb609a747
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Fri Nov 25 08:57:43 2016 +0100

    bin/build-rpm-package: only run createsusetagsrepo once for all architectures at the end of the upload run.
---
 bin/build-rpm-package |  105 ++++++++++++++++++++++++++-----------------------
 1 file changed, 55 insertions(+), 50 deletions(-)

diff --git a/bin/build-rpm-package b/bin/build-rpm-package
index 92986ac..671bcc9 100755
--- a/bin/build-rpm-package
+++ b/bin/build-rpm-package
@@ -976,56 +976,6 @@ upload_packages() {
 						cd "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}"
 						scp *.rpm "${REPOS_SERVER}:'${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/${PROJECT}/'" || true
 
-						typeset distro_string=""
-						if [ "${l_DIST}" = "opensuse" ]; then
-							distro_string="OpenSuSE:"
-
-							typeset -i tmp_suse_major_version="0"
-							tmp_suse_major_version="$(sed -e 's/\([0-9]*\).*/\1/' <<< "${l_CODENAME}")"
-
-							if [ "x${tmp_suse_major_version}" = "x0" ]; then
-								echo "Unable to extract SUSE version."
-								exit 1
-							fi
-
-							[ "${tmp_suse_major_version}" -gt "13" ] && distro_string="${distro_string}Leap:"
-							distro_string="${distro_string}${l_CODENAME}"
-						else
-							distro_string="SLE:"
-
-							# Split up version in major version and service pack.
-							typeset -i major="0"
-							typeset -i sp="0"
-							typeset -i i="0"
-							typeset other=""
-							typeset -a read_arr
-							while IFS='.' read -ra read_arr; do
-								for i in "${read_arr[@]}"; do
-									if [ "${i}" = "0" ]; then
-										major="${read_arr[${i}]}"
-
-										[ "${major}" != "${read_arr[${i}]}" ] && {
-											echo "Major SUSE version is not a valid integer, aborting." >&2
-											exit 1
-										}
-									elif [ "${i}" = "1" ]; then
-										sp="${read_arr[${i}]}"
-
-										[ "${sp}" != "${read_arr[${i}]}" ] && {
-											echo "SUSE service pack version is not a valid integer, aborting." >&2
-											exit 1
-										}
-									else
-										other="${other}.${read_arr[${i}]}"
-									fi
-								done
-							done <<< "${l_CODENAME}"
-
-							distro_string="${distro_string}${major}"
-							[ "${sp}" -gt "0" ] && distro_string="${distro_string}:SP${sp}"
-							[ -n "${other}" ] && distro_string="${distro_string}${other}"
-						fi
-						0</dev/null ssh "${REPOS_SERVER}" "cd '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/' && ~/bin/createsusetagsrepo '.' '${distro_string}' '${l_CODENAME}'"
 					else
 						# create remote directories in archive
 						0</dev/null ssh "${REPOS_SERVER}" "mkdir -p -- '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/${l_ARCH}/rpms/${PROJECT}'"
@@ -1051,6 +1001,61 @@ upload_packages() {
 					fi
 				fi
 			done
+
+			# For *SUSE, we only need to run the repo generation once, since all architectures are part of one repository.
+			if [ "${l_DIST}" = "opensuse" ] || [ "${l_DIST}" = "sle" ]; then
+				typeset distro_string=""
+				if [ "${l_DIST}" = "opensuse" ]; then
+					distro_string="OpenSuSE:"
+
+					typeset -i tmp_suse_major_version="0"
+					tmp_suse_major_version="$(sed -e 's/\([0-9]*\).*/\1/' <<< "${l_CODENAME}")"
+
+					if [ "x${tmp_suse_major_version}" = "x0" ]; then
+						echo "Unable to extract SUSE version."
+						exit 1
+					fi
+
+					[ "${tmp_suse_major_version}" -gt "13" ] && distro_string="${distro_string}Leap:"
+					distro_string="${distro_string}${l_CODENAME}"
+				else
+					distro_string="SLE:"
+
+					# Split up version in major version and service pack.
+					typeset -i major="0"
+					typeset -i sp="0"
+					typeset -i i="0"
+					typeset other=""
+					typeset -a read_arr
+					while IFS='.' read -ra read_arr; do
+						for i in "${read_arr[@]}"; do
+							if [ "${i}" = "0" ]; then
+								major="${read_arr[${i}]}"
+
+								[ "${major}" != "${read_arr[${i}]}" ] && {
+									echo "Major SUSE version is not a valid integer, aborting." >&2
+									exit 1
+								}
+							elif [ "${i}" = "1" ]; then
+								sp="${read_arr[${i}]}"
+
+								[ "${sp}" != "${read_arr[${i}]}" ] && {
+									echo "SUSE service pack version is not a valid integer, aborting." >&2
+									exit 1
+								}
+							else
+								other="${other}.${read_arr[${i}]}"
+							fi
+						done
+					done <<< "${l_CODENAME}"
+
+					distro_string="${distro_string}${major}"
+					[ "${sp}" -gt "0" ] && distro_string="${distro_string}:SP${sp}"
+					[ -n "${other}" ] && distro_string="${distro_string}${other}"
+				fi
+
+				0</dev/null ssh "${REPOS_SERVER}" "cd '${RPM_REPOS_BASE}/${l_DIST}/${l_CODENAME}/${COMPONENT}/' && ~/bin/createsusetagsrepo '.' '${distro_string}' '${l_CODENAME}'"
+			fi
 		done
 	done
 	return 0

--
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