[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools - app.py:1.39
Fred L. Drake, Jr.
fred at zope.com
Wed Apr 28 17:04:48 EDT 2004
Update of /cvs-repository/Packages/zpkgtools/zpkgtools
In directory cvs.zope.org:/tmp/cvs-serv5120
Modified Files:
app.py
Log Message:
- make sure we "cook" the distribution section as well now that it can
include wildcard specifications
- we no longer use an importable copy of the support code; we only use
explicit configuration or the fallback locations
=== Packages/zpkgtools/zpkgtools/app.py 1.38 => 1.39 ===
--- Packages/zpkgtools/zpkgtools/app.py:1.38 Tue Apr 27 17:04:13 2004
+++ Packages/zpkgtools/zpkgtools/app.py Wed Apr 28 17:04:47 2004
@@ -113,6 +113,7 @@
specs = include.load(self.source)
self.ip.addIncludes(self.source, specs.loads)
specs.collection.cook()
+ specs.distribution.cook()
try:
self.ip.createDistributionTree(pkgdest, specs.collection)
except zpkgtools.LoadingError, e:
@@ -252,6 +253,7 @@
specs = include.load(source)
self.ip.addIncludes(source, specs.loads)
specs.collection.cook()
+ specs.distribution.cook()
if type == "package":
self.add_package_component(name, destination, specs.collection)
@@ -455,22 +457,18 @@
if name in self.locations:
url = self.locations[name]
else:
- try:
- __import__(name)
- except ImportError:
- url = fallback
- self.logger.info("resource package:%s not configured;"
- " using fallback URL" % name)
- else:
- mod = sys.modules[name]
- source = os.path.abspath(mod.__path__[0])
+ url = fallback
+ self.logger.info("resource package:%s not configured;"
+ " using fallback URL" % name)
if source is None:
self.logger.debug("loading resource 'package:%s' from %s",
name, url)
- source = self.loader.load(url)
+ source = self.loader.load_mutable_copy(url)
+ tests_dir = os.path.join(source, "tests")
+ if os.path.exists(tests_dir):
+ shutil.rmtree(tests_dir)
- tests_dir = os.path.join(source, "tests")
- self.ip.copyTree(source, destination, excludes=[tests_dir])
+ self.ip.copyTree(source, destination)
def create_manifest(self, destination):
"""Write out a MANIFEST file for the directory `destination`.
More information about the Zope-CVS
mailing list