summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/install_scripts.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2000-05-12 01:32:30 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2000-05-12 01:32:30 (GMT)
commitae988a57d2dd202e1d6242b4867d13df599cf2c7 (patch)
tree6147fbdcaec7e5a793378cb7ad81d644c8387020 /Lib/distutils/command/install_scripts.py
parentce2b6b838f21f43b1916e607803b956fdee5d2ee (diff)
downloadcpython-ae988a57d2dd202e1d6242b4867d13df599cf2c7.zip
cpython-ae988a57d2dd202e1d6242b4867d13df599cf2c7.tar.gz
cpython-ae988a57d2dd202e1d6242b4867d13df599cf2c7.tar.bz2
Deleted some cruft.
Caught up with renaming in 'install_misc' base class. Changed 'run()' to chmod installed scripts under Unix.
Diffstat (limited to 'Lib/distutils/command/install_scripts.py')
-rw-r--r--Lib/distutils/command/install_scripts.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/Lib/distutils/command/install_scripts.py b/Lib/distutils/command/install_scripts.py
index 665208e..5c3f2fb 100644
--- a/Lib/distutils/command/install_scripts.py
+++ b/Lib/distutils/command/install_scripts.py
@@ -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