diff options
author | Guido van Rossum <guido@python.org> | 2003-01-24 14:56:52 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2003-01-24 14:56:52 (GMT) |
commit | bcb0e20091c3e637905d89e527c5ce1cfdd183f8 (patch) | |
tree | 3682f61d81b15c72b66da3e17b2353d122e5f4ca /Lib/distutils | |
parent | c9713874ba26f6a1cf351c0d54d0279e4174848b (diff) | |
download | cpython-bcb0e20091c3e637905d89e527c5ce1cfdd183f8.zip cpython-bcb0e20091c3e637905d89e527c5ce1cfdd183f8.tar.gz cpython-bcb0e20091c3e637905d89e527c5ce1cfdd183f8.tar.bz2 |
Change the mode of scripts in the build/scripts* directory to
executable.
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/command/build_scripts.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py index b7c11d4..c7bd4a9 100644 --- a/Lib/distutils/command/build_scripts.py +++ b/Lib/distutils/command/build_scripts.py @@ -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,15 @@ 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: + mode = ((os.stat(file)[ST_MODE]) | 0555) & 07777 + log.info("changing mode of %s to %o", file, mode) + os.chmod(file, mode) + # copy_scripts () # class build_scripts |