From 1d090c2899925d03435dc8a160b431b2e57739b9 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Fri, 4 Oct 2013 16:38:19 +0200 Subject: make replacing installer base binary more verbose Change-Id: Ib11b3cfa4121241421d479af23ed0ee111c0069c Reviewed-by: Karsten Heimrich Reviewed-by: Michal Klocek --- src/libs/installer/packagemanagercore_p.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp index a840d6d1e..743e41490 100644 --- a/src/libs/installer/packagemanagercore_p.cpp +++ b/src/libs/installer/packagemanagercore_p.cpp @@ -1265,13 +1265,18 @@ void PackageManagerCorePrivate::writeUninstaller(OperationList performedOperatio bool newBinaryWritten = false; bool replacementExists = false; const QString installerBaseBinary = m_core->replaceVariables(m_installerBaseBinaryUnreplaced); - if (!installerBaseBinary.isEmpty() && QFileInfo(installerBaseBinary).exists()) { + if (!installerBaseBinary.isEmpty() && !QFileInfo(installerBaseBinary).exists()) { + qWarning() << "The current installer base binary could not updated with a not existing '%1'. " + "Please fix the 'installer.setInstallerBaseBinary()' call " + "in your scripts."; + } else if (!installerBaseBinary.isEmpty()) { qDebug() << "Got a replacement installer base binary:" << installerBaseBinary; QFile replacementBinary(installerBaseBinary); try { openForRead(&replacementBinary, replacementBinary.fileName()); writeUninstallerBinary(&replacementBinary, replacementBinary.size(), true); + qDebug() << "Wrote the binary with the new replacement."; m_forceRestart = true; newBinaryWritten = true; @@ -1280,7 +1285,10 @@ void PackageManagerCorePrivate::writeUninstaller(OperationList performedOperatio qDebug() << error.message(); } - if (!replacementBinary.remove()) { + if (replacementBinary.remove()) { + qDebug() << QString::fromLatin1("Removed temporary installer base replacement binary file: %1").arg( + installerBaseBinary); + } else { // Is there anything more sensible we can do with this error? I think not. It's not serious // enough for throwing / aborting the process. qDebug() << QString::fromLatin1("Could not remove installer base binary (%1) after updating " -- cgit v1.2.3