summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
Diffstat (limited to 'project.py')
-rw-r--r--project.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/project.py b/project.py
index 269fd7e5..de5c7915 100644
--- a/project.py
+++ b/project.py
@@ -35,6 +35,7 @@ from git_config import GitConfig, IsId, GetSchemeFromUrl, GetUrlCookieFile, \
35from error import GitError, HookError, UploadError, DownloadError 35from error import GitError, HookError, UploadError, DownloadError
36from error import ManifestInvalidRevisionError 36from error import ManifestInvalidRevisionError
37from error import NoManifestException 37from error import NoManifestException
38import platform_utils
38from trace import IsTrace, Trace 39from trace import IsTrace, Trace
39 40
40from git_refs import GitRefs, HEAD, R_HEADS, R_TAGS, R_PUB, R_M 41from 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)