diff options
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -35,6 +35,7 @@ from git_config import GitConfig, IsId, GetSchemeFromUrl, GetUrlCookieFile, \ | |||
35 | from error import GitError, HookError, UploadError, DownloadError | 35 | from error import GitError, HookError, UploadError, DownloadError |
36 | from error import ManifestInvalidRevisionError | 36 | from error import ManifestInvalidRevisionError |
37 | from error import NoManifestException | 37 | from error import NoManifestException |
38 | import platform_utils | ||
38 | from trace import IsTrace, Trace | 39 | from trace import IsTrace, Trace |
39 | 40 | ||
40 | from git_refs import GitRefs, HEAD, R_HEADS, R_TAGS, R_PUB, R_M | 41 | from git_refs import GitRefs, HEAD, R_HEADS, R_TAGS, R_PUB, R_M |
@@ -277,7 +278,7 @@ class _LinkFile(object): | |||
277 | dest_dir = os.path.dirname(absDest) | 278 | dest_dir = os.path.dirname(absDest) |
278 | if not os.path.isdir(dest_dir): | 279 | if not os.path.isdir(dest_dir): |
279 | os.makedirs(dest_dir) | 280 | os.makedirs(dest_dir) |
280 | os.symlink(relSrc, absDest) | 281 | platform_utils.symlink(relSrc, absDest) |
281 | except IOError: | 282 | except IOError: |
282 | _error('Cannot link file %s to %s', relSrc, absDest) | 283 | _error('Cannot link file %s to %s', relSrc, absDest) |
283 | 284 | ||
@@ -2379,7 +2380,8 @@ class Project(object): | |||
2379 | self.relpath, name) | 2380 | self.relpath, name) |
2380 | continue | 2381 | continue |
2381 | try: | 2382 | try: |
2382 | os.symlink(os.path.relpath(stock_hook, os.path.dirname(dst)), dst) | 2383 | platform_utils.symlink( |
2384 | os.path.relpath(stock_hook, os.path.dirname(dst)), dst) | ||
2383 | except OSError as e: | 2385 | except OSError as e: |
2384 | if e.errno == errno.EPERM: | 2386 | if e.errno == errno.EPERM: |
2385 | raise GitError('filesystem must support symlinks') | 2387 | raise GitError('filesystem must support symlinks') |
@@ -2478,7 +2480,8 @@ class Project(object): | |||
2478 | os.makedirs(src) | 2480 | os.makedirs(src) |
2479 | 2481 | ||
2480 | if name in to_symlink: | 2482 | if name in to_symlink: |
2481 | os.symlink(os.path.relpath(src, os.path.dirname(dst)), dst) | 2483 | platform_utils.symlink( |
2484 | os.path.relpath(src, os.path.dirname(dst)), dst) | ||
2482 | elif copy_all and not os.path.islink(dst): | 2485 | elif copy_all and not os.path.islink(dst): |
2483 | if os.path.isdir(src): | 2486 | if os.path.isdir(src): |
2484 | shutil.copytree(src, dst) | 2487 | shutil.copytree(src, dst) |