New distutils from Python 2.3a2
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19280 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
		@@ -7,6 +7,7 @@ Implements the Distutils 'build_scripts' command."""
 | 
			
		||||
__revision__ = "$Id$"
 | 
			
		||||
 | 
			
		||||
import sys, os, re
 | 
			
		||||
from stat import ST_MODE
 | 
			
		||||
from distutils import sysconfig
 | 
			
		||||
from distutils.core import Command
 | 
			
		||||
from distutils.dep_util import newer
 | 
			
		||||
@@ -54,10 +55,12 @@ class build_scripts (Command):
 | 
			
		||||
        line to refer to the current Python interpreter as we copy.
 | 
			
		||||
        """
 | 
			
		||||
        self.mkpath(self.build_dir)
 | 
			
		||||
        outfiles = []
 | 
			
		||||
        for script in self.scripts:
 | 
			
		||||
            adjust = 0
 | 
			
		||||
            script = convert_path(script)
 | 
			
		||||
            outfile = os.path.join(self.build_dir, os.path.basename(script))
 | 
			
		||||
            outfiles.append(outfile)
 | 
			
		||||
 | 
			
		||||
            if not self.force and not newer(script, outfile):
 | 
			
		||||
                log.debug("not copying %s (up-to-date)", script)
 | 
			
		||||
@@ -106,6 +109,18 @@ class build_scripts (Command):
 | 
			
		||||
                f.close()
 | 
			
		||||
                self.copy_file(script, outfile)
 | 
			
		||||
 | 
			
		||||
        if os.name == 'posix':
 | 
			
		||||
            for file in outfiles:
 | 
			
		||||
                if self.dry_run:
 | 
			
		||||
                    log.info("changing mode of %s", file)
 | 
			
		||||
                else:
 | 
			
		||||
                    oldmode = os.stat(file)[ST_MODE] & 07777
 | 
			
		||||
                    newmode = (oldmode | 0555) & 07777
 | 
			
		||||
                    if newmode != oldmode:
 | 
			
		||||
                        log.info("changing mode of %s from %o to %o",
 | 
			
		||||
                                 file, oldmode, newmode)
 | 
			
		||||
                        os.chmod(file, newmode)
 | 
			
		||||
 | 
			
		||||
    # copy_scripts ()
 | 
			
		||||
 | 
			
		||||
# class build_scripts
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user