mirror of
https://github.com/python/cpython.git
synced 2024-11-26 11:24:40 +08:00
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.
This commit is contained in:
parent
6afc5e02fa
commit
d3590f937f
@ -114,9 +114,12 @@ class build_scripts (Command):
|
||||
if self.dry_run:
|
||||
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)
|
||||
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 ()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user