[X2Go-Commits] [buildscripts] 05/12: bin/build-rpm-package: remove SUSE-specific version fetching functions and use the new generic ones in bin/common.sh

git-admin at x2go.org git-admin at x2go.org
Thu Apr 6 08:34:54 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 67414a20a45485727f0893c2dfe24c3850d76bee
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Apr 6 08:27:52 2017 +0200

    bin/build-rpm-package: remove SUSE-specific version fetching functions and use the new generic ones in bin/common.sh
---
 bin/build-rpm-package | 52 +++++----------------------------------------------
 1 file changed, 5 insertions(+), 47 deletions(-)

diff --git a/bin/build-rpm-package b/bin/build-rpm-package
index a3dc549..09301de 100755
--- a/bin/build-rpm-package
+++ b/bin/build-rpm-package
@@ -567,48 +567,6 @@ get_extra_repository () {
 	return 0
 }
 
-# Fetches major version out of a SUSE version string.
-# The format is expected to be "X.Y" with X and Y being positive integers.
-# The return code is either 0 or 1, with 0 meaning success and 1 failure.
-# The detected major version is written to STDOUT.
-get_suse_major_version () {
-	typeset suse_version="${1}"
-	typeset -i ret="0"
-
-	if [ -z "${suse_version}" ]; then
-		ret="1"
-	else
-		typeset -i tmp_suse_major_version="0"
-		tmp_suse_major_version="$(sed -e '/^\([0-9][0-9]*\)\.[0-9][0-9]*$/!d;s//\1/' <<< "${suse_version}")"
-
-		if [ "${tmp_suse_major_version}" -ne "0" ]; then
-			echo "${tmp_suse_major_version}"
-		fi
-	fi
-
-	return "${ret}"
-}
-
-# Fetches minor version out of a SUSE version string.
-# The format is expected to be "X.Y" with X and Y being positive integers.
-# The return code is either 0 or 1, with 0 meaning success and 1 failure.
-# The detected minor version is written to STDOUT.
-get_suse_minor_version () {
-	typeset suse_version="${1}"
-	typeset -i ret="0"
-
-	if [ -z "${suse_version}" ]; then
-		ret="1"
-	else
-		typeset -i tmp_suse_minor_version="-1"
-		tmp_suse_minor_version="$(sed -e '/^[0-9][0-9]*\.\([0-9][0-9]*\)$/!d;s//\1/' <<< "${suse_version}")"
-
-		echo "${tmp_suse_minor_version}"
-	fi
-
-	return "${ret}"
-}
-
 prepare_workspace() {
 	# make sure our local working copy is up to date...
 	if [ -d "${PROJECT_DIR}/.git" ]; then
@@ -794,7 +752,7 @@ build_packages() {
 					BUILD_RESULT="/home/abuild/rpmbuild/"
 
 					typeset -i tmp_suse_major_version="0"
-					tmp_suse_major_version="$(get_suse_major_version "${l_CODENAME}")"
+					tmp_suse_major_version="$(get_generic_major_version "${l_CODENAME}")"
 
 					if [ "${?}" -ne "0" ]; then
 						echo "Unable to extract SUSE version."
@@ -845,7 +803,7 @@ build_packages() {
 							done
 
 							typeset -i tmp_suse_major_version="0"
-							tmp_suse_major_version="$(get_suse_major_version "${l_CODENAME}")"
+							tmp_suse_major_version="$(get_generic_major_version "${l_CODENAME}")"
 
 							if [ "${?}" -ne "0" ]; then
 								echo "Unable to extract SUSE version."
@@ -932,7 +890,7 @@ build_packages() {
 							done
 
 							typeset -i tmp_suse_major_version="0"
-							tmp_suse_major_version="$(get_suse_major_version "${l_CODENAME}")"
+							tmp_suse_major_version="$(get_generic_major_version "${l_CODENAME}")"
 
 							if [ "${?}" -ne "0" ]; then
 								echo "Unable to extract SUSE version."
@@ -1078,14 +1036,14 @@ upload_packages() {
 
 					typeset -i tmp_suse_major_version="0"
 					typeset -i tmp_suse_minor_version="0"
-					tmp_suse_major_version="$(get_suse_major_version "${l_CODENAME}")"
+					tmp_suse_major_version="$(get_generic_major_version "${l_CODENAME}")"
 
 					if [ "${?}" -ne "0" ]; then
 						echo "Unable to extract major SUSE version."
 						exit "1"
 					fi
 
-					tmp_suse_minor_version="$(get_suse_minor_version "${l_CODENAME}")"
+					tmp_suse_minor_version="$(get_generic_minor_version "${l_CODENAME}")"
 
 					if [ "${?}" -ne "0" ]; then
 						echo "Unable to extract minor SUSE version."

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