summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2025-03-13 18:22:23 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-03-17 17:09:22 +0000
commit7d85b62a8adcb23f5ee2c55cd7bbf684fab129f6 (patch)
tree1ccc67b70716870eccb2f9811bd54d6a9405e993 /scripts
parent157685ca87e19a334bf49cd64737e73b745959b5 (diff)
downloadpoky-7d85b62a8adcb23f5ee2c55cd7bbf684fab129f6.tar.gz
scripts/install-buildtools: write download URLs to files for traceability
This extends the previous commit, so that download URLs are preserved in addition to actual artefacts. By default it's all written to a temporary directory and erased together with artefacts, but users can choose to preserve both: $ install-buildtools -D --downloads-directory=. ... $ ls -1 buildtools_url checksum_url x86_64-buildtools-extended-nativesdk-standalone-5.1.2.sh x86_64-buildtools-extended-nativesdk-standalone-5.1.2.sh.sha256sum Additionally, rename check_url variable into checksum_url as it's a better name. (From OE-Core rev: 76748d27fd5088971259d08fdeae5c86a054452b) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install-buildtools10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/install-buildtools b/scripts/install-buildtools
index 6287416c9a..952da888ba 100755
--- a/scripts/install-buildtools
+++ b/scripts/install-buildtools
@@ -244,6 +244,8 @@ def main():
244 # Fetch installer 244 # Fetch installer
245 logger.info("Fetching buildtools installer") 245 logger.info("Fetching buildtools installer")
246 tmpbuildtools = os.path.join(sdk_dir, filename) 246 tmpbuildtools = os.path.join(sdk_dir, filename)
247 with open(os.path.join(sdk_dir, 'buildtools_url'), 'w') as f:
248 f.write(buildtools_url)
247 ret = subprocess.call("wget -q -O %s %s" % 249 ret = subprocess.call("wget -q -O %s %s" %
248 (tmpbuildtools, buildtools_url), shell=True) 250 (tmpbuildtools, buildtools_url), shell=True)
249 if ret != 0: 251 if ret != 0:
@@ -254,13 +256,15 @@ def main():
254 if args.check: 256 if args.check:
255 logger.info("Fetching buildtools installer checksum") 257 logger.info("Fetching buildtools installer checksum")
256 checksum_type = "sha256sum" 258 checksum_type = "sha256sum"
257 check_url = "{}.{}".format(buildtools_url, checksum_type) 259 checksum_url = "{}.{}".format(buildtools_url, checksum_type)
258 checksum_filename = "{}.{}".format(filename, checksum_type) 260 checksum_filename = "{}.{}".format(filename, checksum_type)
259 tmpbuildtools_checksum = os.path.join(sdk_dir, checksum_filename) 261 tmpbuildtools_checksum = os.path.join(sdk_dir, checksum_filename)
262 with open(os.path.join(sdk_dir, 'checksum_url'), 'w') as f:
263 f.write(checksum_url)
260 ret = subprocess.call("wget -q -O %s %s" % 264 ret = subprocess.call("wget -q -O %s %s" %
261 (tmpbuildtools_checksum, check_url), shell=True) 265 (tmpbuildtools_checksum, checksum_url), shell=True)
262 if ret != 0: 266 if ret != 0:
263 logger.error("Could not download file from %s" % check_url) 267 logger.error("Could not download file from %s" % checksum_url)
264 return ret 268 return ret
265 regex = re.compile(r"^(?P<checksum>[0-9a-f]+)\s+(?P<path>.*/)?(?P<filename>.*)$") 269 regex = re.compile(r"^(?P<checksum>[0-9a-f]+)\s+(?P<path>.*/)?(?P<filename>.*)$")
266 with open(tmpbuildtools_checksum, 'rb') as f: 270 with open(tmpbuildtools_checksum, 'rb') as f: