summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeth Parker <csparker247@gmail.com>2021-04-26 08:55:07 -0400
committerSeth Parker <csparker247@gmail.com>2021-04-27 13:48:31 -0400
commit7f3bcf85f1041e7e56dba37593dcd80f2054c221 (patch)
treea26a12897ae3febc8cacb6ecb40bf970f650be20
parent4cc0cb9a43b8156aae1a497c12ba025f52fe1286 (diff)
macdeployqt: Fix bug parsing otool output when deploying plugins
Fixes bug where a dependency would get skipped if otool didn't return the plugin lib as the first entry. [ChangeLog][macOS][macdeployqt] Fix plugin deployment bug caused by otool parsing Fixes: QTBUG-91644 Change-Id: Ibbfa40efcd046f386f9001f92bf956518176ecc7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
-rw-r--r--src/macdeployqt/shared/shared.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp
index ac1f5777c..a44a4f284 100644
--- a/src/macdeployqt/shared/shared.cpp
+++ b/src/macdeployqt/shared/shared.cpp
@@ -195,13 +195,19 @@ OtoolInfo findDependencyInfo(const QString &binaryPath)
if (binaryPath.contains(".framework/") || binaryPath.endsWith(".dylib")) {
const auto match = regexp.match(outputLines.first());
if (match.hasMatch()) {
- info.installName = match.captured(1);
- info.compatibilityVersion = QVersionNumber::fromString(match.captured(2));
- info.currentVersion = QVersionNumber::fromString(match.captured(3));
+ QString installname = match.captured(1);
+ if (QFileInfo(binaryPath).fileName() == QFileInfo(installname).fileName()) {
+ info.installName = installname;
+ info.compatibilityVersion = QVersionNumber::fromString(match.captured(2));
+ info.currentVersion = QVersionNumber::fromString(match.captured(3));
+ outputLines.removeFirst();
+ } else {
+ info.installName = binaryPath;
+ }
} else {
LogError() << "Could not parse otool output line:" << outputLines.first();
+ outputLines.removeFirst();
}
- outputLines.removeFirst();
}
for (const QString &outputLine : outputLines) {