[Zope-Checkins] SVN: Zope/branches/five-integration/setup.py Ignore CVS and also .svn directories

Sidnei da Silva sidnei at awkly.org
Wed Mar 16 07:05:45 EST 2005


Log message for revision 29488:
  Ignore CVS and also .svn directories

Changed:
  U   Zope/branches/five-integration/setup.py

-=-
Modified: Zope/branches/five-integration/setup.py
===================================================================
--- Zope/branches/five-integration/setup.py	2005-03-16 11:44:44 UTC (rev 29487)
+++ Zope/branches/five-integration/setup.py	2005-03-16 12:05:44 UTC (rev 29488)
@@ -166,7 +166,7 @@
         distutils.core.Distribution.__init__(self, attrs)
         self.cmdclass["install"] = ZopeInstall
         self.cmdclass["install_data"] = ZopeInstallData
-        
+
 # presumes this script lives in the base dir
 BASE_DIR=os.path.dirname(os.path.abspath(sys.argv[0]))
 
@@ -1122,8 +1122,10 @@
         '.js',   '.mo',  '.png', '.pt', '.stx', '.ref',
         '.txt',  '.xml', '.zcml', '.mar', '.in', '.sample',
         ]
+IGNORE_NAMES = (
+    'CVS', '.svn', # Revision Control Directories
+    )
 
-
 # This class serves multiple purposes.  It walks the file system looking for
 # auxiliary files that distutils doesn't install properly, and it actually
 # copies those files (when hooked into by distutils).  It also walks the file
@@ -1139,8 +1141,12 @@
         # the prefix when calculating the package names from the file names.
         prefix, rest = os.path.split(prefix)
         self._plen = len(prefix) + 1
-        
+
     def visit(self, ignore, dir, files):
+        # Remove ignored filenames
+        for ignore in IGNORE_NAMES:
+            if ignore in files:
+                files.remove(ignore)
         for file in files:
             # First see if this is one of the packages we want to add, or if
             # we're really skipping this package.
@@ -1180,7 +1186,7 @@
 packages = []
 
 for name in z3_packages:
-    basedir = os.path.join(PACKAGES_ROOT, name)    
+    basedir = os.path.join(PACKAGES_ROOT, name)
     finder = Finder(EXTS, basedir)
     os.path.walk(basedir, finder.visit, None)
     packages.extend(finder.get_packages())
@@ -1253,7 +1259,7 @@
                  "persistent/cPersistence.h",
                  "zope/proxy/_zope_proxy_proxy.c",
                  ]),
-    
+
     ]
 
 # We're using the module docstring as the distutils descriptions.
@@ -1319,8 +1325,9 @@
 os.chdir(BASE_DIR)
 
 def skel_visit(skel, dirname, names):
-    if "CVS" in names:
-        names.remove("CVS")
+    for ignore in IGNORE_NAMES:
+        if ignore in names:
+            names.remove(ignore)
     L = []
     for name in names:
         if os.path.isfile(os.path.join(dirname, name)):



More information about the Zope-Checkins mailing list