[Python-checkins] r53315 - sandbox/trunk/setuptools/setuptools/command/easy_install.py

phillip.eby python-checkins at python.org
Tue Jan 9 19:57:24 CET 2007


Author: phillip.eby
Date: Tue Jan  9 19:57:23 2007
New Revision: 53315

Modified:
   sandbox/trunk/setuptools/setuptools/command/easy_install.py
Log:
Fix not making Cygwin .dll's executable when installing in non-zip-safe 
mode.


Modified: sandbox/trunk/setuptools/setuptools/command/easy_install.py
==============================================================================
--- sandbox/trunk/setuptools/setuptools/command/easy_install.py	(original)
+++ sandbox/trunk/setuptools/setuptools/command/easy_install.py	Tue Jan  9 19:57:23 2007
@@ -983,16 +983,22 @@
         return dst     # only unpack-and-compile skips files for dry run
 
     def unpack_and_compile(self, egg_path, destination):
-        to_compile = []
+        to_compile = []; to_chmod = []
 
         def pf(src,dst):
             if dst.endswith('.py') and not src.startswith('EGG-INFO/'):
                 to_compile.append(dst)
-            self.unpack_progress(src,dst)
+            self.unpack_progress(src,dst); to_chmod.append(dst)
             return not self.dry_run and dst or None
 
         unpack_archive(egg_path, destination, pf)
         self.byte_compile(to_compile)
+        if not self.dry_run:
+            flags = stat.S_IXGRP|stat.S_IXGRP
+            for f in to_chmod:
+                mode = ((os.stat(f)[stat.ST_MODE]) | 0555) & 07777
+                log.debug("changing mode of %s to %o", f, mode)
+                os.chmod(f, mode)
 
 
     def byte_compile(self, to_compile):
@@ -1017,12 +1023,6 @@
 
 
 
-
-
-
-
-
-
     def no_default_version_msg(self):
         return """bad install directory or PYTHONPATH
 


More information about the Python-checkins mailing list