Commit 834374a2 authored by andreasjung's avatar andreasjung

applied various patches for Windows issue


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@85041 62d5b8a3-27da-0310-9561-8e5933582275
parent ed69a310
......@@ -10,6 +10,8 @@ Change History
- Made easy_install.py's _get_version except non final releases of Python,
like 2.4.4c0. (hannosch)
- various patches for Windows (patch by Gottfried Ganssauge) (ajung)
- applied patch fixing rmtree issues on Windows (patch by
Gottfried Ganssauge) (ajung)
......
......@@ -34,14 +34,21 @@ except ImportError:
import pkg_resources
cmd = 'from setuptools.command.easy_install import main; main()'
if sys.platform == 'win32':
cmd = '"%s"' % cmd # work around spawn lamosity on windows
def quote(c):
if ' ' in c:
return '"%s"' % c # work around spawn lamosity on windows
else:
return c
else:
def quote (c):
return c
ws = pkg_resources.working_set
cmd = 'from setuptools.command.easy_install import main; main()'
ws = pkg_resources.working_set
assert os.spawnle(
os.P_WAIT, sys.executable, sys.executable,
'-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
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
......
......@@ -690,7 +690,7 @@ class Buildout(UserDict.DictMixin):
args.insert(1, '-W')
if not __debug__:
args.insert(0, '-O')
args.insert(0, sys.executable)
args.insert(0, zc.buildout.easy_install._safe_arg (sys.executable))
os.execv(sys.executable, args)
self._logger.info("Upgraded:\n %s;\nrestarting.",
......@@ -713,7 +713,7 @@ class Buildout(UserDict.DictMixin):
args = map(zc.buildout.easy_install._safe_arg, sys.argv)
if not __debug__:
args.insert(0, '-O')
args.insert(0, sys.executable)
args.insert(0, zc.buildout.easy_install._safe_arg (sys.executable))
sys.exit(os.spawnv(os.P_WAIT, sys.executable, args))
def _load_extensions(self):
......@@ -765,7 +765,7 @@ class Buildout(UserDict.DictMixin):
setup=setup,
__file__ = setup,
))
os.spawnl(os.P_WAIT, sys.executable, sys.executable, tsetup,
os.spawnl(os.P_WAIT, sys.executable, zc.buildout.easy_install._safe_arg (sys.executable), tsetup,
*[zc.buildout.easy_install._safe_arg(a)
for a in args])
finally:
......
......@@ -281,7 +281,7 @@ class Installer:
args += (dict(os.environ, PYTHONPATH=path), )
sys.stdout.flush() # We want any pending output first
exit_code = os.spawnle(
os.P_WAIT, self._executable, self._executable,
os.P_WAIT, self._executable, _safe_arg (self._executable),
*args)
dists = []
......@@ -823,7 +823,7 @@ def develop(setup, dest,
if log_level < logging.DEBUG:
logger.debug("in: %r\n%s", directory, ' '.join(args))
assert os.spawnl(os.P_WAIT, executable, executable, *args) == 0
assert os.spawnl(os.P_WAIT, executable, _safe_arg (executable), *args) == 0
return _copyeggs(tmp3, dest, '.egg-link', undo)
......
......@@ -102,7 +102,7 @@ def _runsetup(setup, executable, *args):
here = os.getcwd()
try:
os.chdir(d)
os.spawnle(os.P_WAIT, executable, executable, setup, *args)
os.spawnle(os.P_WAIT, executable, zc.buildout.easy_install._safe_arg (executable), setup, *args)
if os.path.exists('build'):
rmtree('build')
finally:
......
......@@ -2556,7 +2556,7 @@ def updateSetup(test):
here = os.getcwd()
os.chdir(os.path.dirname(dist.location))
assert os.spawnle(
os.P_WAIT, sys.executable, sys.executable,
os.P_WAIT, sys.executable, zc.buildout.easy_install._safe_arg (sys.executable),
os.path.join(os.path.dirname(dist.location), 'setup.py'),
'-q', 'bdist_egg', '-d', eggs,
dict(os.environ,
......
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