[X2Go-Commits] [x2goclient] 90/95: macbuild.sh: rewrite ID line detection algorithm.
git-admin at x2go.org
git-admin at x2go.org
Thu Oct 29 03:34:07 CET 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 62a4003a4cf988436643a1cc88f3323c637fd717
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 ef3bbbf..456eac3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -160,6 +160,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.
[ Oleksandr Shneyder ]
* New upstream release (4.0.5.1):
diff --git a/macbuild.sh b/macbuild.sh
index 8b65ef6..2df3c1a 100755
--- a/macbuild.sh
+++ b/macbuild.sh
@@ -117,19 +117,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