diff options
author | ringmaster101 <ringmaster101@users.noreply.github.com> | 2015-04-11 19:16:53 +0000 |
---|---|---|
committer | Corey Farwell <coreyf@rwell.org> | 2015-06-01 18:37:37 -0400 |
commit | c4b73e703adcdd86b7cdfc48d84c87f1a888213e (patch) | |
tree | f86450468e4455ed900ffcde4fc609c28ebf40cb /python/servo/bootstrap_commands.py | |
parent | c724444ccb85551b5a0a581d673875ec9bce3d1f (diff) | |
download | servo-c4b73e703adcdd86b7cdfc48d84c87f1a888213e.tar.gz servo-c4b73e703adcdd86b7cdfc48d84c87f1a888213e.zip |
Ensure installed git version is above 1.8.1 [Bug #5637]
Versions of git before 1.8.1 do not support git submodule --recursive sync
This commit makes update_submodules() exit with an error message if the version is <1.8.1
https://github.com/servo/servo/issues/5637
Diffstat (limited to 'python/servo/bootstrap_commands.py')
-rw-r--r-- | python/servo/bootstrap_commands.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index afb054ebddc..49a9cc1514c 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -7,6 +7,7 @@ import subprocess import sys import tarfile import urllib2 +from distutils.version import LooseVersion from mach.decorators import ( CommandArgument, @@ -21,7 +22,7 @@ def download(desc, src, dst): print("Downloading %s..." % desc) dumb = (os.environ.get("TERM") == "dumb") or (not sys.stdout.isatty()) - try: + try: resp = urllib2.urlopen(src) fsize = int(resp.info().getheader('Content-Length').strip()) recved = 0 @@ -177,6 +178,13 @@ class MachCommands(CommandBase): description='Update submodules', category='bootstrap') def update_submodules(self): + # Ensure that the installed git version is >= 1.8.1 + gitversion_output = subprocess.check_output(["git", "--version"]) + gitversion = LooseVersion(gitversion_output.split(" ")[-1]) + if gitversion < LooseVersion("1.8.1"): + print("Git version 1.8.1 or above required. Current version is {}" + .format(gitversion)) + sys.exit(1) submodules = subprocess.check_output(["git", "submodule", "status"]) for line in submodules.split('\n'): components = line.strip().split(' ') |