diff options
author | eng <eng@mailinator.com> | 2013-11-24 16:01:03 -0500 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-24 22:14:39 +0100 |
commit | 9d603e99854b94f5e3866a151546923d2048aa35 (patch) | |
tree | 44217db32217d0ef939b90c0d2eb5271d60cb452 | |
parent | 92779408d3c3db0eb0060586fab483e78f514ed4 (diff) | |
download | mpv-9d603e99854b94f5e3866a151546923d2048aa35.tar.bz2 mpv-9d603e99854b94f5e3866a151546923d2048aa35.tar.xz |
bootstrap.py: check version if waf already exists
-rwxr-xr-x | bootstrap.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/bootstrap.py b/bootstrap.py index 04698014ef..74cbfd3fdd 100755 --- a/bootstrap.py +++ b/bootstrap.py @@ -3,21 +3,23 @@ # This script simply downloads waf to the current directory from __future__ import print_function -import os, sys, stat, hashlib +import os, sys, stat, hashlib, subprocess + +WAFRELEASE = "waf-1.7.13" +WAFURL = "https://waf.googlecode.com/files/" + WAFRELEASE +SHA256HASH = "03cc750049350ee01cdbc584b70924e333fcc17ba4a2d04648dab1535538a873" if os.path.exists("waf"): - print("Found 'waf', skipping download.") - sys.exit(0) + wafver = subprocess.check_output(['./waf', '--version']).decode() + if WAFRELEASE.split('-')[1] == wafver.split(' ')[1]: + 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" - print("Downloading %s..." % WAFURL) waf = urlopen(WAFURL).read() |