Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

distribute is buggy, so let the user the choice, see coredev buildout…

… where this bootstrap is from.
  • Loading branch information...
commit ec812bd9d39c363a3b999d6fad3702e0ff7135c8 1 parent 5a26176
@jensens jensens authored
Showing with 32 additions and 26 deletions.
  1. +32 −26 bootstrap.py
View
58 bootstrap.py
@@ -1,6 +1,6 @@
##############################################################################
#
-# Copyright (c) 2006 Zope Corporation and Contributors.
+# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
@@ -16,6 +16,8 @@
Simply run this script in a directory containing a buildout.cfg.
The script accepts buildout command-line options, so you can
use the -c option to specify an alternate configuration file.
+
+$Id$
"""
import os, shutil, sys, tempfile, urllib2
@@ -26,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.5.2',
+ help='Use a specific zc.buildout version. *This '
+ 'bootstrap script defaults to '
+ '1.5.2, unlike usual buildout bootstrap scripts.*')
parser.add_option("-d", "--distribute",
action="store_true", dest="distribute", default=False,
help="Use Disribute rather than Setuptools.")
@@ -48,9 +55,7 @@
else:
VERSION = ''
-# We decided to always use distribute, make sure this is the default for us
-# USE_DISTRIBUTE = options.distribute
-USE_DISTRIBUTE = True
+USE_DISTRIBUTE = options.distribute
args = args + ['bootstrap']
to_reload = False
@@ -85,7 +90,6 @@ def quote(c):
def quote (c):
return c
-cmd = 'from setuptools.command.easy_install import main; main()'
ws = pkg_resources.working_set
if USE_DISTRIBUTE:
@@ -93,26 +97,28 @@ def quote (c):
else:
requirement = 'setuptools'
-if is_jython:
- import subprocess
+env = dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse(requirement)).location
+ )
- 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
+cmd = [quote(sys.executable),
+ '-c',
+ quote('from setuptools.command.easy_install import main; main()'),
+ '-mqNxd',
+ quote(tmpeggs)]
-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
+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
ws.add_entry(tmpeggs)
ws.require('zc.buildout' + VERSION)
Please sign in to comment.
Something went wrong with that request. Please try again.