mirror of
https://github.com/python/cpython.git
synced 2025-09-18 06:30:38 +00: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
1 changed files with 6 additions and 3 deletions
|
@ -114,9 +114,12 @@ class build_scripts (Command):
|
||||||
if self.dry_run:
|
if self.dry_run:
|
||||||
log.info("changing mode of %s", file)
|
log.info("changing mode of %s", file)
|
||||||
else:
|
else:
|
||||||
mode = ((os.stat(file)[ST_MODE]) | 0555) & 07777
|
oldmode = os.stat(file)[ST_MODE] & 07777
|
||||||
log.info("changing mode of %s to %o", file, mode)
|
newmode = (oldmode | 0555) & 07777
|
||||||
os.chmod(file, mode)
|
if newmode != oldmode:
|
||||||
|
log.info("changing mode of %s from %o to %o",
|
||||||
|
file, oldmode, newmode)
|
||||||
|
os.chmod(file, newmode)
|
||||||
|
|
||||||
# copy_scripts ()
|
# copy_scripts ()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue