[Zope-Checkins] CVS: Zope3 - test.py:1.1.2.8 stupid_build.py:1.1.2.8

Shane Hathaway shane@cvs.zope.org
Wed, 24 Apr 2002 11:11:29 -0400


Update of /cvs-repository/Zope3
In directory cvs.zope.org:/tmp/cvs-serv31636

Modified Files:
      Tag: Zope-3x-branch
	test.py stupid_build.py 
Log Message:
Fixed case normalization in removing stale byte code and allowed options to be passed to stupid_build, for example to select which compiler to use.

=== Zope3/test.py 1.1.2.7 => 1.1.2.8 ===
 
 def remove_stale_bytecode(arg, dirname, names):
+    names = map(os.path.normcase, names)
     for name in names:
-        name = os.path.normcase(name)
         if name.endswith(".pyc") or name.endswith(".pyo"):
             srcname = name[:-1]
             if srcname not in names:


=== Zope3/stupid_build.py 1.1.2.7 => 1.1.2.8 ===
 $ python2.2 stupid_build.py
 
+Usage with a specific compiler such as mingw32:
+
+$ python2.2 stupid_build.py -c mingw32
+
 This module hopefully won't last long enough to need a license. ;-)
 """
 
 import sys, os
 
 def remove_stale_bytecode(arg, dirname, names):
+    names = map(os.path.normcase, names)
     for name in names:
-        name = os.path.normcase(name)
         if name.endswith(".pyc") or name.endswith(".pyo"):
             srcname = name[:-1]
             if srcname not in names:
@@ -59,11 +63,14 @@
         
     setup_dirs = []
     os.path.walk(os.getcwd(), visit, setup_dirs)
+    args = tuple(sys.argv[1:])
+    if not args:
+        args = ('clean',)
     for dir in setup_dirs:
         print "Building extensions in %s" % dir
         os.chdir(dir)
         os.spawnl(os.P_WAIT, sys.executable,
-                  sys.executable, "setup.py", 'build_ext', '-i', 'clean')
+                  sys.executable, "setup.py", 'build_ext', '-i', *args)
         print
 
 if __name__ == "__main__":