diff options
author | Bernhard M. Wiedemann <bwiedemann@suse.de> | 2017-08-19 14:49:32 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2017-11-13 16:00:34 +0000 |
commit | 38271e9298dcf48652a6e2e08414a940a97867fa (patch) | |
tree | 2b411c2057b8640e5932d150c35b12632a78d458 /src/tools/rcc/rcc.cpp | |
parent | 3e4d3209b21254c1c90414b2af08c304c8d26be2 (diff) |
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>
Diffstat (limited to 'src/tools/rcc/rcc.cpp')
-rw-r--r-- | src/tools/rcc/rcc.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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'); } |