summaryrefslogtreecommitdiff
path: root/setuptools/command/easy_install.py
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/command/easy_install.py
parent832ac33b66bfba9d2826a50a31d656bf813dcba4 (diff)
parent8dde28ee529c74d578e8142dfbb0a537a8bf0414 (diff)
downloadpython-setuptools-git-0e304af1678c960405fdc5ed59567040fa872d67.tar.gz
Merged in justinazoff/distribute (pull request #6)
--HG-- branch : distribute extra : rebase_source : 43dc79a612fc5f80658dd881edc2d02ee8fd9cfa
Diffstat (limited to 'setuptools/command/easy_install.py')
-rwxr-xr-xsetuptools/command/easy_install.py10
1 files changed, 8 insertions, 2 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])