rcc: Use SOURCE_DATE_EPOCH for mtime

Use the standard variable name in addition to the QT-specific one
to make builds reproducible out-of-the-box.

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

Task-number: QTBUG-62511
Change-Id: I401a2a9d258e751b83ae7b83f4100d9088b9ad71
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Bernhard M. Wiedemann 2018-07-11 10:05:55 +02:00
parent 81dd1bcad1
commit 1ffcca4cc2

View File

@ -230,6 +230,9 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib)
static const quint64 sourceDate = 1000 * qgetenv("QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong();
if (sourceDate != 0)
lastmod = sourceDate;
static const quint64 sourceDate2 = 1000 * qgetenv("SOURCE_DATE_EPOCH").toULongLong();
if (sourceDate2 != 0)
lastmod = sourceDate2;
lib.writeNumber8(lastmod);
if (text || pass1)
lib.writeChar('\n');