@@ -238,19 +238,15 @@ def main():
# Verify checksum
if args.check:
logger.info("Fetching buildtools installer checksum")
- checksum_type = ""
- for checksum_type in ["md5sum", "sha256sum"]:
- check_url = "{}.{}".format(buildtools_url, checksum_type)
- checksum_filename = "{}.{}".format(filename, checksum_type)
- tmpbuildtools_checksum = os.path.join(tmpsdk_dir, checksum_filename)
- ret = subprocess.call("wget -q -O %s %s" %
- (tmpbuildtools_checksum, check_url), shell=True)
- if ret == 0:
- break
- else:
- if ret != 0:
- logger.error("Could not download file from %s" % check_url)
- return ret
+ checksum_type = "sha256sum"
+ check_url = "{}.{}".format(buildtools_url, checksum_type)
+ checksum_filename = "{}.{}".format(filename, checksum_type)
+ tmpbuildtools_checksum = os.path.join(tmpsdk_dir, checksum_filename)
+ ret = subprocess.call("wget -q -O %s %s" %
+ (tmpbuildtools_checksum, check_url), shell=True)
+ if ret != 0:
+ logger.error("Could not download file from %s" % check_url)
+ return ret
regex = re.compile(r"^(?P<checksum>[0-9a-f]+)\s+(?P<path>.*/)?(?P<filename>.*)$")
with open(tmpbuildtools_checksum, 'rb') as f:
original = f.read()
@@ -263,10 +259,7 @@ def main():
logger.error("Filename does not match name in checksum")
return 1
checksum = m.group('checksum')
- if checksum_type == "md5sum":
- checksum_value = md5_file(tmpbuildtools)
- else:
- checksum_value = sha256_file(tmpbuildtools)
+ checksum_value = sha256_file(tmpbuildtools)
if checksum == checksum_value:
logger.info("Checksum success")
else: