diff options
author | Josh Mcguigan <joshmcg88@gmail.com> | 2019-10-28 05:12:20 -0700 |
---|---|---|
committer | Josh Mcguigan <joshmcg88@gmail.com> | 2019-10-28 05:12:20 -0700 |
commit | ecc1244e59507560f2a77d0fe3cd0a2e14d2af8d (patch) | |
tree | 68134d95ad1aad585e8202b046ec244a72a1caa1 /python/mach_bootstrap.py | |
parent | 01978ccf32e06c7f285365abc511e3b8d6975ebb (diff) | |
download | servo-ecc1244e59507560f2a77d0fe3cd0a2e14d2af8d.tar.gz servo-ecc1244e59507560f2a77d0fe3cd0a2e14d2af8d.zip |
mach bootstrap factor out common is_firefox check
Diffstat (limited to 'python/mach_bootstrap.py')
-rw-r--r-- | python/mach_bootstrap.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/python/mach_bootstrap.py b/python/mach_bootstrap.py index 9b36d3fec31..2c83c6492e7 100644 --- a/python/mach_bootstrap.py +++ b/python/mach_bootstrap.py @@ -223,14 +223,17 @@ class DummyContext(object): pass -def bootstrap_command_only(topdir): - # See if we're inside a Firefox checkout. +def is_firefox_checkout(topdir): parentdir = os.path.normpath(os.path.join(topdir, '..')) is_firefox = os.path.isfile(os.path.join(parentdir, 'build/mach_bootstrap.py')) + return is_firefox + + +def bootstrap_command_only(topdir): # we should activate the venv before importing servo.boostrap # because the module requires non-standard python packages - _activate_virtualenv(topdir, is_firefox) + _activate_virtualenv(topdir, is_firefox_checkout(topdir)) from servo.bootstrap import bootstrap @@ -273,10 +276,7 @@ def bootstrap(topdir): print('You are running Python', platform.python_version()) sys.exit(1) - # See if we're inside a Firefox checkout. - parentdir = os.path.normpath(os.path.join(topdir, '..')) - is_firefox = os.path.isfile(os.path.join(parentdir, - 'build/mach_bootstrap.py')) + is_firefox = is_firefox_checkout(topdir) _activate_virtualenv(topdir, is_firefox) |