File: add_distribute.patch

package info (click to toggle)
python-virtualenv 1.4.9-3squeeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,064 kB
  • ctags: 354
  • sloc: sh: 3,690; python: 1,276; makefile: 4
file content (54 lines) | stat: -rw-r--r-- 2,180 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Description: Add --distribute as an option in virtualenv.py
 Enable --distribute by default in virtualenv.py but add --setuptools 
 and $VIRTUALENV_USE_SETUPTOOLS to fallback to the default upstream
 behavior.
Origin: vendor, http://patches.ubuntu.com/p/python-virtualenv/python-virtualenv_1.4.5-1ubuntu1.patch
Author: Piotr Ożarowski <piotr@debian.org>

Index: python-virtualenv-1.4.9/virtualenv.py
===================================================================
--- python-virtualenv-1.4.9.orig/virtualenv.py
+++ python-virtualenv-1.4.9/virtualenv.py
@@ -467,9 +467,16 @@ def main():
     parser.add_option(
         '--distribute',
         dest='use_distribute',
-        action='store_true',
-        help='Use Distribute instead of Setuptools. Set environ variable'
-        'VIRTUALENV_USE_DISTRIBUTE to make it the default ')
+        action='store_true', default=True,
+        help='Ignored.  Distribute is used by default. See --setuptools '
+        'to use Setuptools instead of Distribute.')
+
+    parser.add_option(
+        '--setuptools',
+        dest='use_distribute',
+        action='store_false',
+        help='Use Setuptools instead of Distribute. Set environ variable '
+        'VIRTUALENV_USE_SETUPTOOLS to make it the default.')
 
     if 'extend_parser' in globals():
         extend_parser(parser)
@@ -593,7 +600,7 @@ def call_subprocess(cmd, show_stdout=Tru
 
 
 def create_environment(home_dir, site_packages=True, clear=False,
-                       unzip_setuptools=False, use_distribute=False):
+                       unzip_setuptools=False, use_distribute=True):
     """
     Creates a new environment in ``home_dir``.
 
@@ -611,10 +618,10 @@ def create_environment(home_dir, site_pa
 
     install_distutils(lib_dir, home_dir)
 
-    if use_distribute or os.environ.get('VIRTUALENV_USE_DISTRIBUTE'):
-        install_distribute(py_executable, unzip=unzip_setuptools)
-    else:
+    if not use_distribute or os.environ.get('VIRTUALENV_USE_SETUPTOOLS'):
         install_setuptools(py_executable, unzip=unzip_setuptools)
+    else:
+        install_distribute(py_executable, unzip=unzip_setuptools)
 
     install_pip(py_executable)