diff options
| author | Justin Azoff <justin@bouncybouncy.net> | 2012-05-12 19:01:44 -0400 | 
|---|---|---|
| committer | Justin Azoff <justin@bouncybouncy.net> | 2012-05-12 19:01:44 -0400 | 
| commit | 8dde28ee529c74d578e8142dfbb0a537a8bf0414 (patch) | |
| tree | 7bf8e8f3de9f31acd5954306b83b6cfafd8b0585 /setuptools/command/easy_install.py | |
| parent | 5be712ee48b86f32284e72c3b862002fd3dedd85 (diff) | |
| download | python-setuptools-git-8dde28ee529c74d578e8142dfbb0a537a8bf0414.tar.gz | |
When writing out scripts, respect the users umask
--HG--
branch : distribute
extra : rebase_source : d4fc14bcdcd3e1a45da8bdcdef490537863ece35
Diffstat (limited to 'setuptools/command/easy_install.py')
| -rwxr-xr-x | setuptools/command/easy_install.py | 10 | 
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])  | 
