Index: main/ngren.theme/trunk/README.txt
===================================================================
--- main/ngren.theme/trunk/README.txt	(revision 13673)
+++ 	(revision )
@@ -1,6 +1,0 @@
-Introduction
-============
-
-
-
-This product may contain traces of nuts.
Index: main/ngren.theme/trunk/bootstrap.py
===================================================================
--- main/ngren.theme/trunk/bootstrap.py	(revision 13673)
+++ main/ngren.theme/trunk/bootstrap.py	(revision 13674)
@@ -19,8 +19,15 @@
 """
 
-import os, shutil, sys, tempfile
+import os
+import shutil
+import sys
+import tempfile
+
 from optparse import OptionParser
 
-tmpeggs = tempfile.mkdtemp()
+__version__ = '2015-07-01'
+# See zc.buildout's changelog if this version is up to date.
+
+tmpeggs = tempfile.mkdtemp(prefix='bootstrap-')
 
 usage = '''\
@@ -32,11 +39,12 @@
 Python that you want bin/buildout to use.
 
-Note that by using --setup-source and --download-base to point to
-local resources, you can keep this script from going over the network.
+Note that by using --find-links to point to local resources, you can keep
+this script from going over the network.
 '''
 
 parser = OptionParser(usage=usage)
-parser.add_option("-v", "--version", help="use a specific zc.buildout version")
-
+parser.add_option("--version",
+                  action="store_true", default=False,
+                  help=("Return bootstrap.py version."))
 parser.add_option("-t", "--accept-buildout-test-releases",
                   dest='accept_buildout_test_releases',
@@ -49,48 +57,83 @@
                         "even if they are alphas or betas."))
 parser.add_option("-c", "--config-file",
-                   help=("Specify the path to the buildout configuration "
-                         "file to be used."))
+                  help=("Specify the path to the buildout configuration "
+                        "file to be used."))
 parser.add_option("-f", "--find-links",
-                   help=("Specify a URL to search for buildout releases"))
-
+                  help=("Specify a URL to search for buildout releases"))
+parser.add_option("--allow-site-packages",
+                  action="store_true", default=False,
+                  help=("Let bootstrap.py use existing site packages"))
+parser.add_option("--buildout-version",
+                  help="Use a specific zc.buildout version")
+parser.add_option("--setuptools-version",
+                  help="Use a specific setuptools version")
+parser.add_option("--setuptools-to-dir",
+                  help=("Allow for re-use of existing directory of "
+                        "setuptools versions"))
 
 options, args = parser.parse_args()
+if options.version:
+    print("bootstrap.py version %s" % __version__)
+    sys.exit(0)
+
 
 ######################################################################
-# load/install distribute
-
-to_reload = False
+# load/install setuptools
+
 try:
-    import pkg_resources, setuptools
-    if not hasattr(pkg_resources, '_distribute'):
-        to_reload = True
-        raise ImportError
+    from urllib.request import urlopen
 except ImportError:
-    ez = {}
-
-    try:
-        from urllib.request import urlopen
-    except ImportError:
-        from urllib2 import urlopen
-
-    exec(urlopen('http://python-distribute.org/distribute_setup.py').read(), ez)
-    setup_args = dict(to_dir=tmpeggs, download_delay=0, no_fake=True)
-    ez['use_setuptools'](**setup_args)
-
-    if to_reload:
-        reload(pkg_resources)
-    import pkg_resources
-    # This does not (always?) update the default working set.  We will
-    # do it.
-    for path in sys.path:
-        if path not in pkg_resources.working_set.entries:
-            pkg_resources.working_set.add_entry(path)
+    from urllib2 import urlopen
+
+ez = {}
+if os.path.exists('ez_setup.py'):
+    exec(open('ez_setup.py').read(), ez)
+else:
+    exec(urlopen('https://bootstrap.pypa.io/ez_setup.py').read(), ez)
+
+if not options.allow_site_packages:
+    # ez_setup imports site, which adds site packages
+    # this will remove them from the path to ensure that incompatible versions
+    # of setuptools are not in the path
+    import site
+    # inside a virtualenv, there is no 'getsitepackages'.
+    # We can't remove these reliably
+    if hasattr(site, 'getsitepackages'):
+        for sitepackage_path in site.getsitepackages():
+            # Strip all site-packages directories from sys.path that
+            # are not sys.prefix; this is because on Windows
+            # sys.prefix is a site-package directory.
+            if sitepackage_path != sys.prefix:
+                sys.path[:] = [x for x in sys.path
+                               if sitepackage_path not in x]
+
+setup_args = dict(to_dir=tmpeggs, download_delay=0)
+
+if options.setuptools_version is not None:
+    setup_args['version'] = options.setuptools_version
+if options.setuptools_to_dir is not None:
+    setup_args['to_dir'] = options.setuptools_to_dir
+
+ez['use_setuptools'](**setup_args)
+import setuptools
+import pkg_resources
+
+# This does not (always?) update the default working set.  We will
+# do it.
+for path in sys.path:
+    if path not in pkg_resources.working_set.entries:
+        pkg_resources.working_set.add_entry(path)
 
 ######################################################################
 # Install buildout
 
-ws  = pkg_resources.working_set
-
+ws = pkg_resources.working_set
+
+setuptools_path = ws.find(
+    pkg_resources.Requirement.parse('setuptools')).location
+
+# Fix sys.path here as easy_install.pth added before PYTHONPATH
 cmd = [sys.executable, '-c',
+       'import sys; sys.path[0:0] = [%r]; ' % setuptools_path +
        'from setuptools.command.easy_install import main; main()',
        '-mZqNxd', tmpeggs]
@@ -105,20 +148,23 @@
     cmd.extend(['-f', find_links])
 
-distribute_path = ws.find(
-    pkg_resources.Requirement.parse('distribute')).location
-
 requirement = 'zc.buildout'
-version = options.version
+version = options.buildout_version
 if version is None and not options.accept_buildout_test_releases:
     # Figure out the most recent final version of zc.buildout.
     import setuptools.package_index
     _final_parts = '*final-', '*final'
+
     def _final_version(parsed_version):
-        for part in parsed_version:
-            if (part[:1] == '*') and (part not in _final_parts):
-                return False
-        return True
+        try:
+            return not parsed_version.is_prerelease
+        except AttributeError:
+            # Older setuptools
+            for part in parsed_version:
+                if (part[:1] == '*') and (part not in _final_parts):
+                    return False
+            return True
+
     index = setuptools.package_index.PackageIndex(
-        search_path=[distribute_path])
+        search_path=[setuptools_path])
     if find_links:
         index.add_find_links((find_links,))
@@ -143,8 +189,7 @@
 
 import subprocess
-if subprocess.call(cmd, env=dict(os.environ, PYTHONPATH=distribute_path)) != 0:
+if subprocess.call(cmd) != 0:
     raise Exception(
-        "Failed to execute command:\n%s",
-        repr(cmd)[1:-1])
+        "Failed to execute command:\n%s" % repr(cmd)[1:-1])
 
 ######################################################################
@@ -164,2 +209,3 @@
 zc.buildout.buildout.main(args)
 shutil.rmtree(tmpeggs)
+
Index: main/ngren.theme/trunk/buildout.cfg
===================================================================
--- main/ngren.theme/trunk/buildout.cfg	(revision 13673)
+++ main/ngren.theme/trunk/buildout.cfg	(revision 13674)
@@ -1,3 +1,6 @@
 [buildout]
+
+eggs-directory = /plone/eggs
+
 develop = .
 extends =
@@ -14,6 +17,6 @@
     http://effbot.org/downloads
 unzip = true
-extensions = buildout.dumppickedversions
-http-address = 127.0.0.1:5001
+show-picked-versions = true
+http-address = 0.0.0.0:5001
 eggs =
     Plone
Index: main/ngren.theme/trunk/setup.py
===================================================================
--- main/ngren.theme/trunk/setup.py	(revision 13673)
+++ main/ngren.theme/trunk/setup.py	(revision 13674)
@@ -7,5 +7,5 @@
       version=version,
       description="Theme for NgREN",
-      long_description=open("README.txt").read() + "\n" +
+      long_description=open("README.rst").read() + "\n" +
                        open(os.path.join("docs", "HISTORY.txt")).read(),
       # Get more strings from
