[X2Go-Commits] [x2goclient] 90/138: macbuild.sh: rewrite ID line detection algorithm.
git-admin at x2go.org
git-admin at x2go.org
Mon Jan 18 22:48:42 CET 2016
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch bugfix/osx
in repository x2goclient.
commit cd6f85202d66ea9353d107d43289e00974ab1437
Author: Mihai Moldovan <ionic at ionic.de>
Date: Wed Sep 30 23:44:30 2015 +0200
macbuild.sh: rewrite ID line detection algorithm.
Modules don't seem to be needing one, so skipping the first dependency
line incidentally skips a "real" dependency for modules.
---
debian/changelog | 3 +++
macbuild.sh | 17 ++++++++++++-----
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 33b03f8..8b5e36d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -179,6 +179,9 @@ x2goclient (4.0.5.1-0x2go1) UNRELEASED; urgency=low
- macbuild.sh: fix removal of base prefix in deduplication if base prefix
ends in a slash.
- macbuild.sh: copy "special" files, so that they can be removed later on.
+ - macbuild.sh: rewrite ID line detection algorithm. Modules don't seem to
+ be needing one, so skipping the first dependency line incidentally skips
+ a "real" dependency for modules.
* debian/control:
- Change apache2-dev | libc6-dev build dependency back to apache2-dev
only. Otherwise, apache2-dev is not installed at all, even though
diff --git a/macbuild.sh b/macbuild.sh
index 9bba392..c95955e 100755
--- a/macbuild.sh
+++ b/macbuild.sh
@@ -119,19 +119,26 @@ parse_otool_output() {
typeset oldifs="${IFS}"
IFS=''
- # Used for skipping the first matching entry - which should typically be the ID line...
- # That's a very naïve way to do this. Maybe there should be a bit more magic
- # to catch this more reliably.
- typeset -i first="1"
+ # Used for skipping the ID entry.
+ # Initialized to the empty string, but the first matching line will set it once.
+ # The ID filename is required for subsequent dependency discovery.
+ typeset id=""
typeset line=""
while read -r line; do
if [[ "${line}" =~ ${tmp_regex} ]]; then
- if [ "${first}" -ne "1" ]; then
+ typeset file="${BASH_REMATCH[1]}"
+
+ if [ -z "${id}" ]; then
+ echo "ID unset, something is wrong" >&2
+ return 1
+ elif [ "$(basename "${file}")" != "${id}" ]; then
echo "${BASH_REMATCH[1]}"
else
first="0"
fi
+ elif [ -z "${id}" ]; then
+ id="$(basename "${line%":"}")"
fi
done <<< "${raw_output}"
--
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