This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 37984f1b4513373386f93ea27c6308fc9aa3be8f Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:22:49 2015 +0200 macbuild.sh: add new get_nesting_level() helper function. --- debian/changelog | 1 + macbuild.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/debian/changelog b/debian/changelog index b5c5f15..f65c047 100644 --- a/debian/changelog +++ b/debian/changelog @@ -77,6 +77,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium - 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. + - macbuild.sh: add new get_nesting_level() helper function. [ Bernard Cafarelli ] * New upstream version (4.0.5.3): diff --git a/macbuild.sh b/macbuild.sh index 0c8e47b..5df4670 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -67,6 +67,20 @@ lazy_canonical_path() { printf "${old_path}" } +get_nesting_level() { +set -x + typeset -i level=0 + typeset path="${1}" + + while [ -n "${path}" ] && [ "${path}" != "." ] && [ "${path}" != "/" ]; do + i="$((${i} + 1))" + path="$(dirname "${path}")" + done + + printf "${level}" +set +x +} + 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