File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77__revision__ = "$Id$"
88
99import sys , os , re
10+ from stat import ST_MODE
1011from distutils import sysconfig
1112from distutils .core import Command
1213from distutils .dep_util import newer
@@ -54,10 +55,12 @@ def copy_scripts (self):
5455 line to refer to the current Python interpreter as we copy.
5556 """
5657 self .mkpath (self .build_dir )
58+ outfiles = []
5759 for script in self .scripts :
5860 adjust = 0
5961 script = convert_path (script )
6062 outfile = os .path .join (self .build_dir , os .path .basename (script ))
63+ outfiles .append (outfile )
6164
6265 if not self .force and not newer (script , outfile ):
6366 log .debug ("not copying %s (up-to-date)" , script )
@@ -106,6 +109,15 @@ def copy_scripts (self):
106109 f .close ()
107110 self .copy_file (script , outfile )
108111
112+ if os .name == 'posix' :
113+ for file in outfiles :
114+ if self .dry_run :
115+ log .info ("changing mode of %s" , file )
116+ else :
117+ mode = ((os .stat (file )[ST_MODE ]) | 0555 ) & 07777
118+ log .info ("changing mode of %s to %o" , file , mode )
119+ os .chmod (file , mode )
120+
109121 # copy_scripts ()
110122
111123# class build_scripts
You can’t perform that action at this time.
0 commit comments