[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools - include.py:1.2

Fred L. Drake, Jr. fred at zope.com
Fri Mar 12 13:53:39 EST 2004


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

Modified Files:
	include.py 
Log Message:
be still more careful about what we copy: don't include compiled
bytecode or extensions; this could happen when working from a checkout
(likely a questionable practice!)


=== Packages/zpkgtools/zpkgtools/include.py 1.1 => 1.2 ===
--- Packages/zpkgtools/zpkgtools/include.py:1.1	Fri Mar  5 16:39:19 2004
+++ Packages/zpkgtools/zpkgtools/include.py	Fri Mar 12 13:53:34 2004
@@ -13,6 +13,7 @@
 ##############################################################################
 """Processor for inclusions when building a release."""
 
+import fnmatch
 import glob
 import os
 import posixpath
@@ -25,6 +26,7 @@
 
 # Names that are exluded from globbing results:
 EXCLUDE_NAMES = ["CVS", ".cvsignore", "RCS", "SCCS", ".svn"]
+EXCLUDE_PATTERNS = ["*.py[cdo]", "*.s[ol]"]
 
 
 class InclusionError(Exception):
@@ -126,8 +128,14 @@
                 if os.path.basename(n) not in EXCLUDE_NAMES]
 
     def filterNames(self, names):
-        return [n for n in names
-                if n not in EXCLUDE_NAMES]
+        names = [n for n in names
+                 if n not in EXCLUDE_NAMES]
+        # This is needed when building a distro from a working
+        # copy (likely a checkout) rather than a pristine export:
+        for pattern in EXCLUDE_PATTERNS:
+            names = [n for n in names
+                     if not fnmatch.fnmatch(n, pattern)]
+        return names
 
     def normalizePath(self, path, type, filename, lineno):
         if ":" in path:




More information about the Zope-CVS mailing list