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-22 20:47:31 +0200 |
commit | 57a8f13393dbe7dc3971f28a13fc518d924eb149 (patch) | |
tree | 443540c97c716ecac207571193575668ac5c4ef3 | |
parent | 02619e3c84a6a9e8a7eafc538cb90b325dcebf86 (diff) | |
download | qutebrowser-57a8f13393dbe7dc3971f28a13fc518d924eb149.tar.gz qutebrowser-57a8f13393dbe7dc3971f28a13fc518d924eb149.zip |
Update PE checksum patching after PyInstaller update
(cherry picked from commit b1265cbeffb6778951a4f2d7a53bd4fc18607a5c)
-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 f53656695..5659a0fb0 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) |