diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp index 47a43892f5415d196d93d93c7e65b757062740f5..c43a2f1bea31f2ac88cf21285e5b0de7e03ff37d 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp @@ -226,16 +226,24 @@ bool MaemoPackageCreationStep::runCommand(QProcess &proc, const QString &command perl = maddeRoot() + QLatin1String("/bin/perl.exe "); #endif proc.start(perl + maddeRoot() % QLatin1String("/madbin/") % command); + if (!proc.waitForStarted()) { + raiseError(tr("Packaging failed."), + tr("Packaging error: Could not start command '%1'. Reason: %2") + .arg(command).arg(proc.errorString())); + return false; + } proc.write("\n"); // For dh_make - if (!proc.waitForFinished(100000) && proc.error() == QProcess::Timedout) { + if (!proc.waitForFinished(60000) && proc.error() == QProcess::Timedout) { raiseError(tr("Packaging failed."), tr("Packaging Error: Command '%1' timed out.").arg(command)); return false; } - if (proc.exitCode() != 0) { - const QString mainMessage = tr("Packaging Error: Command '%1' failed.") - .arg(command); - raiseError(mainMessage, mainMessage + QLatin1Char(' ') + if (proc.error() != QProcess::UnknownError || proc.exitCode() != 0) { + QString mainMessage = tr("Packaging Error: Command '%1' failed.") + .arg(command); + if (proc.error() != QProcess::UnknownError) + mainMessage += tr(" Reason: %1").arg(proc.errorString()); + raiseError(mainMessage, mainMessage + QLatin1Char('\n') + tr("Output was: ") + proc.readAllStandardError() + QLatin1Char('\n') + proc.readAllStandardOutput()); return false;