Browse Source

Use more descriptive names

master
probonopd 9 years ago
committed by GitHub
parent
commit
438fc5d1b8
  1. 31
      shared/shared.cpp

31
shared/shared.cpp

@ -328,30 +328,30 @@ QSet<QString> getBinaryRPaths(const QString &path, bool resolve = true, QString
{ {
QSet<QString> rpaths; QSet<QString> rpaths;
QProcess ldd; QProcess objdump;
ldd.start("objdump", QStringList() << "-x" << path); objdump.start("objdump", QStringList() << "-x" << path);
if (!ldd.waitForStarted()) { if (!objdump.waitForStarted()) {
if(ldd.errorString().contains("execvp: No such file or directory")){ if(objdump.errorString().contains("execvp: No such file or directory")){
LogError() << "Could not start ldd."; LogError() << "Could not start objdump.";
LogError() << "Make sure it is installed on your $PATH."; LogError() << "Make sure it is installed on your $PATH.";
} else { } else {
LogError() << "Could not start ldd. Process error is" << ldd.errorString(); LogError() << "Could not start objdump. Process error is" << objdump.errorString();
} }
exit(1); exit(1);
} }
ldd.waitForFinished(); objdump.waitForFinished();
if (ldd.exitCode() != 0) { if (objdump.exitCode() != 0) {
LogError() << "getBinaryRPaths:" << ldd.readAllStandardError(); LogError() << "getBinaryRPaths:" << objdump.readAllStandardError();
} }
if (resolve && executablePath.isEmpty()) { if (resolve && executablePath.isEmpty()) {
executablePath = path; executablePath = path;
} }
QString output = ldd.readAllStandardOutput(); QString output = objdump.readAllStandardOutput();
QStringList outputLines = output.split("\n"); QStringList outputLines = output.split("\n");
QStringListIterator i(outputLines); QStringListIterator i(outputLines);
@ -653,10 +653,12 @@ DeploymentInfo deployQtLibraries(QList<LibraryInfo> libraries,
DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &additionalExecutables) DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &additionalExecutables)
{ {
AppDirInfo applicationBundle; AppDirInfo applicationBundle;
applicationBundle.path = appDirPath; applicationBundle.path = appDirPath;
LogDebug() << "applicationBundle.path:" << applicationBundle.path; LogDebug() << "applicationBundle.path:" << applicationBundle.path;
applicationBundle.binaryPath = findAppBinary(appDirPath); applicationBundle.binaryPath = findAppBinary(appDirPath);
LogDebug() << "applicationBundle.binaryPath:" << applicationBundle.binaryPath; LogDebug() << "applicationBundle.binaryPath:" << applicationBundle.binaryPath;
LogError() << "FIXME: Here I would like to determine the original rpath of the main executable, but get:" << getBinaryRPaths(applicationBundle.binaryPath, true);
changeIdentification("$ORIGIN/" + bundleLibraryDirectory, applicationBundle.binaryPath); changeIdentification("$ORIGIN/" + bundleLibraryDirectory, applicationBundle.binaryPath);
applicationBundle.libraryPaths = findAppLibraries(appDirPath); applicationBundle.libraryPaths = findAppLibraries(appDirPath);
LogDebug() << "applicationBundle.libraryPaths:" << applicationBundle.libraryPaths; LogDebug() << "applicationBundle.libraryPaths:" << applicationBundle.libraryPaths;
@ -667,12 +669,11 @@ DeploymentInfo deployQtLibraries(const QString &appDirPath, const QStringList &a
<< additionalExecutables; << additionalExecutables;
LogDebug() << "allBinaryPaths:" << allBinaryPaths; LogDebug() << "allBinaryPaths:" << allBinaryPaths;
QSet<QString> allLibraryPaths = getBinaryRPaths(applicationBundle.binaryPath, true); QSet<QString> allRPaths = getBinaryRPaths(applicationBundle.binaryPath, true);
allLibraryPaths.insert(QLibraryInfo::location(QLibraryInfo::LibrariesPath)); allRPaths.insert(QLibraryInfo::location(QLibraryInfo::LibrariesPath));
LogDebug() << "allRPaths:" << allRPaths;
LogDebug() << "allLibraryPaths:" << allLibraryPaths;
QList<LibraryInfo> libraries = getQtLibrariesForPaths(allBinaryPaths, appDirPath, allLibraryPaths); QList<LibraryInfo> libraries = getQtLibrariesForPaths(allBinaryPaths, appDirPath, allRPaths);
if (libraries.isEmpty() && !alwaysOwerwriteEnabled) { if (libraries.isEmpty() && !alwaysOwerwriteEnabled) {
LogWarning() << "Could not find any external Qt libraries to deploy in" << appDirPath; LogWarning() << "Could not find any external Qt libraries to deploy in" << appDirPath;

Loading…
Cancel
Save