Commit 06c677a9 authored by Andreas Jung's avatar Andreas Jung

applied various patches for Windows issue

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