diff options
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -2442,6 +2442,14 @@ class Project(object): | |||
2442 | if name in symlink_dirs and not os.path.lexists(src): | 2442 | if name in symlink_dirs and not os.path.lexists(src): |
2443 | os.makedirs(src) | 2443 | os.makedirs(src) |
2444 | 2444 | ||
2445 | if name in to_symlink: | ||
2446 | os.symlink(os.path.relpath(src, os.path.dirname(dst)), dst) | ||
2447 | elif copy_all and not os.path.islink(dst): | ||
2448 | if os.path.isdir(src): | ||
2449 | shutil.copytree(src, dst) | ||
2450 | elif os.path.isfile(src): | ||
2451 | shutil.copy(src, dst) | ||
2452 | |||
2445 | # If the source file doesn't exist, ensure the destination | 2453 | # If the source file doesn't exist, ensure the destination |
2446 | # file doesn't either. | 2454 | # file doesn't either. |
2447 | if name in symlink_files and not os.path.lexists(src): | 2455 | if name in symlink_files and not os.path.lexists(src): |
@@ -2450,13 +2458,6 @@ class Project(object): | |||
2450 | except OSError: | 2458 | except OSError: |
2451 | pass | 2459 | pass |
2452 | 2460 | ||
2453 | if name in to_symlink: | ||
2454 | os.symlink(os.path.relpath(src, os.path.dirname(dst)), dst) | ||
2455 | elif copy_all and not os.path.islink(dst): | ||
2456 | if os.path.isdir(src): | ||
2457 | shutil.copytree(src, dst) | ||
2458 | elif os.path.isfile(src): | ||
2459 | shutil.copy(src, dst) | ||
2460 | except OSError as e: | 2461 | except OSError as e: |
2461 | if e.errno == errno.EPERM: | 2462 | if e.errno == errno.EPERM: |
2462 | raise DownloadError('filesystem must support symlinks') | 2463 | raise DownloadError('filesystem must support symlinks') |