mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00
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>
This commit is contained in:
parent
157685ca87
commit
7d85b62a8a
|
@ -244,6 +244,8 @@ def main():
|
||||||
# Fetch installer
|
# Fetch installer
|
||||||
logger.info("Fetching buildtools installer")
|
logger.info("Fetching buildtools installer")
|
||||||
tmpbuildtools = os.path.join(sdk_dir, filename)
|
tmpbuildtools = os.path.join(sdk_dir, filename)
|
||||||
|
with open(os.path.join(sdk_dir, 'buildtools_url'), 'w') as f:
|
||||||
|
f.write(buildtools_url)
|
||||||
ret = subprocess.call("wget -q -O %s %s" %
|
ret = subprocess.call("wget -q -O %s %s" %
|
||||||
(tmpbuildtools, buildtools_url), shell=True)
|
(tmpbuildtools, buildtools_url), shell=True)
|
||||||
if ret != 0:
|
if ret != 0:
|
||||||
|
@ -254,13 +256,15 @@ def main():
|
||||||
if args.check:
|
if args.check:
|
||||||
logger.info("Fetching buildtools installer checksum")
|
logger.info("Fetching buildtools installer checksum")
|
||||||
checksum_type = "sha256sum"
|
checksum_type = "sha256sum"
|
||||||
check_url = "{}.{}".format(buildtools_url, checksum_type)
|
checksum_url = "{}.{}".format(buildtools_url, checksum_type)
|
||||||
checksum_filename = "{}.{}".format(filename, checksum_type)
|
checksum_filename = "{}.{}".format(filename, checksum_type)
|
||||||
tmpbuildtools_checksum = os.path.join(sdk_dir, checksum_filename)
|
tmpbuildtools_checksum = os.path.join(sdk_dir, checksum_filename)
|
||||||
|
with open(os.path.join(sdk_dir, 'checksum_url'), 'w') as f:
|
||||||
|
f.write(checksum_url)
|
||||||
ret = subprocess.call("wget -q -O %s %s" %
|
ret = subprocess.call("wget -q -O %s %s" %
|
||||||
(tmpbuildtools_checksum, check_url), shell=True)
|
(tmpbuildtools_checksum, checksum_url), shell=True)
|
||||||
if ret != 0:
|
if ret != 0:
|
||||||
logger.error("Could not download file from %s" % check_url)
|
logger.error("Could not download file from %s" % checksum_url)
|
||||||
return ret
|
return ret
|
||||||
regex = re.compile(r"^(?P<checksum>[0-9a-f]+)\s+(?P<path>.*/)?(?P<filename>.*)$")
|
regex = re.compile(r"^(?P<checksum>[0-9a-f]+)\s+(?P<path>.*/)?(?P<filename>.*)$")
|
||||||
with open(tmpbuildtools_checksum, 'rb') as f:
|
with open(tmpbuildtools_checksum, 'rb') as f:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user