Package: qt4-x11 / 4:4.8.7+dfsg-18

replace_timestamps_with_fixed_date_in_qhelpgenerator.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Description: Replace timestamps from qhelpgenerator by a fixed date 
 In order to make qhelpgenerator output reproducible, we need a way to get
 deterministic embedded timestaps.  Backport the patch from qttools5 [1] to
 make qch files reproducible by replacing the current time by a fixed date.  

 [1] https://codereview.qt-project.org/#/c/106296/
Author: Eduard Sanou <dhole@openmailbox.org>

---

Index: qt4-x11-4.8.7+dfsg/tools/assistant/lib/qhelpgenerator.cpp
===================================================================
--- qt4-x11-4.8.7+dfsg.orig/tools/assistant/lib/qhelpgenerator.cpp
+++ qt4-x11-4.8.7+dfsg/tools/assistant/lib/qhelpgenerator.cpp
@@ -380,9 +380,7 @@ bool QHelpGenerator::createTables()
 
     d->query->exec(QLatin1String("INSERT INTO MetaDataTable VALUES('qchVersion', '1.0')"));
 
-    d->query->prepare(QLatin1String("INSERT INTO MetaDataTable VALUES('CreationDate', ?)"));
-    d->query->bindValue(0, QDateTime::currentDateTime().toString(Qt::ISODate));
-    d->query->exec();
+    d->query->exec(QLatin1String("INSERT INTO MetaDataTable VALUES('CreationDate', '2012-12-20T12:00:00Z')"));
 
     return true;
 }
Index: qt4-x11-4.8.7+dfsg/tools/assistant/tools/qcollectiongenerator/main.cpp
===================================================================
--- qt4-x11-4.8.7+dfsg.orig/tools/assistant/tools/qcollectiongenerator/main.cpp
+++ qt4-x11-4.8.7+dfsg/tools/assistant/tools/qcollectiongenerator/main.cpp
@@ -521,7 +521,7 @@ int main(int argc, char *argv[])
     CollectionConfiguration::setAddressBarVisible(helpEngine,
          !config.hideAddressBar());
     CollectionConfiguration::setCreationTime(helpEngine,
-        QDateTime::currentDateTime().toTime_t());
+        QDateTime::fromString("2012-12-20T12:00:00Z", Qt::ISODate).toUTC().toTime_t());
     CollectionConfiguration::setFullTextSearchFallbackEnabled(helpEngine,
         config.fullTextSearchFallbackEnabled());
 
Index: qt4-x11-4.8.7+dfsg/tools/assistant/tools/shared/collectionconfiguration.cpp
===================================================================
--- qt4-x11-4.8.7+dfsg.orig/tools/assistant/tools/shared/collectionconfiguration.cpp
+++ qt4-x11-4.8.7+dfsg/tools/assistant/tools/shared/collectionconfiguration.cpp
@@ -282,7 +282,7 @@ const QDateTime CollectionConfiguration:
 
 void CollectionConfiguration::updateLastRegisterTime(QHelpEngineCore &helpEngine)
 {
-    helpEngine.setCustomValue(LastRegisterTime, QDateTime::currentDateTime());
+    helpEngine.setCustomValue(LastRegisterTime, QDateTime::fromString("2012-12-20T12:00:00Z", Qt::ISODate).toUTC());
 }
 
 bool CollectionConfiguration::isNewer(const QHelpEngineCore &newer,