summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Fretin <vincent.fretin@gmail.com>2013-06-01 16:30:16 (GMT)
committerVincent Fretin <vincent.fretin@gmail.com>2013-06-01 16:30:16 (GMT)
commitaf07e0ca686a1b972f4c1b6de109f3a92e04cb15 (patch)
treec641ffd3e5e578c1cc0f0876f2f276656102c557
parent189b0851921e8f88cd3c9e50bb8532b49f78f372 (diff)
downloadcollective.dms.batchimport-af07e0ca686a1b972f4c1b6de109f3a92e04cb15.zip
collective.dms.batchimport-af07e0ca686a1b972f4c1b6de109f3a92e04cb15.tar.gz
collective.dms.batchimport-af07e0ca686a1b972f4c1b6de109f3a92e04cb15.tar.bz2
boostrap.py to force buildout 1.x for jenkins
-rw-r--r--bootstrap.py29
1 files changed, 22 insertions, 7 deletions
diff --git a/bootstrap.py b/bootstrap.py
index 7647cbb..1cce2ce 100644
--- a/bootstrap.py
+++ b/bootstrap.py
@@ -136,10 +136,6 @@ parser.add_option("-c", None, action="store", dest="config_file",
options, args = parser.parse_args()
-# if -c was provided, we push it back into args for buildout's main function
-if options.config_file is not None:
- args += ['-c', options.config_file]
-
if options.eggs:
eggs_dir = os.path.abspath(os.path.expanduser(options.eggs))
else:
@@ -152,8 +148,7 @@ if options.setup_source is None:
options.setup_source = setuptools_source
if options.accept_buildout_test_releases:
- args.append('buildout:accept-buildout-test-releases=true')
-args.append('bootstrap')
+ args.insert(0, 'buildout:accept-buildout-test-releases=true')
try:
import pkg_resources
@@ -170,6 +165,8 @@ except ImportError:
setup_args['download_base'] = options.download_base
if options.use_distribute:
setup_args['no_fake'] = True
+ if sys.version_info[:2] == (2, 4):
+ setup_args['version'] = '0.6.32'
ez['use_setuptools'](**setup_args)
if 'pkg_resources' in sys.modules:
reload(sys.modules['pkg_resources'])
@@ -192,6 +189,8 @@ if not has_broken_dash_S:
find_links = options.download_base
if not find_links:
find_links = os.environ.get('bootstrap-testing-find-links')
+if not find_links and options.accept_buildout_test_releases:
+ find_links = 'http://downloads.buildout.org/'
if find_links:
cmd.extend(['-f', quote(find_links)])
@@ -228,6 +227,8 @@ if version is None and not options.accept_buildout_test_releases:
bestv = None
for dist in index[req.project_name]:
distv = dist.parsed_version
+ if distv >= pkg_resources.parse_version('2dev'):
+ continue
if _final_version(distv):
if bestv is None or distv > bestv:
best = [dist]
@@ -237,8 +238,12 @@ if version is None and not options.accept_buildout_test_releases:
if best:
best.sort()
version = best[-1].version
+
if version:
- requirement = '=='.join((requirement, version))
+ requirement += '=='+version
+else:
+ requirement += '<2dev'
+
cmd.append(requirement)
if is_jython:
@@ -257,6 +262,16 @@ if exitcode != 0:
ws.add_entry(eggs_dir)
ws.require(requirement)
import zc.buildout.buildout
+
+# If there isn't already a command in the args, add bootstrap
+if not [a for a in args if '=' not in a]:
+ args.append('bootstrap')
+
+
+# if -c was provided, we push it back into args for buildout's main function
+if options.config_file is not None:
+ args[0:0] = ['-c', options.config_file]
+
zc.buildout.buildout.main(args)
if not options.eggs: # clean up temporary egg directory
shutil.rmtree(eggs_dir)