[X2Go-Commits] [x2goclient] 58/116: deduplicate.sh: new function for parsing otool's output and printing library dependencies if no error occurred.

git-admin at x2go.org git-admin at x2go.org
Mon Nov 30 05:07:48 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 2cb92b497e307f5bd5faffe243a5b05b879fef1f
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Wed Aug 26 22:28:09 2015 +0200

    deduplicate.sh: new function for parsing otool's output and printing library dependencies if no error occurred.
---
 debian/changelog |    2 ++
 deduplicate.sh   |   27 +++++++++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 2546309..3d4b75c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -103,6 +103,8 @@ x2goclient (4.0.5.1-0x2go1) UNRELEASED; urgency=low
       Progress file deduplication script.
     - deduplicate.sh: add duplicates-to-real mapping.
     - deduplicate.sh: add missed local variable declaration.
+    - deduplicate.sh: new function for parsing otool's output and printing
+      library dependencies if no error occurred.
 
   [ Oleksandr Shneyder ]
   * New upstream release (4.0.5.1):
diff --git a/deduplicate.sh b/deduplicate.sh
index 30fd3ad..a5b59e9 100755
--- a/deduplicate.sh
+++ b/deduplicate.sh
@@ -6,6 +6,33 @@ base_dir="${1:?"No base dir given."}"
 typeset -a special_files_regex
 special_files_regex+=( "pulseaudio/libpulsecommon-[0-9]\.[0-9]\.dylib" )
 
+typeset -a otool_fail_str
+otool_fail_str=( "is not an object file"
+		 "can't open file"
+		 "Archive : " )
+
+parse_otool_output() {
+	typeset raw_output="${@}"
+
+	typeset fail_str=""
+	for fail_str in ${otool_fail_str}; do
+		if ! echo "${raw_output}" | grep -q "${fail_str}"; then
+			exit 1
+		fi
+	done
+
+	typeset tmp_regex='^[[:space:]]+(.*)[[:space:]]\(compatibility version .*, current version .*\)'
+
+	typeset line=""
+	while read -r line; do
+		if [[ "${line}" =~ ${tmp_regex} ]]; then
+			echo "${BASH_REMATCH[1]}"
+		fi
+	done <<< "${raw_output}"
+
+	exit 0
+}
+
 typeset -a all_files
 typeset entry=""
 while read -r -d '' entry; do

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