[Python-checkins] python/dist/src/Lib/distutils/command build_scripts.py,1.19,1.20

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Wed, 29 Jan 2003 08:58:35 -0800


Update of /cvsroot/python/python/dist/src/Lib/distutils/command
In directory sc8-pr-cvs1:/tmp/cvs-serv32120

Modified Files:
	build_scripts.py 
Log Message:
Only log a message and chmod() when the mode isn't already what we
want it to be.  Log both the old and new mode.


Index: build_scripts.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/build_scripts.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** build_scripts.py	24 Jan 2003 14:56:52 -0000	1.19
--- build_scripts.py	29 Jan 2003 16:58:31 -0000	1.20
***************
*** 115,121 ****
                      log.info("changing mode of %s", file)
                  else:
!                     mode = ((os.stat(file)[ST_MODE]) | 0555) & 07777
!                     log.info("changing mode of %s to %o", file, mode)
!                     os.chmod(file, mode)
  
      # copy_scripts ()
--- 115,124 ----
                      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 ()