From 38271e9298dcf48652a6e2e08414a940a97867fa Mon Sep 17 00:00:00 2001 From: "Bernhard M. Wiedemann" Date: Sat, 19 Aug 2017 14:49:32 +0200 Subject: 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 --- src/tools/rcc/rcc.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/tools/rcc/rcc.cpp') diff --git a/src/tools/rcc/rcc.cpp b/src/tools/rcc/rcc.cpp index 84fe6ef5c7..92d3c5c171 100644 --- a/src/tools/rcc/rcc.cpp +++ b/src/tools/rcc/rcc.cpp @@ -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'); } -- cgit v1.2.3