Source: python-qt4 Version: 4.11.2+dfsg-1 Severity: wishlist Tags: patch User: reproducible-bui...@lists.alioth.debian.org Usertags: timestamps toolchain
Hi, the uic python module and the pyrcc tool are currently embedding timestamps into the comments of generated files. This results in packages that can't be built reproducibly, because the timestamp will be a different one on each build (see [1]). The attached patch removes the timestamp writing in those tools, as this is no useful information anyway. Regards, Reiner [1]: https://reproducible.debian.net/userContent/issues/timestamps_in_source_generated_by_pyqt4_ui_issue.html
diff --git a/debian/changelog b/debian/changelog index 2df5e40..43e2fde 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +python-qt4 (4.11.2+dfsg-1.0~reproducible1) UNRELEASED; urgency=low + + * Added patch which removes embedding of timestamps in generated + files, to enable reproducible builds in packages build-depending + on python-qt4. + + -- Reiner Herrmann <rei...@reiner-h.de> Sat, 03 Jan 2015 16:57:18 +0100 + python-qt4 (4.11.2+dfsg-1) unstable; urgency=medium * New upstream bugfix release. diff --git a/debian/patches/remove_timestamps.diff b/debian/patches/remove_timestamps.diff new file mode 100644 index 0000000..c60a51d --- /dev/null +++ b/debian/patches/remove_timestamps.diff @@ -0,0 +1,59 @@ +Description: prevent embedding of timestamps in files generated by rcc and uic + Timestamps in generated files will make packages using those tools no longer + build reproducibly, because the files will differ in each build. + As those timestamps are no useful information, they can be left out. +Author: Reiner Herrmann <rei...@reiner-h.de> + +Index: python-qt4-4.11.2+dfsg/pyrcc/rcc.cpp +=================================================================== +--- python-qt4-4.11.2+dfsg.orig/pyrcc/rcc.cpp ++++ python-qt4-4.11.2+dfsg/pyrcc/rcc.cpp +@@ -24,7 +24,6 @@ + #include <qfile.h> + #include <qfileinfo.h> + #include <qlocale.h> +-#include <qdatetime.h> + #include <qtextstream.h> + #include <qbytearray.h> + #include <qhash.h> +@@ -407,8 +406,7 @@ RCCResourceLibrary::writeHeader(FILE *ou + fprintf(out, "# -*- coding: utf-8 -*-\n\n"); + fprintf(out, "# Resource object code\n"); + fprintf(out, "#\n"); +- fprintf(out, "# Created: %s\n", QDateTime::currentDateTime().toString().toUtf8().constData()); +- fprintf(out, "# by: The Resource Compiler for PyQt (Qt v%s)\n", QT_VERSION_STR); ++ fprintf(out, "# Created by: The Resource Compiler for PyQt (Qt v%s)\n", QT_VERSION_STR); + fprintf(out, "#\n"); + fprintf(out, "# WARNING! All changes made in this file will be lost!\n"); + fprintf(out, "\n"); +Index: python-qt4-4.11.2+dfsg/pyuic/uic/__init__.py +=================================================================== +--- python-qt4-4.11.2+dfsg.orig/pyuic/uic/__init__.py ++++ python-qt4-4.11.2+dfsg/pyuic/uic/__init__.py +@@ -47,8 +47,7 @@ _header = """# -*- coding: utf-8 -*- + + # Form implementation generated from reading ui file '%s' + # +-# Created: %s +-# by: PyQt4 UI code generator %s ++# Created by: PyQt4 UI code generator %s + # + # WARNING! All changes made in this file will be lost! + +@@ -160,7 +159,6 @@ def compileUi(uifile, pyfile, execute=Fa + module is foo_rc. + """ + +- from time import ctime + from PyQt4.QtCore import PYQT_VERSION_STR + + try: +@@ -170,7 +168,7 @@ def compileUi(uifile, pyfile, execute=Fa + + indenter.indentwidth = indent + +- pyfile.write(_header % (uifname, ctime(), PYQT_VERSION_STR)) ++ pyfile.write(_header % (uifname, PYQT_VERSION_STR)) + + winfo = compiler.UICompiler().compileUi(uifile, pyfile, from_imports, resource_suffix) + diff --git a/debian/patches/series b/debian/patches/series index 30a5420..a89a1d2 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ debian_configure_changes.diff qreal_float_support.diff config_flags.diff +remove_timestamps.diff
signature.asc
Description: OpenPGP digital signature