[X2Go-Commits] [x2goclient] 84/87: macbuild.sh: define, implement and use new function 'make_boolean()'.

git-admin at x2go.org git-admin at x2go.org
Wed Mar 4 22:15:03 CET 2015


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

x2go pushed a commit to branch feature/cleanup
in repository x2goclient.

commit cff5d9a9dd1dd11662668a205fae850d888c3a24
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Wed Feb 18 03:21:13 2015 +0100

    macbuild.sh: define, implement and use new function 'make_boolean()'.
    
    Takes a pseudo-boolean value and outputs either 0 or 1.
---
 debian/changelog |    2 ++
 macbuild.sh      |   25 ++++++++++++++++---------
 2 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b65d53e..daba38d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -251,6 +251,8 @@ x2goclient (4.0.3.2-0x2go1) unstable; urgency=medium
       client build directory. Remove redundancy from macbuild.sh.
     - Remove 'function' keyword in macbuild.sh, as it's causing undefined
       behavior according to SUS.
+    - Define and implement new function 'make_boolean()' in macbuild.sh. Takes
+      a pseudo-boolean value and outputs either 0 or 1. Use this function.
 
  -- X2Go Release Manager <git-admin at x2go.org>  Thu, 19 Feb 2015 12:49:22 +0100
 
diff --git a/macbuild.sh b/macbuild.sh
index 9e6ba76..c5e25d5 100755
--- a/macbuild.sh
+++ b/macbuild.sh
@@ -16,15 +16,22 @@ NXPROXY="$(which nxproxy)"
 : ${DEBUG:="0"}
 : ${BUNDLE:="1"}
 
-case "${DEBUG}" in
-	("0"|"no"|""|"No"|"nO"|"NO"|"false"|"FALSE") BUILD_MODE="release";;
-	(*) BUILD_MODE="debug";;
-esac
-
-case "${BUNDLE}" in
-	("0"|"no"|""|"No"|"nO"|"NO"|"false"|"FALSE") BUNDLE="0";;
-	(*) BUNDLE="1";;
-esac
+
+make_boolean() {
+	OPTION="${1}"
+
+	case "${OPTION}" in
+		("0"|"no"|""|"No"|"nO"|"NO"|"false"|"FALSE") OPTION="0";;
+		(*) OPTION="1";;
+	esac
+
+	printf "${OPTION}"
+}
+
+DEBUG="$(make_boolean "${DEBUG}")"
+BUNDLE="$(make_boolean "${BUNDLE}")"
+
+[ "${DEBUG}" -eq "0" ] && BUILD_MODE="release" || BUILD_MODE="debug"
 
 SDK_MINOR_VERSION="$(/usr/bin/perl -pe 's#.*?10\.(\d+).*?\.sdk$#\1#' <<< "${SDK}")"
 

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


More information about the x2go-commits mailing list