[Zope-CVS] CVS: Packages/zpkgtools/bin - zpkg:1.15
Fred L. Drake, Jr.
fred at zope.com
Fri Mar 19 16:57:34 EST 2004
Update of /cvs-repository/Packages/zpkgtools/bin
In directory cvs.zope.org:/tmp/cvs-serv28043
Modified Files:
zpkg
Log Message:
include Phillip Eby's setuptools as well, so we can get some use from
the package_data machinery
=== Packages/zpkgtools/bin/zpkg 1.14 => 1.15 ===
--- Packages/zpkgtools/bin/zpkg:1.14 Thu Mar 18 16:02:13 2004
+++ Packages/zpkgtools/bin/zpkg Fri Mar 19 16:57:33 2004
@@ -40,6 +40,7 @@
class Application:
def __init__(self, options, resource, program):
+ self.logger = logging.getLogger(program)
self.ip = None
self.options = options
self.resource = locationmap.normalizeResourceId(resource)
@@ -151,6 +152,31 @@
# support the setup.py script:
if os.path.isdir(tests_dir):
shutil.rmtree(tests_dir)
+ # now we need to find setuptools:
+ setuptools_dest = os.path.join(self.destination, "setuptools")
+ if os.path.exists(setuptools_dest):
+ # already have it
+ return
+ try:
+ import setuptools
+ except ImportError:
+ if "setuptools" in self.locations:
+ url = self.locations["setuptools"]
+ else:
+ # last resort
+ url = ("cvs://cvs.python.sourceforge.net/cvsroot/python"
+ ":python/nondist/sandbox/setuptools/setuptools")
+ self.logger.info("resource package:setuptools not configured;"
+ " using bootstrap URL")
+ source = self.loader.load(url)
+ else:
+ source = os.path.abspath(setuptools.__path__[0])
+ self.ip.copyTree(source, setuptools_dest)
+ tests_dir = os.path.join(setuptools_dest, "tests")
+ # but we don't need the tests if this was only added to
+ # support the setup.py script:
+ if os.path.isdir(tests_dir):
+ shutil.rmtree(tests_dir)
def createTarball(self):
pwd = os.getcwd()
More information about the Zope-CVS
mailing list