diff options
author | wm4 <wm4@nowhere> | 2013-11-24 17:00:12 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-24 17:00:26 +0100 |
commit | dc87c5e4521c2e9e0e67a7afac485276df29fdbd (patch) | |
tree | 50e9abf4ac1ec6741bd81b271befaf5045155634 /bootstrap.py | |
parent | efa7f8f376973f42f60b30f0367aca899f8fc60d (diff) | |
download | mpv-dc87c5e4521c2e9e0e67a7afac485276df29fdbd.tar.bz2 mpv-dc87c5e4521c2e9e0e67a7afac485276df29fdbd.tar.xz |
bootstrap.py: skip download if waf already exists
It seems like a good idea not to generate any additional network traffic
and wait times if we don't have to.
Also print the URL it's downloading from.
Note that if we require a newer waf release, there will be a problem.
Running ./bootstrap.py won't get the newest waf version anymore in case
the old version is in the source dir. Not sure how to handle this.
Diffstat (limited to 'bootstrap.py')
-rwxr-xr-x | bootstrap.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bootstrap.py b/bootstrap.py index d855de029b..04698014ef 100755 --- a/bootstrap.py +++ b/bootstrap.py @@ -5,15 +5,21 @@ from __future__ import print_function import os, sys, stat, hashlib +if os.path.exists("waf"): + print("Found 'waf', skipping download.") + sys.exit(0) + try: from urllib.request import urlopen except: from urllib2 import urlopen WAFRELEASE = "waf-1.7.13" +WAFURL = "https://waf.googlecode.com/files/" + WAFRELEASE SHA256HASH = "03cc750049350ee01cdbc584b70924e333fcc17ba4a2d04648dab1535538a873" -waf = urlopen("https://waf.googlecode.com/files/" + WAFRELEASE).read() +print("Downloading %s..." % WAFURL) +waf = urlopen(WAFURL).read() if SHA256HASH == hashlib.sha256(waf).hexdigest(): with open("waf", "wb") as wf: |