[Checkins] SVN: zopetoolkit/branches/1.0/bootstrap.py Use the bootstrap file prefering 1.4.4
Hanno Schlichting
hannosch at hannosch.eu
Sat Sep 25 08:28:26 EDT 2010
Log message for revision 116867:
Use the bootstrap file prefering 1.4.4
Changed:
U zopetoolkit/branches/1.0/bootstrap.py
-=-
Modified: zopetoolkit/branches/1.0/bootstrap.py
===================================================================
--- zopetoolkit/branches/1.0/bootstrap.py 2010-09-25 12:27:37 UTC (rev 116866)
+++ zopetoolkit/branches/1.0/bootstrap.py 2010-09-25 12:28:26 UTC (rev 116867)
@@ -1,6 +1,6 @@
##############################################################################
#
-# Copyright (c) 2006 Zope Foundation and Contributors.
+# Copyright (c) 2006 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
@@ -28,9 +28,14 @@
is_jython = sys.platform.startswith('java')
# parsing arguments
-parser = OptionParser()
-parser.add_option("-v", "--version", dest="version",
- help="use a specific zc.buildout version")
+parser = OptionParser(
+ 'This is a custom version of the zc.buildout %prog script. It is '
+ 'intended to meet a temporary need if you encounter problems with '
+ 'the zc.buildout 1.5 release.')
+parser.add_option("-v", "--version", dest="version", default='1.4.4',
+ help='Use a specific zc.buildout version. *This '
+ 'bootstrap script defaults to '
+ '1.4.4, unlike usual buildpout bootstrap scripts.*')
parser.add_option("-d", "--distribute",
action="store_true", dest="distribute", default=False,
help="Use Disribute rather than Setuptools.")
@@ -85,7 +90,6 @@
def quote (c):
return c
-cmd = 'from setuptools.command.easy_install import main; main()'
ws = pkg_resources.working_set
if USE_DISTRIBUTE:
@@ -93,27 +97,29 @@
else:
requirement = 'setuptools'
+env = dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse(requirement)).location
+ )
+
+cmd = [quote(sys.executable),
+ '-c',
+ quote('from setuptools.command.easy_install import main; main()'),
+ '-mqNxd',
+ quote(tmpeggs)]
+
+if 'bootstrap-testing-find-links' in os.environ:
+ cmd.extend(['-f', os.environ['bootstrap-testing-find-links']])
+
+cmd.append('zc.buildout' + VERSION)
+
if is_jython:
import subprocess
+ exitcode = subprocess.Popen(cmd, env=env).wait()
+else: # Windows prefers this, apparently; otherwise we would prefer subprocess
+ exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env]))
+assert exitcode == 0
- assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd',
- quote(tmpeggs), 'zc.buildout' + VERSION],
- env=dict(os.environ,
- PYTHONPATH=
- ws.find(pkg_resources.Requirement.parse(requirement)).location
- ),
- ).wait() == 0
-
-else:
- assert os.spawnle(
- os.P_WAIT, sys.executable, quote (sys.executable),
- '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout' + VERSION,
- dict(os.environ,
- PYTHONPATH=
- ws.find(pkg_resources.Requirement.parse(requirement)).location
- ),
- ) == 0
-
ws.add_entry(tmpeggs)
ws.require('zc.buildout' + VERSION)
import zc.buildout.buildout
More information about the checkins
mailing list