From fc3555556cfe5ee775281eb05cfeea232efa68c7 Mon Sep 17 00:00:00 2001 From: UK992 Date: Mon, 1 Aug 2016 15:20:26 +0200 Subject: Create `mach bootstrap` based on Mozilla's mozboot bootstrapper --- python/servo/bootstrap_commands.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'python/servo/bootstrap_commands.py') diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index 8f7c7182735..78d15160736 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -19,6 +19,7 @@ import shutil import sys import StringIO import tarfile +import zipfile import urllib2 from mach.decorators import ( @@ -101,7 +102,10 @@ def download_bytes(desc, src): def extract(src, dst, movedir=None): - tarfile.open(src).extractall(dst) + if src.endswith(".zip"): + zipfile.ZipFile(src).extractall(dst) + else: + tarfile.open(src).extractall(dst) if movedir: for f in os.listdir(movedir): @@ -126,6 +130,24 @@ class MachCommands(CommandBase): else: print("export LD_LIBRARY_PATH=%s" % env["LD_LIBRARY_PATH"]) + @Command('bootstrap', + description='Install required packages for building.', + category='bootstrap') + @CommandArgument('--interactive', "-i", + action='store_true', + help='Need to answer any (Y/n) interactive prompts.') + @CommandArgument('--android', + action='store_true', + help='Install required packages for Android') + @CommandArgument('--force', '-f', + action='store_true', + help='Force reinstall packages') + def bootstrap(self, android=False, interactive=False, force=False): + from servo.bootstrapper.bootstrap import Bootstrapper + + bootstrapper = Bootstrapper() + bootstrapper.bootstrap(android=android, interactive=interactive, force=force) + @Command('bootstrap-rust', description='Download the Rust compiler', category='bootstrap') -- cgit v1.2.3