aboutsummaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-02-21 10:08:49 -0800
committerGuy Harris <guy@alum.mit.edu>2018-02-21 18:09:30 +0000
commit70554429a6aaeab8302766ed878b981404d16e7e (patch)
treee4b1ffd539d9723badfe1d21007273525b3bb0db /packaging
parent9788199a61f201cf0347400e05cc10a62bb7b3e6 (diff)
Fix detection of file type.
Some versions of otool print the file name as the first line when you run it with -hv, so that the line containing the file type is the fourth line; others don't print it, so that it's the third line. Instead, look for the line that has MH_MAGIC. Change-Id: Ib14f6b24f14069532263332e53a1e9895663641a Reviewed-on: https://code.wireshark.org/review/25968 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'packaging')
-rwxr-xr-xpackaging/macosx/osx-app.sh.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/packaging/macosx/osx-app.sh.in b/packaging/macosx/osx-app.sh.in
index c6361e3b2a..8bf91782e7 100755
--- a/packaging/macosx/osx-app.sh.in
+++ b/packaging/macosx/osx-app.sh.in
@@ -317,7 +317,7 @@ rpathify_file () {
#
# OK, what type of file is this?
#
- filetype=$( otool -hv "$1" | sed -n '4p' | awk '{print $5}' ; exit ${PIPESTATUS[0]} )
+ filetype=$( otool -hv "$1" | egrep MH_MAGIC | awk '{print $5}' ; exit ${PIPESTATUS[0]} )
if [ $? -ne 0 ] ; then
echo "Unable to rpathify $1 in $( pwd ): file type failed."
exit 1