test: allow overriding tar in get_previous_releases
What changed, and why it matters
This is a tiny test-only change that lets developers choose a different 'tar' program (for example 'gtar') via an environment variable when running test setup scripts. It does not touch Bitcoin's network code, wallet, consensus rules, or any production software. There is no security issue here.
No security action needed. Review and merge as a normal build/test portability improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch adds an environment-variable override TAR = os.getenv(‘TAR’, ‘tar’) and uses that variable instead of the hard-coded ‘tar’ binary in test/get_previous_releases.py. The script is only used to download and unpack old Bitcoin Core release archives for functional testing. No user-facing code, cryptography, or consensus logic is modified.
Changed components
test/get_previous_releases.pyInspect captured patch +3 / −1
diff --git a/test/get_previous_releases.py b/test/get_previous_releases.py
index e715c1c9..4984c1b2 100755
--- a/test/get_previous_releases.py
+++ b/test/get_previous_releases.py
@@ -23,6 +23,8 @@ import time
import urllib.request
import zipfile
+TAR = os.getenv('TAR', 'tar')
+
SHA256_SUMS = {
"0e2819135366f150d9906e294b61dff58fd1996ebd26c2f8e979d6c0b7a79580": {"tag": "v0.14.3", "archive": "bitcoin-0.14.3-aarch64-linux-gnu.tar.gz"},
"d86fc90824a85c38b25c8488115178d5785dbc975f5ff674f9f5716bc8ad6e65": {"tag": "v0.14.3", "archive": "bitcoin-0.14.3-arm-linux-gnueabihf.tar.gz"},
@@ -214,7 +216,7 @@ def download_binary(tag, args) -> int:
print(f"Zip extraction failed: {e}", file=sys.stderr)
return 1
else:
- ret = subprocess.run(['tar', '-zxf', archive, '-C', tag,
+ ret = subprocess.run([TAR, '-zxf', archive, '-C', tag,
'--strip-components=1',
'bitcoin-{tag}'.format(tag=tag[1:])]).returncode
if ret != 0:
Why this scored 17/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.