зеркало из https://github.com/mozilla/gecko-dev.git
Bug 794506 - Part 1: Move virtualenv code under mozbuild; r=ted
--HG-- rename : build/virtualenv/packages.txt => build/virtualenv_packages.txt rename : build/virtualenv/populate_virtualenv.py => python/mozbuild/mozbuild/virtualenv.py
This commit is contained in:
Родитель
e82afeaa6d
Коммит
5916036948
|
@ -24,7 +24,7 @@ dnl If this is a mozilla-central, we'll find the virtualenv in the top
|
|||
dnl source directory. If this is a SpiderMonkey build, we assume we're at
|
||||
dnl js/src and try to find the virtualenv from the mozilla-central root.
|
||||
for base in $MOZILLA_CENTRAL_PATH $_topsrcdir $_topsrcdir/../..; do
|
||||
possible=$base/build/virtualenv/populate_virtualenv.py
|
||||
possible=$base/python/mozbuild/mozbuild/virtualenv.py
|
||||
|
||||
if test -e $possible; then
|
||||
_virtualenv_topsrcdir=$base
|
||||
|
@ -53,7 +53,8 @@ if test -z $DONT_POPULATE_VIRTUALENV; then
|
|||
dnl virtualenv is present and up to date. It sanitizes the environment
|
||||
dnl for us, so we don't need to clean anything out.
|
||||
$PYTHON $_virtualenv_populate_path \
|
||||
$_virtualenv_topsrcdir $MOZ_BUILD_ROOT $MOZ_BUILD_ROOT/_virtualenv || exit 1
|
||||
$_virtualenv_topsrcdir $MOZ_BUILD_ROOT $MOZ_BUILD_ROOT/_virtualenv \
|
||||
$_virtualenv_topsrcdir/build/virtualenv_packages.txt || exit 1
|
||||
|
||||
case "$host_os" in
|
||||
mingw*)
|
||||
|
|
|
@ -325,8 +325,8 @@ CONFIG_STATUS_DEPS := \
|
|||
$(TOPSRCDIR)/config/milestone.txt \
|
||||
$(TOPSRCDIR)/js/src/config/milestone.txt \
|
||||
$(TOPSRCDIR)/browser/config/version.txt \
|
||||
$(TOPSRCDIR)/build/virtualenv/packages.txt \
|
||||
$(TOPSRCDIR)/build/virtualenv/populate_virtualenv.py \
|
||||
$(TOPSRCDIR)/build/virtualenv_packages.txt \
|
||||
$(TOPSRCDIR)/python/mozbuild/mozbuild/virtualenv.py \
|
||||
$(TOPSRCDIR)/testing/mozbase/packages.txt \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ dnl If this is a mozilla-central, we'll find the virtualenv in the top
|
|||
dnl source directory. If this is a SpiderMonkey build, we assume we're at
|
||||
dnl js/src and try to find the virtualenv from the mozilla-central root.
|
||||
for base in $MOZILLA_CENTRAL_PATH $_topsrcdir $_topsrcdir/../..; do
|
||||
possible=$base/build/virtualenv/populate_virtualenv.py
|
||||
possible=$base/python/mozbuild/mozbuild/virtualenv.py
|
||||
|
||||
if test -e $possible; then
|
||||
_virtualenv_topsrcdir=$base
|
||||
|
@ -53,7 +53,8 @@ if test -z $DONT_POPULATE_VIRTUALENV; then
|
|||
dnl virtualenv is present and up to date. It sanitizes the environment
|
||||
dnl for us, so we don't need to clean anything out.
|
||||
$PYTHON $_virtualenv_populate_path \
|
||||
$_virtualenv_topsrcdir $MOZ_BUILD_ROOT $MOZ_BUILD_ROOT/_virtualenv || exit 1
|
||||
$_virtualenv_topsrcdir $MOZ_BUILD_ROOT $MOZ_BUILD_ROOT/_virtualenv \
|
||||
$_virtualenv_topsrcdir/build/virtualenv_packages.txt || exit 1
|
||||
|
||||
case "$host_os" in
|
||||
mingw*)
|
||||
|
|
|
@ -366,7 +366,7 @@ class VirtualenvManager(object):
|
|||
# the virtualenv for paths to be proper.
|
||||
|
||||
args = [self.python_path, __file__, 'populate', self.topsrcdir,
|
||||
self.topobjdir, self.virtualenv_root]
|
||||
self.topobjdir, self.virtualenv_root, self.manifest_path]
|
||||
|
||||
result = subprocess.call(args, stdout=self.log_handle,
|
||||
stderr=subprocess.STDOUT, cwd=self.topsrcdir)
|
||||
|
@ -409,26 +409,19 @@ def verify_python_version(log_handle):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) < 4:
|
||||
print('Usage: populate_virtualenv.py /path/to/topsrcdir /path/to/topobjdir /path/to/virtualenv')
|
||||
if len(sys.argv) < 5:
|
||||
print('Usage: populate_virtualenv.py /path/to/topsrcdir /path/to/topobjdir /path/to/virtualenv /path/to/virtualenv_manifest')
|
||||
sys.exit(1)
|
||||
|
||||
verify_python_version(sys.stdout)
|
||||
|
||||
topsrcdir = sys.argv[1]
|
||||
topobjdir = sys.argv[2]
|
||||
virtualenv_path = sys.argv[3]
|
||||
topsrcdir, topobjdir, virtualenv_path, manifest_path = sys.argv[1:5]
|
||||
populate = False
|
||||
|
||||
# This should only be called internally.
|
||||
if sys.argv[1] == 'populate':
|
||||
populate = True
|
||||
topsrcdir = sys.argv[2]
|
||||
topobjdir = sys.argv[3]
|
||||
virtualenv_path = sys.argv[4]
|
||||
|
||||
# path to default packages.txt
|
||||
manifest_path = os.path.join(topsrcdir, 'build', 'virtualenv', 'packages.txt')
|
||||
topsrcdir, topobjdir, virtualenv_path, manifest_path = sys.argv[2:]
|
||||
|
||||
manager = VirtualenvManager(topsrcdir, topobjdir, virtualenv_path,
|
||||
sys.stdout, manifest_path)
|
Загрузка…
Ссылка в новой задаче