]>
Commit | Line | Data |
---|---|---|
d91e0815 JB |
1 | --- virtualenv-1.8.4/virtualenv.py.orig 2012-11-25 18:11:26.000000000 +0100 |
2 | +++ virtualenv-1.8.4/virtualenv.py 2013-01-11 18:31:34.212018758 +0100 | |
35bcbb2d | 3 | @@ -72,7 +72,11 @@ |
201c804e JR |
4 | 'fnmatch', 'locale', 'encodings', 'codecs', |
5 | 'stat', 'UserDict', 'readline', 'copy_reg', 'types', | |
6 | 're', 'sre', 'sre_parse', 'sre_constants', 'sre_compile', | |
7 | - 'zlib'] | |
35bcbb2d | 8 | + 'zlib', 'time', 'cStringIO', 'md5', '_hashlib', '_struct', 'bz2', |
a7ec8cea | 9 | + '_collections', 'operator', 'itertools', 'math', 'binascii', 'atexit', |
9b3fd3e4 | 10 | + '_random', '_io', '_functools', 'array', '_socket', '_ssl', 'select', |
35bcbb2d | 11 | + 'fcntl', 'cPickle', 'datetime', 'syslog', '_sqlite3', 'unicodedata', |
a7ec8cea | 12 | + 'parser', 'simplejson', 'multiprocessing', '_multiprocessing', '_posixsubprocess'] |
201c804e JR |
13 | |
14 | REQUIRED_FILES = ['lib-dynload', 'config'] | |
d91e0815 | 15 | |
35bcbb2d | 16 | @@ -1118,18 +1122,8 @@ |
30efe940 JR |
17 | inc_dir = join(home_dir, 'include') |
18 | bin_dir = join(home_dir, 'bin') | |
d91e0815 | 19 | elif not is_win: |
30efe940 | 20 | - lib_dir = join(home_dir, 'lib', py_version) |
d91e0815 JB |
21 | - multiarch_exec = '/usr/bin/multiarch-platform' |
22 | - if is_executable_file(multiarch_exec): | |
23 | - # In Mageia (2) and Mandriva distros the include dir must be like: | |
24 | - # virtualenv/include/multiarch-x86_64-linux/python2.7 | |
25 | - # instead of being virtualenv/include/python2.7 | |
26 | - p = subprocess.Popen(multiarch_exec, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
27 | - stdout, stderr = p.communicate() | |
28 | - # stdout.strip is needed to remove newline character | |
29 | - inc_dir = join(home_dir, 'include', stdout.strip(), py_version + abiflags) | |
30 | - else: | |
31 | - inc_dir = join(home_dir, 'include', py_version + abiflags) | |
30efe940 | 32 | + lib_dir = join(home_dir, sys.lib, py_version) |
d91e0815 | 33 | + inc_dir = join(home_dir, 'include', py_version + abiflags) |
30efe940 JR |
34 | bin_dir = join(home_dir, 'bin') |
35 | return home_dir, lib_dir, inc_dir, bin_dir | |
d91e0815 | 36 | |
35bcbb2d | 37 | @@ -1234,7 +1228,6 @@ |
30efe940 JR |
38 | else: |
39 | prefix = sys.prefix | |
40 | mkdir(lib_dir) | |
a7ec8cea | 41 | - fix_lib64(lib_dir, symlink) |
30efe940 | 42 | stdlib_dirs = [os.path.dirname(os.__file__)] |
d91e0815 | 43 | if is_win: |
e17b322a | 44 | stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), 'DLLs')) |
35bcbb2d | 45 | @@ -1267,6 +1260,15 @@ |
4577d65b JR |
46 | site_filename = site_filename.replace('$py.class', '.py') |
47 | site_filename_dst = change_prefix(site_filename, home_dir) | |
48 | site_dir = os.path.dirname(site_filename_dst) | |
49 | + # PLD fix | |
50 | + try: | |
51 | + os.symlink( | |
30efe940 JR |
52 | + make_relative_path(os.path.join(site_dir, 'site-packages'), |
53 | + os.path.join(lib_dir, 'site-packages')), | |
54 | + os.path.join(site_dir, 'site-packages') | |
4577d65b JR |
55 | + ) |
56 | + except (OSError, NotImplementedError): | |
57 | + logger.info('Symlinking site-packages failed.') | |
58 | writefile(site_filename_dst, SITE_PY) | |
59 | writefile(join(site_dir, 'orig-prefix.txt'), prefix) | |
60 | site_packages_filename = join(site_dir, 'no-global-site-packages.txt') | |
35bcbb2d | 61 | @@ -1304,7 +1306,7 @@ |
30efe940 JR |
62 | elif is_jython: |
63 | exec_dir = join(sys.exec_prefix, 'Lib') | |
64 | else: | |
65 | - exec_dir = join(sys.exec_prefix, 'lib', py_version) | |
66 | + exec_dir = join(sys.exec_prefix, sys.lib, py_version) | |
67 | for fn in os.listdir(exec_dir): | |
68 | copyfile(join(exec_dir, fn), join(lib_dir, fn)) | |
69 | ||
a7ec8cea JR |
70 | @@ -1616,35 +1618,6 @@ |
71 | cp_or_ln(os.path.abspath(os.path.join(home_dir, subdir_name)), \ | |
d91e0815 | 72 | os.path.join(local_path, subdir_name)) |
30efe940 | 73 | |
a7ec8cea | 74 | -def fix_lib64(lib_dir, symlink=True): |
30efe940 JR |
75 | - """ |
76 | - Some platforms (particularly Gentoo on x64) put things in lib64/pythonX.Y | |
77 | - instead of lib/pythonX.Y. If this is such a platform we'll just create a | |
78 | - symlink so lib64 points to lib | |
79 | - """ | |
80 | - if [p for p in distutils.sysconfig.get_config_vars().values() | |
81 | - if isinstance(p, basestring) and 'lib64' in p]: | |
a7ec8cea JR |
82 | - # PyPy's library path scheme is not affected by this. |
83 | - # Return early or we will die on the following assert. | |
84 | - if is_pypy: | |
85 | - logger.debug('PyPy detected, skipping lib64 symlinking') | |
86 | - return | |
87 | - | |
30efe940 | 88 | - logger.debug('This system uses lib64; symlinking lib64 to lib') |
a7ec8cea | 89 | - |
30efe940 JR |
90 | - assert os.path.basename(lib_dir) == 'python%s' % sys.version[:3], ( |
91 | - "Unexpected python lib dir: %r" % lib_dir) | |
92 | - lib_parent = os.path.dirname(lib_dir) | |
d91e0815 JB |
93 | - top_level = os.path.dirname(lib_parent) |
94 | - lib_dir = os.path.join(top_level, 'lib') | |
95 | - lib64_link = os.path.join(top_level, 'lib64') | |
30efe940 JR |
96 | - assert os.path.basename(lib_parent) == 'lib', ( |
97 | - "Unexpected parent dir: %r" % lib_parent) | |
d91e0815 JB |
98 | - if os.path.lexists(lib64_link): |
99 | - return | |
a7ec8cea JR |
100 | - cp_or_ln = (os.symlink if symlink else copyfile) |
101 | - cp_or_ln('lib', lib64_link) | |
30efe940 JR |
102 | - |
103 | def resolve_interpreter(exe): | |
104 | """ | |
105 | If the executable given isn't an absolute path, search $PATH for the interpreter | |
d91e0815 JB |
106 | --- virtualenv-1.8.4/virtualenv_support/site.py.orig 2013-01-11 17:58:03.708727329 +0100 |
107 | +++ virtualenv-1.8.4/virtualenv_support/site.py 2013-01-11 18:39:25.132008943 +0100 | |
9999949c | 108 | @@ -226,42 +226,25 @@ |
e17b322a AM |
109 | os.path.join(prefix, "Extras", "lib", "python")] |
110 | ||
111 | else: # any other Python distros on OSX work this way | |
112 | - sitedirs = [os.path.join(prefix, "lib", | |
113 | + sitedirs = [os.path.join(prefix, sys.lib, | |
114 | "python" + sys.version[:3], "site-packages")] | |
30efe940 JR |
115 | |
116 | elif os.sep == '/': | |
117 | sitedirs = [os.path.join(prefix, | |
118 | - "lib", | |
119 | + sys.lib, | |
4577d65b JR |
120 | "python" + sys.version[:3], |
121 | "site-packages"), | |
30efe940 JR |
122 | - os.path.join(prefix, "lib", "site-python"), |
123 | + os.path.join(prefix, sys.lib, "site-python"), | |
30efe940 JR |
124 | os.path.join(prefix, "python" + sys.version[:3], "lib-dynload")] |
125 | - lib64_dir = os.path.join(prefix, "lib64", "python" + sys.version[:3], "site-packages") | |
9999949c | 126 | - if (os.path.exists(lib64_dir) and |
30efe940 | 127 | - os.path.realpath(lib64_dir) not in [os.path.realpath(p) for p in sitedirs]): |
9999949c | 128 | - if _is_64bit: |
d91e0815 JB |
129 | - sitedirs.insert(0, lib64_dir) |
130 | - else: | |
131 | - sitedirs.append(lib64_dir) | |
30efe940 JR |
132 | try: |
133 | # sys.getobjects only available in --with-pydebug build | |
134 | sys.getobjects | |
135 | sitedirs.insert(0, os.path.join(sitedirs[0], 'debug')) | |
136 | except AttributeError: | |
137 | pass | |
138 | - # Debian-specific dist-packages directories: | |
e17b322a AM |
139 | - if sys.version[0] == '2': |
140 | - sitedirs.append(os.path.join(prefix, "lib", | |
141 | - "python" + sys.version[:3], | |
142 | - "dist-packages")) | |
143 | - else: | |
144 | - sitedirs.append(os.path.join(prefix, "lib", | |
145 | - "python" + sys.version[0], | |
146 | - "dist-packages")) | |
30efe940 JR |
147 | - sitedirs.append(os.path.join(prefix, "local/lib", |
148 | - "python" + sys.version[:3], | |
149 | - "dist-packages")) | |
150 | - sitedirs.append(os.path.join(prefix, "lib", "dist-python")) | |
d91e0815 | 151 | + # PLD-specific noarch directory: |
4577d65b | 152 | + sitedirs.append(os.path.join(prefix, "share", |
e17b322a | 153 | + "python" + sys.version[:3])) |
4577d65b JR |
154 | else: |
155 | sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")] | |
156 | if sys.platform == 'darwin': | |
9999949c | 157 | @@ -577,14 +560,9 @@ |
d91e0815 JB |
158 | elif sys.platform == 'win32': |
159 | paths = [os.path.join(sys.real_prefix, 'Lib'), os.path.join(sys.real_prefix, 'DLLs')] | |
4577d65b JR |
160 | else: |
161 | - paths = [os.path.join(sys.real_prefix, 'lib', 'python'+sys.version[:3])] | |
30efe940 | 162 | + paths = [os.path.join(sys.real_prefix, sys.lib, 'python'+sys.version[:3]), |
9999949c | 163 | + os.path.join(sys.real_prefix, 'share', 'python'+sys.version[:3])] |
4577d65b | 164 | hardcoded_relative_dirs = paths[:] # for the special 'darwin' case below |
d91e0815 JB |
165 | - lib64_path = os.path.join(sys.real_prefix, 'lib64', 'python'+sys.version[:3]) |
166 | - if os.path.exists(lib64_path): | |
9999949c | 167 | - if _is_64bit: |
d91e0815 JB |
168 | - paths.insert(0, lib64_path) |
169 | - else: | |
170 | - paths.append(lib64_path) | |
9999949c JR |
171 | # This is hardcoded in the Python executable, but relative to |
172 | # sys.prefix. Debian change: we need to add the multiarch triplet | |
173 | # here, which is where the real stuff lives. As per PEP 421, in | |
174 | @@ -595,7 +573,7 @@ | |
175 | except AttributeError: | |
176 | # This is a non-multiarch aware Python. Fallback to the old way. | |
177 | arch = sys.platform | |
178 | - plat_path = os.path.join(sys.real_prefix, 'lib', | |
179 | + plat_path = os.path.join(sys.real_prefix, sys.lib, | |
180 | 'python'+sys.version[:3], | |
181 | 'plat-%s' % arch) | |
30efe940 | 182 | if os.path.exists(plat_path): |