Commit 47f861bd authored by georgyberdyshev's avatar georgyberdyshev

Allow to bootstrap on Jython.

Signed-off-by: default avatarGeorgy Berdyshev - Георгий Бердышев <codingmaster@gmail.com>


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@90478 62d5b8a3-27da-0310-9561-8e5933582275
parent 7b62a9e7
...@@ -24,6 +24,8 @@ import os, shutil, sys, tempfile, urllib2 ...@@ -24,6 +24,8 @@ import os, shutil, sys, tempfile, urllib2
tmpeggs = tempfile.mkdtemp() tmpeggs = tempfile.mkdtemp()
is_jython = sys.platform.startswith('java')
try: try:
import pkg_resources import pkg_resources
except ImportError: except ImportError:
...@@ -46,14 +48,27 @@ else: ...@@ -46,14 +48,27 @@ else:
cmd = 'from setuptools.command.easy_install import main; main()' cmd = 'from setuptools.command.easy_install import main; main()'
ws = pkg_resources.working_set ws = pkg_resources.working_set
assert os.spawnle(
os.P_WAIT, sys.executable, quote (sys.executable), if is_jython:
'-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout', import subprocess
dict(os.environ,
PYTHONPATH= assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd',
ws.find(pkg_resources.Requirement.parse('setuptools')).location quote(tmpeggs), 'zc.buildout'],
), env=dict(os.environ,
) == 0 PYTHONPATH=
ws.find(pkg_resources.Requirement.parse('setuptools')).location
),
).wait() == 0
else:
assert os.spawnle(
os.P_WAIT, sys.executable, quote (sys.executable),
'-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
dict(os.environ,
PYTHONPATH=
ws.find(pkg_resources.Requirement.parse('setuptools')).location
),
) == 0
ws.add_entry(tmpeggs) ws.add_entry(tmpeggs)
ws.require('zc.buildout') ws.require('zc.buildout')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment