Mercurial > cpython-lru_cache-weakref
diff Lib/distutils/command/install_scripts.py @ 12678:875e677236a7 legacy-trunk
Deleted some cruft.
Caught up with renaming in 'install_misc' base class.
Changed 'run()' to chmod installed scripts under Unix.
| author | Gregory P. Smith <greg@mad-scientist.com> |
|---|---|
| date | Fri, 12 May 2000 01:32:30 +0000 |
| parents | de435a59a4d5 |
| children | 7c89ee40730f |
line wrap: on
line diff
--- a/Lib/distutils/command/install_scripts.py Fri May 12 01:31:37 2000 +0000 +++ b/Lib/distutils/command/install_scripts.py Fri May 12 01:32:30 2000 +0000 @@ -1,16 +1,26 @@ +import os from distutils.cmd import install_misc +from stat import ST_MODE class install_scripts(install_misc): description = "install scripts" - # XXX needed? - user_options = [('install-dir=', 'd', "directory to install to")] def finalize_options (self): self._install_dir_from('install_scripts') def run (self): - self._copydata(self.distribution.scripts) + self._copy_files(self.distribution.scripts) + if os.name == 'posix': + # Set the executable bits (owner, group, and world) on + # all the scripts we just installed. + files = self.get_outputs() + for file in files: + if self.dry_run: + self.announce("changing mode of %s" % file) + else: + mode = (os.stat(file)[ST_MODE]) | 0111 + self.announce("changing mode of %s to %o" % (file, mode)) + os.chmod(file, mode) - def get_outputs(self): - return self._outputdata(self.distribution.scripts) +# class install_scripts
