permissions: Take PlistBuddy exit code into account when reading Info.plist

Otherwise we might conclude that we found a usage description when
PlistBuddy outputs "Error Reading File: /tmp/Info.plist" to stdout.

For CMake this is not an issue as we pipe stderr to a separate variable,
that contains "Cannot parse a NULL or zero-length data" in this case.

Fixes: QTBUG-109967
Pick-to: 6.5
Change-Id: I9d819b6de405b88bb7d1d75c22b6f5187f26e553
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Tor Arne Vestbø 2023-01-16 14:24:54 +01:00
parent 1b4aba0a59
commit ada434e417

View File

@ -6,14 +6,23 @@ for(plugin, QT_PLUGINS) {
next()
usage_descriptions = $$eval(QT_PLUGIN.$${plugin}.usage_descriptions)
found_usage_description = false
for(usage_description_key, usage_descriptions) {
usage_description = $$system("/usr/libexec/PlistBuddy" \
"-c 'print $$usage_description_key' $$QMAKE_INFO_PLIST 2>/dev/null")
!isEmpty(usage_description): \
"-c 'print $$usage_description_key' $$QMAKE_INFO_PLIST 2>/dev/null", \
singleLine, exit_code)
!equals(exit_code, 0): \
next()
!isEmpty(usage_description) {
found_usage_description = true
break()
}
}
isEmpty(usage_description): \
!$$found_usage_description: \
next()
request_flag = $$eval(QT_PLUGIN.$${plugin}.request_flag)