summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth Parker <csparker247@gmail.com>2021-04-26 08:55:07 -0400
committerMorten Johan Sørvig <morten.sorvig@qt.io>2021-05-03 18:42:12 +0000
commitd34cf4045c680a9ac85e48da74f89ac3aa0d17b2 (patch)
tree5b4e5483ca222d1ec33b0c2537c7a55a0ca341a5
parentb5e04094cdd6cc2dab2d410876164e3bcb863b98 (diff)
downloadqttools-d34cf4045c680a9ac85e48da74f89ac3aa0d17b2.tar.gz
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-92238 Task-number: QTBUG-91644 Change-Id: Ibbfa40efcd046f386f9001f92bf956518176ecc7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 7f3bcf85f1041e7e56dba37593dcd80f2054c221)
-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 e72ca8e4a..0f87cc76a 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) {