[Zope-CVS] CVS: Packages/zpkgtools/bin - zpkg:1.6

Fred L. Drake, Jr. fred at zope.com
Fri Mar 12 18:09:11 EST 2004


Update of /cvs-repository/Packages/zpkgtools/bin
In directory cvs.zope.org:/tmp/cvs-serv2166/bin

Modified Files:
	zpkg 
Log Message:
checkpoint: this is a lot closer to what we need to generate usable package
distributions; the information needed to call distutils.core.setup() is
collected when setup.py is run

(there are still too many assumptions to make this really do the right thing,
but fewer than there were, and the generated setup.py can be run if zpkgtools
is importable)


=== Packages/zpkgtools/bin/zpkg 1.5 => 1.6 ===
--- Packages/zpkgtools/bin/zpkg:1.5	Fri Mar 12 15:46:15 2004
+++ Packages/zpkgtools/bin/zpkg	Fri Mar 12 18:08:40 2004
@@ -71,52 +71,6 @@
             print >>sys.stderr, e
             sys.exit(1)
 
-        self.package_data = {}
-        self.package_dir = {pkgname: pkgname}
-        self.packages = [pkgname]
-        self.scripts = []
-        self.scanPackage(pkgname, self.source)
-
-    def scanPackage(self, name, directory):
-        files = os.listdir(directory)
-        # need to load package-specific data here as well
-        for fn in files:
-            fnbase, ext = os.path.splitext(fn)
-            if ext in (".py", ".pyc", ".pyo", ".so", ".sl", ".pyd"):
-                continue
-            path = os.path.join(directory, fn)
-            if os.path.isdir(path):
-                init_py = os.path.join(path, "__init__.py")
-                publication_txt = os.path.join(path, "PUBLICATION.txt")
-                if (os.path.isfile(init_py)
-                    and os.path.exists(publication_txt)):
-                    pkgname = "%s.%s" % (name, fn)
-                    self.packages.append(pkgname)
-                    self.scanPackage(pkgname, path)
-                else:
-                    # an ordinary directory
-                    pass
-            else:
-                self.addPackageFile(name, fn)
-
-    def scanDirectory(self, pkgname, directory, reldir):
-        """Scan a data directory, adding files to package_data."""
-        for fn in os.listdir(directory):
-            relfn = os.path.join(reldir, fn)
-            if os.path.isdir(fn):
-                self.scanDirectory(pkgname,
-                                   os.path.join(directory, fn),
-                                   relfn)
-            else:
-                fnbase, ext = os.path.splitext(fn)
-                if ext in (".pyc", ".pyo", ".so", ".sl", ".pyd"):
-                    continue
-                self.addPackageFile(pkgname, relfn)
-
-    def addPackageFile(self, pkgname, relfn):
-        L = self.package_data.setdefault(pkgname, [])
-        L.append(relfn)
-
     def buildCollectionDistribution(self):
         # Build the destination directory:
         self.ip = InclusionProcessor(self.source,
@@ -147,8 +101,9 @@
 
     def generateSetup(self):
         setup.generate(self.destination,
-                       self.metadata,
-                       self.options.version)
+                       self.resource_name,
+                       self.options.version,
+                       self.resource_type)
 
     def createTarball(self):
         pwd = os.getcwd()




More information about the Zope-CVS mailing list