aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2012-07-21 17:00:25 -0400
committerJason R. Coombs <jaraco@jaraco.com>2012-07-21 17:00:25 -0400
commit0e304af1678c960405fdc5ed59567040fa872d67 (patch)
tree8144eddfbeeba4e212963c3d4a3584ec7e6c8c8e /setuptools
parent832ac33b66bfba9d2826a50a31d656bf813dcba4 (diff)
parent8dde28ee529c74d578e8142dfbb0a537a8bf0414 (diff)
downloadexternal_python_setuptools-0e304af1678c960405fdc5ed59567040fa872d67.tar.gz
external_python_setuptools-0e304af1678c960405fdc5ed59567040fa872d67.tar.bz2
external_python_setuptools-0e304af1678c960405fdc5ed59567040fa872d67.zip
Merged in justinazoff/distribute (pull request #6)
--HG-- branch : distribute extra : rebase_source : 43dc79a612fc5f80658dd881edc2d02ee8fd9cfa
Diffstat (limited to 'setuptools')
-rwxr-xr-xsetuptools/command/easy_install.py10
-rwxr-xr-xsetuptools/command/install_scripts.py5
2 files changed, 11 insertions, 4 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index dfd9f7ff..49a2c41e 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -10,7 +10,7 @@ file, or visit the `EasyInstall home page`__.
__ http://packages.python.org/distribute/easy_install.html
"""
-import sys, os.path, zipimport, shutil, tempfile, zipfile, re, stat, random
+import sys, os, os.path, zipimport, shutil, tempfile, zipfile, re, stat, random
from glob import glob
from setuptools import Command, _dont_write_bytecode
from setuptools.sandbox import run_setup
@@ -762,12 +762,13 @@ Please make the appropriate changes for your system and try again.
target = os.path.join(self.script_dir, script_name)
self.add_output(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)
@@ -1870,6 +1871,11 @@ def rmtree(path, ignore_errors=False, onerror=auto_chmod):
except os.error:
onerror(os.rmdir, path, sys.exc_info())
+def current_umask():
+ tmp = os.umask(022)
+ os.umask(tmp)
+ return tmp
+
def bootstrap():
# This function is called when setuptools*.egg is run using /bin/sh
import setuptools; argv0 = os.path.dirname(setuptools.__path__[0])
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)