Skip to content

Commit a1537ba

Browse files
committed
Merge bitcoin/bitcoin#30282: Revert "contrib: macdeploy: monkey-patch gen-sdk to be deterministic"
b03a45b Revert "contrib: macdeploy: monkey-patch gen-sdk to be deterministic" (fanquake) Pull request description: This reverts commit ba30a54. We no-longer support Python 3.8, so remove the monkey patching. ACKs for top commit: hebasto: ACK b03a45b, I have reviewed the code and it looks OK. Tree-SHA512: 5bf68c2b332f18a620a8a6f77812ed93afa988016847bec1d3b7355670301dc957442ac47191a0cb7c3fe607d902914fb00c96345c8170f2a64429638c00b3c4
2 parents 41544b8 + b03a45b commit a1537ba

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

contrib/macdeploy/gen-sdk

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,6 @@ import gzip
88
import os
99
import contextlib
1010

11-
# monkey-patch Python 3.8 and older to fix wrong TAR header handling
12-
# see https://github.com/bitcoin/bitcoin/pull/24534
13-
# and https://github.com/python/cpython/pull/18080 for more info
14-
if sys.version_info < (3, 9):
15-
_old_create_header = tarfile.TarInfo._create_header
16-
def _create_header(info, format, encoding, errors):
17-
buf = _old_create_header(info, format, encoding, errors)
18-
# replace devmajor/devminor with binary zeroes
19-
buf = buf[:329] + bytes(16) + buf[345:]
20-
# recompute checksum
21-
chksum = tarfile.calc_chksums(buf)[0]
22-
buf = buf[:-364] + bytes("%06o\0" % chksum, "ascii") + buf[-357:]
23-
return buf
24-
tarfile.TarInfo._create_header = staticmethod(_create_header)
25-
2611
@contextlib.contextmanager
2712
def cd(path):
2813
"""Context manager that restores PWD even if an exception was raised."""

0 commit comments

Comments
 (0)