diff options
author | Tim Jenssen <tim.jenssen@nokia.com> | 2012-06-12 09:05:17 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@nokia.com> | 2012-06-12 09:54:09 +0200 |
commit | cf6ac7ea81906a9640b5b9ef2281c3dc4d2b69fd (patch) | |
tree | 3fa677dd2b2adbf7d927212c2ccf8e706a71e6ac | |
parent | 1133a88b01ea294f6e422e7c20c84bee4d028e46 (diff) |
add the installer create datetime to --version
- binarycreate patches the installerbase to add the installer create datetime
- output is now:
Installer creation time 2012-06-08 - 17:39:43
IFW Version: "1.0.0", Installer base SHA1: "7031ecf", Build date: "Jun 8 2012".
Change-Id: I8f82c6942eefaf49e5ad8605577a0034a7502a6c
Reviewed-by: Niels Weber <niels.2.weber@nokia.com>
-rw-r--r-- | src/sdk/installerbase.cpp | 13 | ||||
-rw-r--r-- | tools/binarycreator/binarycreator.cpp | 7 |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/sdk/installerbase.cpp b/src/sdk/installerbase.cpp index 10932311a..d73040e77 100644 --- a/src/sdk/installerbase.cpp +++ b/src/sdk/installerbase.cpp @@ -70,6 +70,8 @@ using namespace QInstaller; using namespace QInstallerCreator; +static const char installer_create_datetime_placeholder [32] = "MY_InstallerCreateDateTime_MY"; + static QStringList repositories(const QStringList &arguments, const int index) { if (index < arguments.size()) { @@ -122,7 +124,16 @@ int main(int argc, char *argv[]) try { if (args.contains(QLatin1String("--version"))) { - InstallerBase::showVersion(QLatin1String(VERSION)); + QString versionOutPut; + QDateTime dateTimeCheck = QDateTime::fromString(QLatin1String( + installer_create_datetime_placeholder), QLatin1String("yyyy-MM-dd - HH:mm:ss")); + if (dateTimeCheck.isValid()) { + versionOutPut.append(QLatin1String("Installer creation time: ")); + versionOutPut.append(QLatin1String(installer_create_datetime_placeholder)); + versionOutPut.append(QLatin1String("\n")); + } + versionOutPut.append(QLatin1String(VERSION)); + InstallerBase::showVersion(versionOutPut); return 0; } diff --git a/tools/binarycreator/binarycreator.cpp b/tools/binarycreator/binarycreator.cpp index 9ec1d7106..ef3bd1fb0 100644 --- a/tools/binarycreator/binarycreator.cpp +++ b/tools/binarycreator/binarycreator.cpp @@ -31,6 +31,8 @@ **************************************************************************/ #include "common/repositorygen.h" +#include <qtpatch.h> + #include <binaryformat.h> #include <errors.h> #include <fileutils.h> @@ -194,6 +196,11 @@ Q_UNUSED(settings) throw Error(QObject::tr("Could not copy %1 to %2: %3").arg(instExe.fileName(), tempFile, instExe.errorString())); } + + QtPatch::patchBinaryFile(tempFile, QByteArray("MY_InstallerCreateDateTime_MY"), + QDateTime::currentDateTime().toString(QLatin1String("yyyy-MM-dd - HH:mm:ss")).toAscii()); + + input.installerExePath = tempFile; #if defined(Q_OS_WIN) |