implement download fallback for traditional make build

This commit is contained in:
Axel Kohlmeyer
2023-02-01 06:47:25 -05:00
parent 5d16bea899
commit 89b37c51df
9 changed files with 105 additions and 84 deletions

View File

@ -13,7 +13,7 @@ import sys
from argparse import ArgumentParser
sys.path.append('..')
from install_helpers import fullpath, geturl, checkmd5sum
from install_helpers import fullpath, geturl, checkmd5sum, getfallback
# settings
@ -77,14 +77,21 @@ if buildflag:
print("Downloading pace tarball ...")
archive_filename = "%s.%s" % (version, archive_extension)
download_filename = "%s/%s" % (thisdir, archive_filename)
fallback = getfallback('pacelib', url)
print("Downloading from ", url, " to ", download_filename, end=" ")
geturl(url, download_filename)
try:
geturl(url, download_filename)
except:
geturl(fallback, download_filename)
print(" done")
# verify downloaded archive integrity via md5 checksum, if known.
if version in checksums:
if not checkmd5sum(checksums[version], archive_filename):
sys.exit("Checksum for pace library does not match")
if not checkmd5sum(checksums[version], download_filename):
print("Checksum did not match. Trying fallback URL", fallback)
geturl(fallback, download_filename)
if not checkmd5sum(checksums[version], download_filename):
sys.exit("Checksum for pace library does not match for fallback, too.")
print("Unpacking pace tarball ...")
src_folder = thisdir + "/src"