Skip to content

Commit

Permalink
Non-recursive fix for posix_local. Thanks michr.
Browse files Browse the repository at this point in the history
  • Loading branch information
carljm committed Dec 13, 2011
1 parent 4d50860 commit 5cb7cd6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions docs/news.txt
Expand Up @@ -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.
Expand Down
11 changes: 9 additions & 2 deletions virtualenv.py
Expand Up @@ -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'))
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
"""
Expand Down

0 comments on commit 5cb7cd6

Please sign in to comment.