Commit 5708e5d3 authored by alex_plugaru's avatar alex_plugaru

Fixes #113085

git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@120954 62d5b8a3-27da-0310-9561-8e5933582275
parent e5d1acfc
...@@ -35,6 +35,7 @@ import sys ...@@ -35,6 +35,7 @@ import sys
import tempfile import tempfile
import UserDict import UserDict
import warnings import warnings
import subprocess
import zc.buildout import zc.buildout
import zc.buildout.download import zc.buildout.download
import zc.buildout.easy_install import zc.buildout.easy_install
...@@ -49,9 +50,6 @@ _isurl = re.compile('([a-zA-Z0-9+.-]+)://').match ...@@ -49,9 +50,6 @@ _isurl = re.compile('([a-zA-Z0-9+.-]+)://').match
is_jython = sys.platform.startswith('java') is_jython = sys.platform.startswith('java')
if is_jython:
import subprocess
_sys_executable_has_broken_dash_S = ( _sys_executable_has_broken_dash_S = (
zc.buildout.easy_install._has_broken_dash_S(sys.executable)) zc.buildout.easy_install._has_broken_dash_S(sys.executable))
...@@ -952,12 +950,7 @@ class Buildout(UserDict.DictMixin): ...@@ -952,12 +950,7 @@ class Buildout(UserDict.DictMixin):
# library) then that should be fine. # library) then that should be fine.
env = os.environ.copy() env = os.environ.copy()
env['PYTHONPATH'] = partsdir env['PYTHONPATH'] = partsdir
if is_jython: sys.exit(subprocess.Popen(args, env=env).wait())
sys.exit(
subprocess.Popen(
[sys.executable] + list(args), env=env).wait())
else:
sys.exit(os.spawnve(os.P_WAIT, sys.executable, args, env))
def _load_extensions(self): def _load_extensions(self):
__doing__ = 'Loading extensions.' __doing__ = 'Loading extensions.'
...@@ -1808,8 +1801,6 @@ def main(args=None): ...@@ -1808,8 +1801,6 @@ def main(args=None):
buildout = Buildout(config_file, options, buildout = Buildout(config_file, options,
user_defaults, windows_restart, command) user_defaults, windows_restart, command)
getattr(buildout, command)(args) getattr(buildout, command)(args)
except SystemExit:
pass
except Exception, v: except Exception, v:
_doing() _doing()
exc_info = sys.exc_info() exc_info = sys.exc_info()
......
...@@ -1182,11 +1182,10 @@ def develop(setup, dest, ...@@ -1182,11 +1182,10 @@ def develop(setup, dest,
if log_level < logging.DEBUG: if log_level < logging.DEBUG:
logger.debug("in: %r\n%s", directory, ' '.join(args)) logger.debug("in: %r\n%s", directory, ' '.join(args))
if is_jython: try:
assert subprocess.Popen([_safe_arg(executable)] + args).wait() == 0 subprocess.check_call([_safe_arg(executable)] + args)
else: except subprocess.CalledProcessError:
assert os.spawnl(os.P_WAIT, executable, _safe_arg(executable), raise zc.buildout.UserError("Installing develop egg failed")
*args) == 0
return _copyeggs(tmp3, dest, '.egg-link', undo) return _copyeggs(tmp3, dest, '.egg-link', undo)
......
...@@ -211,9 +211,10 @@ def find_python(version): ...@@ -211,9 +211,10 @@ def find_python(version):
raise ValueError( raise ValueError(
"Couldn't figure out the executable for Python %(version)s.\n" "Couldn't figure out the executable for Python %(version)s.\n"
"Set the environment variable PYTHON%(version)s to the location\n" "Set the environment variable PYTHON%(envversion)s to the location\n"
"of the Python %(version)s executable before running the tests." "of the Python %(version)s executable before running the tests."
% {'version': version}) % {'version': version,
'envversion': env_friendly_version})
def wait_until(label, func, *args, **kw): def wait_until(label, func, *args, **kw):
if 'timeout' in kw: if 'timeout' in kw:
......
...@@ -261,3 +261,36 @@ The buildout script shows the change. ...@@ -261,3 +261,36 @@ The buildout script shows the change.
'bootstrap without --accept-buildout-test-releases (-t) to return to ' 'bootstrap without --accept-buildout-test-releases (-t) to return to '
'default behavior.') 'default behavior.')
... ...
If the update process for buildout or setuptools fails the error should be
caught (displaying a warning) and the rest of the buildout update process
should continue.
>>> version = sys.version_info[0:2]
>>> egg = new_releases + '/zc.buildout-99.99-py%s.%s.egg ' % version
>>> copy_egg = new_releases + '/zc.buildout-1000-py%s.%s.egg ' % version
>>> system('cp ' + egg + copy_egg)
''
Create a broken egg
>>> mkdir(sample_buildout, 'broken')
>>> write(sample_buildout, 'broken', 'setup.py', "import broken_egg\n")
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... find-links = %(new_releases)s
... index = %(new_releases)s
... parts = show-versions
... develop =
... broken
...
... [broken]
... recipe = zc.recipe.egg
... eggs = broken
... """ % dict(new_releases=new_releases))
>>> import subprocess
>>> subprocess.check_call([buildout])
Traceback (most recent call last):
...
CalledProcessError: Command '['/sample-buildout/bin/buildout']' returned non-zero exit status 1
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