From a042131948c98702298d47fe352e6cc85b605024 Mon Sep 17 00:00:00 2001 From: kh1 Date: Tue, 11 Feb 2014 12:02:26 +0100 Subject: Add a current date as release date fallback. Change-Id: Ib42ef38b8b47e3a7f0cf3beec1c1c16a7c51cf26 Reviewed-by: Karsten Heimrich --- tools/common/repositorygen.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tools/common') diff --git a/tools/common/repositorygen.cpp b/tools/common/repositorygen.cpp index 609844829..77ce8eb6f 100644 --- a/tools/common/repositorygen.cpp +++ b/tools/common/repositorygen.cpp @@ -446,8 +446,14 @@ PackageInfoVector QInstallerTools::createListOfPackages(const QStringList &packa "path element right before the 'meta' ('%2').").arg(fileInfo.absoluteFilePath(), it->fileName()); } - const QString releaseDate = packageElement.firstChildElement(QLatin1String("ReleaseDate")).text(); - if (releaseDate.isEmpty() || (!QDate::fromString(releaseDate, Qt::ISODate).isValid())) { + QString releaseDate = packageElement.firstChildElement(QLatin1String("ReleaseDate")).text(); + if (releaseDate.isEmpty()) { + qWarning("Release date for '%s' is empty! Using the current date instead.", + qPrintable(fileInfo.absoluteFilePath())); + releaseDate = QDate::currentDate().toString(Qt::ISODate); + } + + if (!QDate::fromString(releaseDate, Qt::ISODate).isValid()) { if (ignoreInvalidPackages) continue; throw QInstaller::Error(QString::fromLatin1("Release date for '%1' is invalid! %2" -- cgit v1.2.3