[X2Go-Commits] [buildscripts] 01/01: bin/build-deb-package: fix various issues (see upcoming list.) Fixes: #1051.

git-admin at x2go.org git-admin at x2go.org
Mon Jul 4 21:59:22 CEST 2016


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

x2go pushed a commit to branch master
in repository buildscripts.

commit 8bb92fd510b40fe80759460fb96c1fafa1423fba
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Mon Jul 4 21:53:34 2016 +0200

    bin/build-deb-package: fix various issues (see upcoming list.) Fixes: #1051.
    
      - typeset -l makes the content lowercase, not the variable "local"
        (that's implied by using typeset.) Hence, drop it where
        inappropriate.
      - typeset -l is only available in BASH 4 and higher. Use it
        conditionally only.
      - Use tr to convert strings to lowercase when using a BASH version
        lower than 4.
---
 bin/build-deb-package |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/bin/build-deb-package b/bin/build-deb-package
index de63401..74887fa 100755
--- a/bin/build-deb-package
+++ b/bin/build-deb-package
@@ -262,7 +262,11 @@ build_packages() {
 				}
 
 				# for Ubuntu version is the codename of the distribution release
-				typeset -l codename="${l_CODENAME}"
+				if [ -n "${BASH_VERSINFO[0]}" ] && [ "${BASH_VERSINFO[0]}" -gt 3 ]; then
+					typeset -l codename="${l_CODENAME}"
+				else
+					typeset codename="$(tr '[:upper:]' '[:lower:]' <<< "${l_CODENAME}")"
+				fi
 
 				# translate the version name for Debian releases
 				[ "x${l_CODENAME}" = "xsid" ] && codename="unstable"
@@ -270,9 +274,9 @@ build_packages() {
 				#[ "x$l_CODENAME" = "xwheezy" ] && codename=stable
 				#[ "x$l_CODENAME" = "xoldstable" ] && codename=oldstable
 
-				typeset -l numerical_version=""
-				typeset -l -i tmp_ret="1"
-				typeset -l pretty_dist=""
+				typeset numerical_version=""
+				typeset -i tmp_ret="1"
+				typeset pretty_dist=""
 
 				if [ -n "${l_DIST}" ] && [ "${l_DIST}" = "debian" ]; then
 					pretty_dist="Debian"
@@ -286,7 +290,7 @@ build_packages() {
 					tmp_ret="${?}"
 				fi
 
-				if [ "${tmp_ret}" -ne "0" ]; then
+				if [ "${tmp_ret}" -ne "0" ] || [ -z "${numerical_version}" ]; then
 					echo "Error: unable to map code name \"${codename}\" to Debian or Ubuntu numerical versions. Unknown code name or not applicable to distribution \"${pretty_dist}\"? Aborting." >&2
 					exit 1
 				fi

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