Bug#875847: Patch to fix ".qhc files not reproducible"
Am 25.11.20 um 19:05 schrieb Dmitry Shachnev: On Wed, Nov 25, 2020 at 06:15:53AM +0100, Kai Pastor, DG0YT wrote: 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:dg...@darc.de") Ah, sorry, I misunderstood you and thought that you submitted a new code review with your patch. But you commented on change that introduced that code. Is there any reason why you didn't submit your patch to gerrit? Will you mind if I do it? -- Dmitry Shachnev Feel free to submit it. I didn't submit it to gerrit because contributing in that way became too much work for me when they required contributions to go to dev, not LTS. (And I didn't realize that there is a *new* Qt Help issue until Oct 2020, with dev meaning Qt 6 IIRC.) Kai
Bug#875847: Patch to fix ".qhc files not reproducible"
On Wed, Nov 25, 2020 at 06:15:53AM +0100, Kai Pastor, DG0YT wrote: > > > 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:dg...@darc.de") Ah, sorry, I misunderstood you and thought that you submitted a new code review with your patch. But you commented on change that introduced that code. Is there any reason why you didn't submit your patch to gerrit? Will you mind if I do it? -- Dmitry Shachnev signature.asc Description: PGP signature
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:dg...@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.
Bug#875847: Patch to fix ".qhc files not reproducible"
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. > 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? -- Dmitry Shachnev signature.asc Description: PGP signature
Bug#875847: Patch to fix ".qhc files not reproducible"
control: tags 875847 +patch On 2020-10-15, Kai Pastor, DG0YT wrote: > This patch fixes the creation of the offending timestamp, by clamping to > SOURCE_DATE_EPOCH as specified. > > I also left a link to this Debian bug in Qt's code review for the > offending change. > > Best regards, > Kai > 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")); > +} > +m_query->addBindValue(last_modified.toString(Qt::ISODate)); > if (!m_query->exec()) > return false; > signature.asc Description: PGP signature
Processed: Re: Bug#875847: Patch to fix ".qhc files not reproducible"
Processing control commands: > tags 875847 +patch Bug #875847 [qttools5-dev-tools] qttools5-dev-tools: .qhc files not reproducible Added tag(s) patch. -- 875847: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=875847 Debian Bug Tracking System Contact ow...@bugs.debian.org with problems
Bug#875847: Patch to fix ".qhc files not reproducible"
This patch fixes the creation of the offending timestamp, by clamping to SOURCE_DATE_EPOCH as specified. I also left a link to this Debian bug in Qt's code review for the offending change. Best regards, Kai 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")); +} +m_query->addBindValue(last_modified.toString(Qt::ISODate)); if (!m_query->exec()) return false;