build: add --no-download option to bootstrap.py

With this option, the script will check that the expected waf version is
present, but will simply fail if it's not, rather than trying to
download it. This allows a package build script to avoid compile-time
network access but still ensure it's using the right waf version.
This commit is contained in:
Philip Sequeira 2018-07-10 22:15:19 -04:00 committed by sfan5
parent 4e9e46b9f8
commit c5d03d338e
1 changed files with 4 additions and 0 deletions

View File

@ -16,6 +16,10 @@ if os.path.exists("waf"):
print("Found 'waf', skipping download.") print("Found 'waf', skipping download.")
sys.exit(0) sys.exit(0)
if "--no-download" in sys.argv[1:]:
print("Did not find {} and no download was requested.".format(WAFRELEASE))
sys.exit(1)
try: try:
from urllib.request import urlopen, URLError from urllib.request import urlopen, URLError
except: except: