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:
Gregory Szorc 2013-09-20 15:46:23 -07:00
Родитель e82afeaa6d
Коммит 5916036948
5 изменённых файлов: 13 добавлений и 18 удалений

Просмотреть файл

@ -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)