summaryrefslogtreecommitdiffstats
path: root/bootstrap.py
diff options
context:
space:
mode:
authorMartin Herkt <lachs0r@srsfckn.biz>2015-03-15 21:11:11 +0100
committerMartin Herkt <lachs0r@srsfckn.biz>2015-03-15 21:11:40 +0100
commit958dbca3ef480052ab3c801fd0fcbbdcb4600acb (patch)
treeeaf4b4f9444a33d39c63849915886746308f142a /bootstrap.py
parent9cd523bf5fab1c93ecf0418b5ae5d61b1e8fed9e (diff)
downloadmpv-958dbca3ef480052ab3c801fd0fcbbdcb4600acb.tar.bz2
mpv-958dbca3ef480052ab3c801fd0fcbbdcb4600acb.tar.xz
bootstrap: add waf mirror
Diffstat (limited to 'bootstrap.py')
-rwxr-xr-xbootstrap.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/bootstrap.py b/bootstrap.py
index a2258a2e11..7ffd39a4fe 100755
--- a/bootstrap.py
+++ b/bootstrap.py
@@ -6,7 +6,8 @@ from __future__ import print_function
import os, sys, stat, hashlib, subprocess
WAFRELEASE = "waf-1.8.4"
-WAFURL = "http://ftp.waf.io/pub/release/" + WAFRELEASE
+WAFURLS = ["http://ftp.waf.io/pub/release/" + WAFRELEASE,
+ "http://www.freehackers.org/~tnagy/release/" + WAFRELEASE]
SHA256HASH = "f02035fa5d8814f33f19b2b20d43822ddef6bb39b955ca196c2a247a1f9ffaa8"
if os.path.exists("waf"):
@@ -16,12 +17,24 @@ if os.path.exists("waf"):
sys.exit(0)
try:
- from urllib.request import urlopen
+ from urllib.request import urlopen, URLError
except:
- from urllib2 import urlopen
+ from urllib2 import urlopen, URLError
-print("Downloading %s..." % WAFURL)
-waf = urlopen(WAFURL).read()
+waf = None
+
+for WAFURL in WAFURLS:
+ try:
+ print("Downloading {}...".format(WAFURL))
+ waf = urlopen(WAFURL).read()
+ break
+ except URLError:
+ print("Download failed.")
+
+if not waf:
+ print("Could not download {}.".format(WAFRELEASE))
+
+ sys.exit(1)
if SHA256HASH == hashlib.sha256(waf).hexdigest():
with open("waf", "wb") as wf: