Browse files

Non-recursive fix for posix_local. Thanks michr.

  • Loading branch information...
1 parent 4d50860 commit 5cb7cd652953441a6696c15bdac3c4f9746dfaa1 @carljm carljm committed Dec 12, 2011
Showing with 12 additions and 2 deletions.
  1. +3 −0 docs/news.txt
  2. +9 −2 virtualenv.py
View
3 docs/news.txt
@@ -4,6 +4,9 @@ Changes & News
In development
~~~~~~~~~~~~~~
+* Use non-recursive symlinks to fix things up for posix_local install
+ scheme. Thanks michr.
+
* Made activate script available for use with msys and cygwin on Windows.
Thanks Greg Haskins, Cliff Xuan, Jonathan Griffin and Doug Napoleone.
Fixes #176.
View
11 virtualenv.py
@@ -1153,7 +1153,6 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
prefix = sys.prefix
mkdir(lib_dir)
fix_lib64(lib_dir)
- fix_local_scheme(home_dir)
stdlib_dirs = [os.path.dirname(os.__file__)]
if sys.platform == 'win32':
stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), 'DLLs'))
@@ -1393,6 +1392,9 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
logger.notify('Please make sure you remove any previous custom paths from '
'your %s file.' % pydistutils)
## FIXME: really this should be calculated earlier
+
+ fix_local_scheme(home_dir)
+
return py_executable
def install_activate(home_dir, bin_dir, prompt=None):
@@ -1459,7 +1461,12 @@ def fix_local_scheme(home_dir):
if sysconfig._get_default_scheme() == 'posix_local':
local_path = os.path.join(home_dir, 'local')
if not os.path.exists(local_path):
- os.symlink(os.path.abspath(home_dir), local_path)
+ os.mkdir(local_path)
+ for subdir_name in os.listdir(home_dir):
+ if subdir_name == 'local':
+ continue
+ os.symlink(os.path.abspath(os.path.join(home_dir, subdir_name)), \
+ os.path.join(local_path, subdir_name))
def fix_lib64(lib_dir):
"""

0 comments on commit 5cb7cd6

Please sign in to comment.