|
|
@@ -191,12 +191,27 @@ class XmlManifest(object):
|
|
|
"""
|
|
|
self.Override(name)
|
|
|
|
|
|
- try:
|
|
|
- if os.path.lexists(self.manifestFile):
|
|
|
- platform_utils.remove(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)))
|
|
|
+ # Old versions of repo would generate symlinks we need to clean up.
|
|
|
+ if os.path.lexists(self.manifestFile):
|
|
|
+ platform_utils.remove(self.manifestFile)
|
|
|
+ # This file is interpreted as if it existed inside the manifest repo.
|
|
|
+ # That allows us to use <include> with the relative file name.
|
|
|
+ with open(self.manifestFile, 'w') as fp:
|
|
|
+ fp.write("""<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<!--
|
|
|
+DO NOT EDIT THIS FILE! It is generated by repo and changes will be discarded.
|
|
|
+If you want to use a different manifest, use `repo init -m <file>` instead.
|
|
|
+
|
|
|
+If you want to customize your checkout by overriding manifest settings, use
|
|
|
+the local_manifests/ directory instead.
|
|
|
+
|
|
|
+For more information on repo manifests, check out:
|
|
|
+https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
|
|
|
+-->
|
|
|
+<manifest>
|
|
|
+ <include name="%s" />
|
|
|
+</manifest>
|
|
|
+""" % (name,))
|
|
|
|
|
|
def _RemoteToXml(self, r, doc, root):
|
|
|
e = doc.createElement('remote')
|