diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-04-21 11:36:41 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-04-21 11:37:00 +0200 |
commit | b1265cbeffb6778951a4f2d7a53bd4fc18607a5c (patch) | |
tree | ff5e75875061a62fb3f8a63fc4155fa558f8b3d2 /scripts | |
parent | 0c1414c6aaa419cba812b751c97c87e10cd6009e (diff) | |
download | qutebrowser-b1265cbeffb6778951a4f2d7a53bd4fc18607a5c.tar.gz qutebrowser-b1265cbeffb6778951a4f2d7a53bd4fc18607a5c.zip |
Update PE checksum patching after PyInstaller update
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/dev/build_release.py | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index 4b0e2f072..be6492358 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -206,21 +206,11 @@ def smoke_test(executable, debug): raise Exception("\n".join(lines)) -def patch_windows_exe(exe_path): - """Make sure the Windows .exe has a correct checksum. - - WORKAROUND for https://github.com/pyinstaller/pyinstaller/issues/5579 - """ +def verify_windows_exe(exe_path): + """Make sure the Windows .exe has a correct checksum.""" import pefile pe = pefile.PE(exe_path) - - # If this fails, a PyInstaller upgrade fixed things, and we can remove the - # workaround. Would be a good idea to keep the check, though. - assert not pe.verify_checksum() - - pe.OPTIONAL_HEADER.CheckSum = pe.generate_checksum() - pe.close() - pe.write(exe_path) + assert pe.verify_checksum() def patch_mac_app(): @@ -364,8 +354,8 @@ def _build_windows_single(*, x64, skip_packaging, debug): shutil.move(out_pyinstaller, outdir) exe_path = os.path.join(outdir, 'qutebrowser.exe') - utils.print_title(f"Patching {human_arch} exe") - patch_windows_exe(exe_path) + utils.print_title(f"Verifying {human_arch} exe") + verify_windows_exe(exe_path) utils.print_title(f"Running {human_arch} smoke test") smoke_test(exe_path, debug=debug) |