diff options
| author | tarek <none@none> | 2009-10-13 16:18:05 +0200 |
|---|---|---|
| committer | tarek <none@none> | 2009-10-13 16:18:05 +0200 |
| commit | 0c16478525d77f922f07a33b4f84f4f149ebd3a9 (patch) | |
| tree | 9411db3c13083fbb6f44197962ee881dd8a059b2 | |
| parent | 7b7e4db5d14e58233ca22cd64e18e842e319cffe (diff) | |
| parent | 6255f6b1f711b236a444e786a5fb4853fc1ce555 (diff) | |
| download | python-setuptools-git-0c16478525d77f922f07a33b4f84f4f149ebd3a9.tar.gz | |
merge dance
--HG--
branch : distribute
extra : rebase_source : d4e84517f89066ef4ddd67d58f879bb97f7b7bb2
| -rw-r--r-- | CHANGES.txt | 5 | ||||
| -rw-r--r-- | MANIFEST.in | 2 | ||||
| -rwxr-xr-x | README.txt | 16 | ||||
| -rwxr-xr-x | setup.py | 9 | ||||
| -rwxr-xr-x | setuptools/sandbox.py | 6 |
5 files changed, 30 insertions, 8 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 21624f32..e92f9cbf 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,11 @@ CHANGES 0.6.5 ----- +* When run from within buildout, no attempt is made to modify an existing + setuptools egg, whether in a shared egg directory or a system setuptools. + +* Fixed a hole in sandboxing allowing builtin file to write outside of + the sandbox. ----- 0.6.4 diff --git a/MANIFEST.in b/MANIFEST.in index b678dac4..1db36bfe 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,6 @@ recursive-include setuptools *.py *.txt *.exe recursive-include tests *.py *.c *.pyx *.txt -recursive-include docs *.py *.txt Makefile +recursive-include docs *.py *.txt *.conf *.css *.css_t Makefile include *.py include *.txt include MANIFEST.in @@ -22,7 +22,7 @@ The fork has two goals: and make all distributions that depend on Setuptools work as before, but with less bugs and behaviorial issues. - This work is done in the 0.6.x series + This work is done in the 0.6.x series. Starting with version 0.6.2, Distribute supports Python 3. Installing and using distribute for Python 3 code works exactly @@ -77,17 +77,19 @@ provided online. distribute_setup.py =================== -Download ``distribute_setup.py`` and execute it, using the Python interpreter of -your choice. +Download +`distribute_setup.py <http://python-distribute.org/distribute_setup.py>`_ +and execute it, using the Python interpreter of your choice. If your shell has the ``curl`` program you can do:: - $ curl -O http://nightly.ziade.org/distribute_setup.py + $ curl -O http://python-distribute.org/distribute_setup.py $ python distribute_setup.py -If you are under Python 3, use ``distribute_setup_3k.py``:: +If you are under Python 3, use +`distribute_setup_3k.py <http://python-distribute.org/distribute_setup_3k.py>`_:: - $ curl -O http://nightly.ziade.org/distribute_setup_3k.py + $ curl -O http://python-distribute.org/distribute_setup_3k.py $ python distribute_setup_3k.py Notice that both files are provided in the source release. @@ -197,7 +199,7 @@ Install FAQ You can use Distribute in your zc.buildout. Although you have to run a specific `bootstrap.py` file that is available - at `http://nightly.ziade.org/bootstrap.py`. The code is located at + at `http://python-distribute.org/bootstrap.py`. The code is located at `http://bitbucket.org/tarek/buildout-distribute`. Beware that if you use a shared eggs folder with buildout, you need to @@ -39,6 +39,7 @@ SETUP_COMMANDS = d['__all__'] VERSION = "0.6.5" from setuptools import setup, find_packages +import os import sys scripts = [] @@ -48,7 +49,15 @@ def _easy_install_marker(): return (len(sys.argv) == 5 and sys.argv[2] == 'bdist_egg' and sys.argv[3] == '--dist-dir' and 'egg-dist-tmp-' in sys.argv[-1]) +def _buildout_marker(): + command = os.environ.get('_') + if command: + return 'buildout' in os.path.basename(command) + def _being_installed(): + if _buildout_marker(): + # Installed by buildout, don't mess with a global setuptools. + return False # easy_install marker return 'install' in sys.argv[1:] or _easy_install_marker() diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py index 67cedde6..7b487833 100755 --- a/setuptools/sandbox.py +++ b/setuptools/sandbox.py @@ -168,6 +168,12 @@ class DirectorySandbox(AbstractSandbox): def _violation(self, operation, *args, **kw): raise SandboxViolation(operation, args, kw) + if _file: + def _file(self, path, mode='r', *args, **kw): + if mode not in ('r', 'rt', 'rb', 'rU', 'U') and not self._ok(path): + self._violation("file", path, mode, *args, **kw) + return _file(path,mode,*args,**kw) + def _open(self, path, mode='r', *args, **kw): if mode not in ('r', 'rt', 'rb', 'rU', 'U') and not self._ok(path): self._violation("open", path, mode, *args, **kw) |
