mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
mach bootstrap factor out common is_firefox check
This commit is contained in:
parent
01978ccf32
commit
ecc1244e59
1 changed files with 7 additions and 7 deletions
|
@ -223,14 +223,17 @@ class DummyContext(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def bootstrap_command_only(topdir):
|
def is_firefox_checkout(topdir):
|
||||||
# See if we're inside a Firefox checkout.
|
|
||||||
parentdir = os.path.normpath(os.path.join(topdir, '..'))
|
parentdir = os.path.normpath(os.path.join(topdir, '..'))
|
||||||
is_firefox = os.path.isfile(os.path.join(parentdir,
|
is_firefox = os.path.isfile(os.path.join(parentdir,
|
||||||
'build/mach_bootstrap.py'))
|
'build/mach_bootstrap.py'))
|
||||||
|
return is_firefox
|
||||||
|
|
||||||
|
|
||||||
|
def bootstrap_command_only(topdir):
|
||||||
# we should activate the venv before importing servo.boostrap
|
# we should activate the venv before importing servo.boostrap
|
||||||
# because the module requires non-standard python packages
|
# 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
|
from servo.bootstrap import bootstrap
|
||||||
|
|
||||||
|
@ -273,10 +276,7 @@ def bootstrap(topdir):
|
||||||
print('You are running Python', platform.python_version())
|
print('You are running Python', platform.python_version())
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# See if we're inside a Firefox checkout.
|
is_firefox = 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'))
|
|
||||||
|
|
||||||
_activate_virtualenv(topdir, is_firefox)
|
_activate_virtualenv(topdir, is_firefox)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue