From 6325cd41409a0c3ce03a7129e2ff10426447c3b2 Mon Sep 17 00:00:00 2001 From: probonopd Date: Mon, 5 Sep 2016 21:32:03 +0200 Subject: [PATCH] Better error handling for strip --- linuxdeployqt/main.cpp | 2 +- shared/shared.cpp | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/linuxdeployqt/main.cpp b/linuxdeployqt/main.cpp index f6f132d..c1d1387 100644 --- a/linuxdeployqt/main.cpp +++ b/linuxdeployqt/main.cpp @@ -38,7 +38,7 @@ int main(int argc, char **argv) if (argc > 1) appBinaryPath = QString::fromLocal8Bit(argv[1]); - appBinaryPath = QDir::cleanPath(appBinaryPath); + appBinaryPath = QDir::cleanPath(appBinaryPath).trimmed(); if (argc < 2 || appBinaryPath.startsWith("-")) { qDebug() << "Usage: linuxdeployqt app-binary [options]"; diff --git a/shared/shared.cpp b/shared/shared.cpp index 9c384f3..ec0d3ad 100644 --- a/shared/shared.cpp +++ b/shared/shared.cpp @@ -625,10 +625,17 @@ void runStrip(const QString &binaryPath) QProcess strip; strip.start("strip", QStringList() << "-x" << binaryPath); strip.waitForFinished(); - if (strip.exitCode() != 0) { - LogError() << strip.readAllStandardError(); - LogError() << strip.readAllStandardOutput(); + + if (strip.exitCode() == 0) + return; + + if (strip.readAllStandardError().contains("Not enough room for program headers")) { + LogError() << QFileInfo(binaryPath).completeBaseName() << "already stripped."; + } else { + LogError() << "Error stripping" << QFileInfo(binaryPath).completeBaseName() << ":" << strip.readAllStandardError(); + LogError() << "Error stripping" << QFileInfo(binaryPath).completeBaseName() << ":" << strip.readAllStandardOutput(); } + } void stripAppBinary(const QString &bundlePath)