summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-04-18 13:06:46 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-18 22:02:18 +0200
commit8e27fcb3fe68e4c285807eb02e3603abb5f1a0fb (patch)
tree72b739c5248cc3cded6ee2bd8a2e74d8586da8bc
parentb9450734c9bc2811fd6e04379ce8290ca041b4e2 (diff)
Harden check for SDK platform name on Mac OS
We now use an absolute path, to prevent picking up the wrong plutil binary. In addition we pipe the possible stderr output of plutil and xpath to the null device, so that the final QMAKE_MAC_PLATFORM_NAME will be empty in case of any errors, and caught by the isEmpty() check below. Change-Id: I8ad24bf63162a76410c2ae223dd2fc48e7886bbf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
-rw-r--r--mkspecs/features/mac/sdk.prf4
1 files changed, 2 insertions, 2 deletions
diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
index ece0e27536..f5b1639a5d 100644
--- a/mkspecs/features/mac/sdk.prf
+++ b/mkspecs/features/mac/sdk.prf
@@ -31,9 +31,9 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_
}
# We use xml as the output format instead of json since plutil on 10.6 does not have that option
-QMAKE_MAC_PLATFORM_NAME = $$system("plutil -convert xml1 \"$$QMAKE_MAC_SDK_PATH/SDKSettings.plist\" -o - | " \
+QMAKE_MAC_PLATFORM_NAME = $$system("/usr/bin/plutil -convert xml1 \"$$QMAKE_MAC_SDK_PATH/SDKSettings.plist\" -o - 2>/dev/null | " \
"sed '/^<!DOCTYPE/d' | " \ # Don't look up http://www.apple.com/DTDs/PropertyList-1.0.dtd
- "PERL5LIB= xpath 'string(//key[.=\"PLATFORM_NAME\"]/following-sibling::*[1])' 2>&1 | " \
+ "PERL5LIB= xpath 'string(//key[.=\"PLATFORM_NAME\"]/following-sibling::*[1])' 2>/dev/null | " \
"sed 's/.*Value: \\(.*\\)/\\1/'")
isEmpty(QMAKE_MAC_PLATFORM_NAME): error("Could not resolve platform name for SDK '$$QMAKE_MAC_SDK'")