From 8e27fcb3fe68e4c285807eb02e3603abb5f1a0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 18 Apr 2013 13:06:46 +0200 Subject: 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 --- mkspecs/features/mac/sdk.prf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mkspecs') 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 '/^&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'") -- cgit v1.2.3