[X2Go-Commits] [x2goclient] 36/44: macbuild.sh: add new lazy_canonical_path() helper function.

git-admin at x2go.org git-admin at x2go.org
Fri May 29 00:01:34 CEST 2015


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

x2go pushed a commit to branch bugfix/osx
in repository x2goclient.

commit e1ac5ef13f4cc2efffe7b1a6b7d20f027ad04f35
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Sun May 3 23:21:31 2015 +0200

    macbuild.sh: add new lazy_canonical_path() helper function.
---
 debian/changelog |    1 +
 macbuild.sh      |   12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index e0ca61c..b9a5307 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -65,6 +65,7 @@ x2goclient (4.0.4.1-0x2go1) UNRELEASED; urgency=low
     - x2goclient.pro{,.maemo}: reference new pulsemanager.{cpp,h} files.
     - macbuild.sh: add new MACPORTS_PREFIX detection/variable.
     - macbuild.sh: add new dependency_error() helper function.
+    - macbuild.sh: add new lazy_canonical_path() helper function.
 
  -- X2Go Release Manager <git-admin at x2go.org>  Tue, 26 May 2015 21:42:09 +0200
 
diff --git a/macbuild.sh b/macbuild.sh
index 10b0f50..f222df8 100755
--- a/macbuild.sh
+++ b/macbuild.sh
@@ -53,6 +53,18 @@ dependency_error() {
 	exit 3
 }
 
+lazy_canonical_path() {
+	typeset path="${1}"
+
+	typeset old_path=""
+	while [ "${old_path}" != "${path}" ]; do
+		old_path="${path}"
+		path="${path//\/\///}"
+	done
+
+	printf "${old_path}"
+}
+
 MATCH_HELP='(^((-h)|(--help))([ 	]|$))|([ 	]+((-h)|(--help))([ 	]|$))'
 [ -n "${*}" ] && [[ "${*}" =~ ${MATCH_HELP} ]] && usage
 

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