Source: dxf2gcode Version: 20240509-2 Severity: normal Tags: patch X-Debbugs-Cc: [email protected] User: [email protected] Usertags: randomness
Hi, dxc2gcode is currently not reproducible. https://reproduce.debian.net/all/forky.html#dxf2gcode The attached patch fixes this. See comment in the patch. Cheers Jochen
diff --git a/debian/patches/1000-Use-reproducible-filename-for-pyuic5-call.patch b/debian/patches/1000-Use-reproducible-filename-for-pyuic5-call.patch new file mode 100644 index 0000000..abe9d0f --- /dev/null +++ b/debian/patches/1000-Use-reproducible-filename-for-pyuic5-call.patch @@ -0,0 +1,58 @@ +From: Jochen Sprickerhof <[email protected]> +Date: Tue, 30 Jun 2026 10:14:44 +0200 +Subject: Use reproducible filename for pyuic5 call + +pyuic5 writes the source filename to the generated file. The old code +used a tempfile which is not reproducible. This uses a reproducible +filename instead. +--- + make_py_uic.py | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/make_py_uic.py b/make_py_uic.py +index bed8a25..6bd50fb 100755 +--- a/make_py_uic.py ++++ b/make_py_uic.py +@@ -7,7 +7,6 @@ Generates the python file based on the defined uifile + import os + import subprocess + import sys +-import tempfile + + import dxf2gcode.globals.constants as c + +@@ -71,6 +70,7 @@ else: + FILEPATH = os.path.realpath(os.path.dirname(sys.argv[0])) + + UIFILE = "dxf2gcode.ui" ++UIFILEver = "dxf2gcode_ui%s.ui" % pyQtVer + PYFILEver = "dxf2gcode_ui%s.py" % pyQtVer + + RCFILE = "dxf2gcode_images.qrc" +@@ -82,14 +82,13 @@ ui_data = "" + with open(os.path.join(FILEPATH,UIFILE), "r") as myfile: + ui_data = myfile.read().replace(RCFILE, RCFILEver) + +-fd, tmp_ui_filename = tempfile.mkstemp() + try: +- os.write(fd, bytes(ui_data, 'UTF-8')) +- os.close(fd) ++ with open(os.path.join(FILEPATH,UIFILEver), "w") as fd: ++ fd.write(ui_data) + + OPTIONS = "-o" + +- cmd1 = [UICPATH, tmp_ui_filename, OPTIONS, os.path.join(FILEPATH,PYFILEver)] ++ cmd1 = [UICPATH, os.path.join(FILEPATH,UIFILEver), OPTIONS, os.path.join(FILEPATH,PYFILEver)] + cmd2 = [RCCPATH, OPTIONS, os.path.join(FILEPATH,RCPYFILEver),os.path.join(FILEPATH,RCFILE)] + + print(" ".join(cmd1)) +@@ -99,7 +98,7 @@ try: + subprocess.check_call(cmd2) + + finally: +- os.remove(tmp_ui_filename) ++ os.remove(os.path.join(FILEPATH,UIFILEver)) + + print("Please consider to not commit any auto-generated files.") + print("\nREADY") diff --git a/debian/patches/series b/debian/patches/series index 61c2a38..78ea0cb 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,4 @@ 2020-quiet-exit-code.patch 2030-desktop-categories.patch 2040-pocketmove-typo.patch +1000-Use-reproducible-filename-for-pyuic5-call.patch

