[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#875847: Patch to fix ".qhc files not reproducible"



Am 24.11.20 um 19:24 schrieb Dmitry Shachnev:
Hi Kai!

On Thu, Oct 15, 2020 at 07:48:49AM +0200, Kai Pastor, DG0YT wrote:
This patch fixes the creation of the offending timestamp, by clamping to
SOURCE_DATE_EPOCH as specified.
Thank you for the patch and sorry for delayed response!

I also left a link to this Debian bug in Qt's code review for the offending
change.
Can you please share a link to the mentioned code review?

https://bugreports.qt.io/browse/QTBUG-62697 has only some old reviews from
2018 linked.

https://codereview.qt-project.org/c/qt/qttools/+/203587

(Found again via seaching "status:merged commentby:dg0yt@darc.de")

Clamp registered collection time-stamp to SOURCE_DATE_EPOCH if set.
--- a/src/assistant/help/qhelpcollectionhandler.cpp
+++ b/src/assistant/help/qhelpcollectionhandler.cpp
@@ -2197,7 +2197,14 @@
      m_query->addBindValue(fileName);
      const QFileInfo fi(absoluteDocPath(fileName));
      m_query->addBindValue(fi.size());
-    m_query->addBindValue(fi.lastModified().toString(Qt::ISODate));
+    QDateTime last_modified = fi.lastModified();
+    if (qEnvironmentVariableIsSet("SOURCE_DATE_EPOCH"))
+    {
+        qint64 source_date_epoch = qEnvironmentVariableIntValue("SOURCE_DATE_EPOCH");
+        if (source_date_epoch < last_modified.toSecsSinceEpoch())
+            last_modified.setSecsSinceEpoch(qEnvironmentVariableIntValue("SOURCE_DATE_EPOCH"));
I think we can use setSecsSinceEpoch(source_date_epoch) here?

I think this was my intention.

Kai.


Reply to: