From 7fedb50c74b01c409d17a435c8529bd6a7803ce0 Mon Sep 17 00:00:00 2001 From: probonopd Date: Tue, 6 Sep 2016 00:01:56 +0200 Subject: [PATCH] Reflect the fact that we are using ldd rather than otool --- shared/shared.cpp | 34 +++++++++++++++++----------------- shared/shared.h | 8 ++++---- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/shared/shared.cpp b/shared/shared.cpp index 7abbca4..96344f8 100644 --- a/shared/shared.cpp +++ b/shared/shared.cpp @@ -144,19 +144,19 @@ bool linkFilePrintStatus(const QString &file, const QString &link) } } -OtoolInfo findDependencyInfo(const QString &binaryPath) +LddInfo findDependencyInfo(const QString &binaryPath) { - OtoolInfo info; + LddInfo info; info.binaryPath = binaryPath; LogDebug() << "Using ldd:"; LogDebug() << " inspecting" << binaryPath; - QProcess otool; - otool.start("ldd", QStringList() << binaryPath); - otool.waitForFinished(); + QProcess ldd; + ldd.start("ldd", QStringList() << binaryPath); + ldd.waitForFinished(); - if (otool.exitStatus() != QProcess::NormalExit || otool.exitCode() != 0) { - LogError() << "findDependencyInfo:" << otool.readAllStandardError(); + if (ldd.exitStatus() != QProcess::NormalExit || ldd.exitCode() != 0) { + LogError() << "findDependencyInfo:" << ldd.readAllStandardError(); return info; } @@ -170,7 +170,7 @@ OtoolInfo findDependencyInfo(const QString &binaryPath) */ - QString output = otool.readAllStandardOutput(); + QString output = ldd.readAllStandardOutput(); QStringList outputLines = output.split("\n", QString::SkipEmptyParts); if (outputLines.size() < 2) { if (output.contains("statically linked") == false){ @@ -209,7 +209,7 @@ OtoolInfo findDependencyInfo(const QString &binaryPath) return info; } -LibraryInfo parseOtoolLibraryLine(const QString &line, const QString &appBundlePath, const QSet &rpaths, bool useDebugLibs) +LibraryInfo parseLddLibraryLine(const QString &line, const QString &appBundlePath, const QSet &rpaths, bool useDebugLibs) { LibraryInfo info; QString trimmed = line.trimmed(); @@ -358,7 +358,7 @@ QList getQtLibraries(const QList &dependencies, const QS { QList libraries; for (const DylibInfo &dylibInfo : dependencies) { - LibraryInfo info = parseOtoolLibraryLine(dylibInfo.binaryPath, appBundlePath, rpaths, useDebugLibs); + LibraryInfo info = parseLddLibraryLine(dylibInfo.binaryPath, appBundlePath, rpaths, useDebugLibs); if (info.libraryName.isEmpty() == false) { LogDebug() << "Adding library:"; LogDebug() << info; @@ -373,19 +373,19 @@ QSet getBinaryRPaths(const QString &path, bool resolve = true, QString { QSet rpaths; - QProcess otool; - otool.start("objdump", QStringList() << "-x" << path); - otool.waitForFinished(); + QProcess ldd; + ldd.start("objdump", QStringList() << "-x" << path); + ldd.waitForFinished(); - if (otool.exitCode() != 0) { - LogError() << "getBinaryRPaths:" << otool.readAllStandardError(); + if (ldd.exitCode() != 0) { + LogError() << "getBinaryRPaths:" << ldd.readAllStandardError(); } if (resolve && executablePath.isEmpty()) { executablePath = path; } - QString output = otool.readAllStandardOutput(); + QString output = ldd.readAllStandardOutput(); QStringList outputLines = output.split("\n"); QStringListIterator i(outputLines); @@ -407,7 +407,7 @@ QSet getBinaryRPaths(const QString &path, bool resolve = true, QString QList getQtLibraries(const QString &path, const QString &appBundlePath, const QSet &rpaths, bool useDebugLibs) { - const OtoolInfo info = findDependencyInfo(path); + const LddInfo info = findDependencyInfo(path); return getQtLibraries(info.dependencies, appBundlePath, rpaths + getBinaryRPaths(path), useDebugLibs); } diff --git a/shared/shared.h b/shared/shared.h index ba83c3f..d41fd52 100644 --- a/shared/shared.h +++ b/shared/shared.h @@ -70,7 +70,7 @@ public: QVersionNumber compatibilityVersion; }; -class OtoolInfo +class LddInfo { public: QString installName; @@ -107,11 +107,11 @@ inline QDebug operator<<(QDebug debug, const ApplicationBundleInfo &info); void changeQtLibraries(const QString appPath, const QString &qtPath, bool useDebugLibs); void changeQtLibraries(const QList libraries, const QStringList &binaryPaths, const QString &qtPath); -OtoolInfo findDependencyInfo(const QString &binaryPath); -LibraryInfo parseOtoolLibraryLine(const QString &line, const QString &appBundlePath, const QSet &rpaths, bool useDebugLibs); +LddInfo findDependencyInfo(const QString &binaryPath); +LibraryInfo parseLddLibraryLine(const QString &line, const QString &appBundlePath, const QSet &rpaths, bool useDebugLibs); QString findAppBinary(const QString &appBundlePath); QList getQtLibraries(const QString &path, const QString &appBundlePath, const QSet &rpaths, bool useDebugLibs); -QList getQtLibraries(const QStringList &otoolLines, const QString &appBundlePath, const QSet &rpaths, bool useDebugLibs); +QList getQtLibraries(const QStringList &lddLines, const QString &appBundlePath, const QSet &rpaths, bool useDebugLibs); QString copyLibrary(const LibraryInfo &library, const QString path); DeploymentInfo deployQtLibraries(const QString &appBundlePath, const QStringList &additionalExecutables, bool useDebugLibs); DeploymentInfo deployQtLibraries(QList libraries,const QString &bundlePath, const QStringList &binaryPaths, bool useDebugLibs, bool useLoaderPath);