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
4 'fnmatch', 'locale', 'encodings', 'codecs',
5 'stat', 'UserDict', 'readline', 'copy_reg', 'types',
6 're', 'sre', 'sre_parse', 'sre_constants', 'sre_compile',
8 + 'zlib', 'time', 'cStringIO', 'md5', '_hashlib', '_struct', 'bz2',
9 + '_collections', 'operator', 'itertools', 'math', 'binascii',
10 + '_random', '_io', '_functools', 'array', '_socket', '_ssl', 'select',
11 + 'fcntl', 'cPickle', 'datetime', 'syslog', '_sqlite3', 'unicodedata',
12 + 'parser', 'simplejson', 'multiprocessing', '_multiprocessing']
14 REQUIRED_FILES = ['lib-dynload', 'config']
16 @@ -1118,18 +1122,8 @@
17 inc_dir = join(home_dir, 'include')
18 bin_dir = join(home_dir, 'bin')
20 - lib_dir = join(home_dir, 'lib', py_version)
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)
31 - inc_dir = join(home_dir, 'include', py_version + abiflags)
32 + lib_dir = join(home_dir, sys.lib, py_version)
33 + inc_dir = join(home_dir, 'include', py_version + abiflags)
34 bin_dir = join(home_dir, 'bin')
35 return home_dir, lib_dir, inc_dir, bin_dir
42 stdlib_dirs = [os.path.dirname(os.__file__)]
44 stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), 'DLLs'))
45 @@ -1267,6 +1260,15 @@
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)
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')
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')
63 exec_dir = join(sys.exec_prefix, 'Lib')
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))
70 @@ -1616,27 +1618,6 @@
71 os.symlink(os.path.abspath(os.path.join(home_dir, subdir_name)), \
72 os.path.join(local_path, subdir_name))
74 -def fix_lib64(lib_dir):
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
80 - if [p for p in distutils.sysconfig.get_config_vars().values()
81 - if isinstance(p, basestring) and 'lib64' in p]:
82 - logger.debug('This system uses lib64; symlinking lib64 to lib')
83 - assert os.path.basename(lib_dir) == 'python%s' % sys.version[:3], (
84 - "Unexpected python lib dir: %r" % lib_dir)
85 - lib_parent = os.path.dirname(lib_dir)
86 - top_level = os.path.dirname(lib_parent)
87 - lib_dir = os.path.join(top_level, 'lib')
88 - lib64_link = os.path.join(top_level, 'lib64')
89 - assert os.path.basename(lib_parent) == 'lib', (
90 - "Unexpected parent dir: %r" % lib_parent)
91 - if os.path.lexists(lib64_link):
93 - os.symlink('lib', lib64_link)
95 def resolve_interpreter(exe):
97 If the executable given isn't an absolute path, search $PATH for the interpreter
98 --- virtualenv-1.8.4/virtualenv_support/site.py.orig 2013-01-11 17:58:03.708727329 +0100
99 +++ virtualenv-1.8.4/virtualenv_support/site.py 2013-01-11 18:39:25.132008943 +0100
100 @@ -226,42 +226,25 @@
101 os.path.join(prefix, "Extras", "lib", "python")]
103 else: # any other Python distros on OSX work this way
104 - sitedirs = [os.path.join(prefix, "lib",
105 + sitedirs = [os.path.join(prefix, sys.lib,
106 "python" + sys.version[:3], "site-packages")]
109 sitedirs = [os.path.join(prefix,
112 "python" + sys.version[:3],
114 - os.path.join(prefix, "lib", "site-python"),
115 + os.path.join(prefix, sys.lib, "site-python"),
116 os.path.join(prefix, "python" + sys.version[:3], "lib-dynload")]
117 - lib64_dir = os.path.join(prefix, "lib64", "python" + sys.version[:3], "site-packages")
118 - if (os.path.exists(lib64_dir) and
119 - os.path.realpath(lib64_dir) not in [os.path.realpath(p) for p in sitedirs]):
121 - sitedirs.insert(0, lib64_dir)
123 - sitedirs.append(lib64_dir)
125 # sys.getobjects only available in --with-pydebug build
127 sitedirs.insert(0, os.path.join(sitedirs[0], 'debug'))
128 except AttributeError:
130 - # Debian-specific dist-packages directories:
131 - if sys.version[0] == '2':
132 - sitedirs.append(os.path.join(prefix, "lib",
133 - "python" + sys.version[:3],
136 - sitedirs.append(os.path.join(prefix, "lib",
137 - "python" + sys.version[0],
139 - sitedirs.append(os.path.join(prefix, "local/lib",
140 - "python" + sys.version[:3],
142 - sitedirs.append(os.path.join(prefix, "lib", "dist-python"))
143 + # PLD-specific noarch directory:
144 + sitedirs.append(os.path.join(prefix, "share",
145 + "python" + sys.version[:3]))
147 sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")]
148 if sys.platform == 'darwin':
150 elif sys.platform == 'win32':
151 paths = [os.path.join(sys.real_prefix, 'Lib'), os.path.join(sys.real_prefix, 'DLLs')]
153 - paths = [os.path.join(sys.real_prefix, 'lib', 'python'+sys.version[:3])]
154 + paths = [os.path.join(sys.real_prefix, sys.lib, 'python'+sys.version[:3]),
155 + os.path.join(sys.real_prefix, 'share', 'python'+sys.version[:3])]
156 hardcoded_relative_dirs = paths[:] # for the special 'darwin' case below
157 - lib64_path = os.path.join(sys.real_prefix, 'lib64', 'python'+sys.version[:3])
158 - if os.path.exists(lib64_path):
160 - paths.insert(0, lib64_path)
162 - paths.append(lib64_path)
163 # This is hardcoded in the Python executable, but relative to
164 # sys.prefix. Debian change: we need to add the multiarch triplet
165 # here, which is where the real stuff lives. As per PEP 421, in
167 except AttributeError:
168 # This is a non-multiarch aware Python. Fallback to the old way.
170 - plat_path = os.path.join(sys.real_prefix, 'lib',
171 + plat_path = os.path.join(sys.real_prefix, sys.lib,
172 'python'+sys.version[:3],
174 if os.path.exists(plat_path):