[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools - include.py:1.25 publication.py:1.4 setup.py:1.15

Fred L. Drake, Jr. fred at zope.com
Wed Apr 7 18:00:52 EDT 2004


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

Modified Files:
	include.py publication.py setup.py 
Log Message:
make sure zpkg never recurses into a directory with a PUBLICATION.cfg file;
this means we cannot include a PUBLICATION.cfg in the test data, but
need to generate it for the appropriate tests


=== Packages/zpkgtools/zpkgtools/include.py 1.24 => 1.25 ===
--- Packages/zpkgtools/zpkgtools/include.py:1.24	Wed Apr  7 14:09:16 2004
+++ Packages/zpkgtools/zpkgtools/include.py	Wed Apr  7 18:00:13 2004
@@ -35,6 +35,7 @@
 from zpkgtools import Error
 
 from zpkgtools import cvsloader
+from zpkgtools import publication
 
 
 # Names that are exluded from globbing results:
@@ -229,8 +230,10 @@
         """
         if not os.path.exists(destination):
             os.mkdir(destination)
+            shutil.copymode(source, destination)
+            shutil.copystat(source, destination)
         prefix = os.path.join(source, "")
-        for dirname, dirs, files in os.walk(source):
+        for dirname, dirs, files in os.walk(source, topdown=True):
             dirs[:] = filter_names(dirs)
             files = filter_names(files)
 
@@ -257,9 +260,12 @@
                 # owner/group are not copied.
                 self.copy_file(srcname, destname)
 
-            for dir in dirs:
+            for dir in dirs[:]:
                 srcname = os.path.join(dirname, dir)
                 destname = os.path.join(destdir, dir)
+                if publication.PUBLICATION_CONF in os.listdir(srcname):
+                    dirs.remove(dir)
+                    continue
                 # Create the directory, copying over the permission
                 # bits and stat info.
                 os.mkdir(destname)


=== Packages/zpkgtools/zpkgtools/publication.py 1.3 => 1.4 ===
--- Packages/zpkgtools/zpkgtools/publication.py:1.3	Tue Apr  6 18:13:45 2004
+++ Packages/zpkgtools/zpkgtools/publication.py	Wed Apr  7 18:00:13 2004
@@ -23,6 +23,9 @@
 from StringIO import StringIO
 
 
+PUBLICATION_CONF = "PUBLICATION.cfg"
+
+
 # XXX The dump() and dumps() methods are very similar to the
 # DistributionMetadata.write_pkg_info() method, but don't constrain
 # where the data is written.  Much of this can be discarded if


=== Packages/zpkgtools/zpkgtools/setup.py 1.14 => 1.15 ===
--- Packages/zpkgtools/zpkgtools/setup.py:1.14	Wed Apr  7 14:15:11 2004
+++ Packages/zpkgtools/zpkgtools/setup.py	Wed Apr  7 18:00:13 2004
@@ -27,9 +27,6 @@
 _logger = logging.getLogger(__name__)
 
 
-PUBLICATION_CONF = "PUBLICATION.cfg"
-
-
 class SetupContext:
     """Object representing the arguments to distutils.core.setup()."""
 
@@ -44,7 +41,8 @@
         self.platforms = None
         self.classifiers = None
         self.load_metadata(
-            os.path.join(self._working_dir, pkgname, PUBLICATION_CONF))
+            os.path.join(self._working_dir, pkgname,
+                         publication.PUBLICATION_CONF))
 
     def setup(self):
         kwargs = self.__dict__.copy()
@@ -95,7 +93,8 @@
                 init_py = os.path.join(path, "__init__.py")
                 if os.path.isfile(init_py):
                     # if this package is published separately, skip it:
-                    if os.path.isfile(os.path.join(path, PUBLICATION_CONF)):
+                    if os.path.isfile(
+                        os.path.join(path, publication.PUBLICATION_CONF)):
                         continue
                     pkgname = "%s.%s" % (name, fn)
                     self.scan_package(




More information about the Zope-CVS mailing list