[neon/qt/qttools/Neon/testing] debian: Add a patch for qhelpgenerator to make it use SOURCE_DATE_EPOCH.

Dmitry Shachnev null at kde.org
Tue May 18 13:43:19 BST 2021


Git commit 8f667dc92746a7da69dca3052f1c14575d51ae1d by Dmitry Shachnev.
Committed on 04/12/2020 at 15:21.
Pushed by sitter into branch 'Neon/testing'.

Add a patch for qhelpgenerator to make it use SOURCE_DATE_EPOCH.

Closes: #875847.
Thanks to Kai Pastor!

M  +4    -0    debian/changelog
A  +23   -0    debian/patches/reproducible_lastModified.diff
A  +1    -0    debian/patches/series

https://invent.kde.org/neon/qt/qttools/commit/8f667dc92746a7da69dca3052f1c14575d51ae1d

diff --git a/debian/changelog b/debian/changelog
index ec012cd..ac86b70 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,9 @@
 qttools-opensource-src (5.15.2-3) UNRELEASED; urgency=medium
 
+  [ Dmitry Shachnev ]
+  * Add a patch for qhelpgenerator to make lastModified field honor
+    the SOURCE_DATE_EPOCH environment variable (closes: #875847).
+    Thanks to Kai Pastor!
 
  -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Fri, 04 Dec 2020 18:18:27 +0300
 
diff --git a/debian/patches/reproducible_lastModified.diff b/debian/patches/reproducible_lastModified.diff
new file mode 100644
index 0000000..c33ba4e
--- /dev/null
+++ b/debian/patches/reproducible_lastModified.diff
@@ -0,0 +1,23 @@
+Description: clamp registered collection time-stamp to SOURCE_DATE_EPOCH if set
+Origin: upstream, https://code.qt.io/cgit/qt/qttools.git/commit/?id=33693a928986006d
+Last-Update: 2020-12-04
+
+--- a/src/assistant/help/qhelpcollectionhandler.cpp
++++ b/src/assistant/help/qhelpcollectionhandler.cpp
+@@ -2197,7 +2197,15 @@ bool QHelpCollectionHandler::registerInd
+     m_query->addBindValue(fileName);
+     const QFileInfo fi(absoluteDocPath(fileName));
+     m_query->addBindValue(fi.size());
+-    m_query->addBindValue(fi.lastModified().toString(Qt::ISODate));
++    QDateTime lastModified = fi.lastModified();
++    if (qEnvironmentVariableIsSet("SOURCE_DATE_EPOCH")) {
++        const QString sourceDateEpochStr = qEnvironmentVariable("SOURCE_DATE_EPOCH");
++        bool ok;
++        const qlonglong sourceDateEpoch = sourceDateEpochStr.toLongLong(&ok);
++        if (ok && sourceDateEpoch < lastModified.toSecsSinceEpoch())
++            lastModified.setSecsSinceEpoch(sourceDateEpoch);
++    }
++    m_query->addBindValue(lastModified.toString(Qt::ISODate));
+     if (!m_query->exec())
+         return false;
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..8c11212
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+reproducible_lastModified.diff



More information about the Neon-commits mailing list