summaryrefslogtreecommitdiff
path: root/setuptools/command/install_scripts.py
diff options
context:
space:
mode:
authorJustin Azoff <justin@bouncybouncy.net>2012-05-12 19:01:44 -0400
committerJustin Azoff <justin@bouncybouncy.net>2012-05-12 19:01:44 -0400
commita4b57a24719fbfdf3ed8f74a1ef65d940d0dca20 (patch)
treeb30ffbc3ae0188e283a8078913687842f7e34e92 /setuptools/command/install_scripts.py
parenta5cb5317fa6c37c2e6fedc04ba1e008c6d629994 (diff)
downloadpython-setuptools-bitbucket-a4b57a24719fbfdf3ed8f74a1ef65d940d0dca20.tar.gz
When writing out scripts, respect the users umask
Diffstat (limited to 'setuptools/command/install_scripts.py')
-rwxr-xr-xsetuptools/command/install_scripts.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/setuptools/command/install_scripts.py b/setuptools/command/install_scripts.py
index 6ce1b993..82456035 100755
--- a/setuptools/command/install_scripts.py
+++ b/setuptools/command/install_scripts.py
@@ -39,15 +39,16 @@ class install_scripts(_install_scripts):
def write_script(self, script_name, contents, mode="t", *ignored):
"""Write an executable file to the scripts directory"""
- from setuptools.command.easy_install import chmod
+ from setuptools.command.easy_install import chmod, current_umask
log.info("Installing %s script to %s", script_name, self.install_dir)
target = os.path.join(self.install_dir, script_name)
self.outfiles.append(target)
+ mask = current_umask()
if not self.dry_run:
ensure_directory(target)
f = open(target,"w"+mode)
f.write(contents)
f.close()
- chmod(target,0755)
+ chmod(target, 0777-mask)