Allow to override resource file date

because some packages create resource input files at build time
and thus get the build date embedded in binaries,
so that they differ for each build.

See https://reproducible-builds.org/ for why this matters
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Task-number: QTBUG-62511
Change-Id: I8908ac6182fab066e6ea398df2567f6d050c77e7
Reviewed-by: hjk <hjk@qt.io>
bb10
Bernhard M. Wiedemann 2017-08-19 14:49:32 +02:00 committed by hjk
parent 3e4d3209b2
commit 38271e9298
1 changed files with 5 additions and 1 deletions

View File

@ -207,7 +207,11 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib)
if (lib.formatVersion() >= 2) {
// last modified time stamp
const QDateTime lastModified = m_fileInfo.lastModified();
lib.writeNumber8(quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0));
quint64 lastmod = quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0);
static const quint64 sourceDate = 1000 * qgetenv("QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong();
if (sourceDate != 0)
lastmod = sourceDate;
lib.writeNumber8(lastmod);
if (text || pass1)
lib.writeChar('\n');
}