From d5cec5e752821ca2710101b626b3a3ca07fdb7f8 Mon Sep 17 00:00:00 2001 From: Renaud Paquay Date: Tue, 1 Nov 2016 11:24:03 -0700 Subject: Add support for creating symbolic links on Windows Replace all calls to os.symlink with platform_utils.symlink. The Windows implementation calls into the CreateSymbolicLinkW Win32 API, as os.symlink is not supported. Separate the Win32 API definitions into a separate module platform_utils_win32 for clarity. Change-Id: I0714c598664c2df93383734e609d948692c17ec5 --- manifest_xml.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'manifest_xml.py') diff --git a/manifest_xml.py b/manifest_xml.py index 55d25a79..05651c6c 100644 --- a/manifest_xml.py +++ b/manifest_xml.py @@ -32,6 +32,7 @@ else: import gitc_utils from git_config import GitConfig from git_refs import R_HEADS, HEAD +import platform_utils from project import RemoteSpec, Project, MetaProject from error import ManifestParseError, ManifestInvalidRevisionError @@ -166,7 +167,7 @@ class XmlManifest(object): try: if os.path.lexists(self.manifestFile): os.remove(self.manifestFile) - os.symlink(os.path.join('manifests', name), self.manifestFile) + platform_utils.symlink(os.path.join('manifests', name), self.manifestFile) except OSError as e: raise ManifestParseError('cannot link manifest %s: %s' % (name, str(e))) -- cgit v1.2.3-54-g00ecf