mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-13 11:25:02 -05:00
Revert "contrib: macdeploy: monkey-patch gen-sdk to be deterministic"
This reverts commit ba30a5407e
.
This commit is contained in:
parent
080a47cb8a
commit
b03a45b13e
1 changed files with 0 additions and 15 deletions
|
@ -8,21 +8,6 @@ import gzip
|
||||||
import os
|
import os
|
||||||
import contextlib
|
import contextlib
|
||||||
|
|
||||||
# monkey-patch Python 3.8 and older to fix wrong TAR header handling
|
|
||||||
# see https://github.com/bitcoin/bitcoin/pull/24534
|
|
||||||
# and https://github.com/python/cpython/pull/18080 for more info
|
|
||||||
if sys.version_info < (3, 9):
|
|
||||||
_old_create_header = tarfile.TarInfo._create_header
|
|
||||||
def _create_header(info, format, encoding, errors):
|
|
||||||
buf = _old_create_header(info, format, encoding, errors)
|
|
||||||
# replace devmajor/devminor with binary zeroes
|
|
||||||
buf = buf[:329] + bytes(16) + buf[345:]
|
|
||||||
# recompute checksum
|
|
||||||
chksum = tarfile.calc_chksums(buf)[0]
|
|
||||||
buf = buf[:-364] + bytes("%06o\0" % chksum, "ascii") + buf[-357:]
|
|
||||||
return buf
|
|
||||||
tarfile.TarInfo._create_header = staticmethod(_create_header)
|
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def cd(path):
|
def cd(path):
|
||||||
"""Context manager that restores PWD even if an exception was raised."""
|
"""Context manager that restores PWD even if an exception was raised."""
|
||||||
|
|
Loading…
Add table
Reference in a new issue