[Zope-Checkins] CVS: Zope/inst - install.py:1.1.2.6

Fred L. Drake, Jr. fred@zope.com
Tue, 3 Dec 2002 14:06:45 -0500


Update of /cvs-repository/Zope/inst
In directory cvs.zope.org:/tmp/cvs-serv28727

Modified Files:
      Tag: chrism-install-branch
	install.py 
Log Message:
- Remove unused import (glob)
- Convert imports to Python Normal Form
- Add some comments


=== Zope/inst/install.py 1.1.2.5 => 1.1.2.6 ===
--- Zope/inst/install.py:1.1.2.5	Tue Nov 26 02:23:16 2002
+++ Zope/inst/install.py	Tue Dec  3 14:06:44 2002
@@ -16,8 +16,13 @@
 Typically called when installing Zope via the Makefile written by
 'configure.py' in the 'make install' step.
 """
-import sys, getopt, os, stat, glob, re
-from shutil import copy2, rmtree
+import getopt
+import os
+import re
+import shutil
+import stat
+import sys
+
 default_omitpattern = r'(.*~|CVS|\.[^./].*)$'
 # the last pattern in the group above allows relative paths
 # eg. "../../some/file" but attempts to prevent dotfiles from
@@ -28,7 +33,7 @@
     """
     Copy a file or directory named by src to a file or directory named by
     dst, normalizing mode bit settings as necessary.  Recursively copies
-    directory trees using copy2().
+    directory trees using shutil.copy2().
 
     Errors are reported to standard output.
 
@@ -87,7 +92,7 @@
     os.symlink(linkto, dst)
 
 def copyfile(src, dst, mode, retain_xbit):
-    copy2(src, dst)
+    shutil.copy2(src, dst)
     # change dest file mode to fmode but
     # make +wgo executable if source file is executable
     dstmode = mode
@@ -136,6 +141,7 @@
 if __name__ == '__main__':
     if len(sys.argv) < 3:
         usage()
+        # XXX Why 127 instead of 2?
         sys.exit(127)
     symlinks = 1
     dirmode = 0755
@@ -149,11 +155,13 @@
     except getopt.GetoptError, v:
         print v
         usage()
+        # XXX Shouldn't this be 2?
         sys.exit(1)
     try:
         source, dest = args
     except:
         usage()
+        # XXX Shouldn't this be 2?
         sys.exit(1)
     for o, a in opts:
         if o in ('-h', '--help'):