Skip to content

Relative local symlinks #473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1505,9 +1505,14 @@ def fix_local_scheme(home_dir, symlink=True):
for subdir_name in os.listdir(home_dir):
if subdir_name == 'local':
continue
cp_or_ln = (os.symlink if symlink else copyfile)
cp_or_ln(os.path.abspath(os.path.join(home_dir, subdir_name)), \
os.path.join(local_path, subdir_name))
if symlink:
# use relative link target, so a virtualenv can be relocated,
# and also be built in a staging area and then packaged to DEB etc.
os.symlink(os.path.join('..', subdir_name),
os.path.join(local_path, subdir_name))
else:
copyfile(os.path.abspath(os.path.join(home_dir, subdir_name)),
os.path.join(local_path, subdir_name))

def fix_lib64(lib_dir, symlink=True):
"""
Expand Down