diff options
Diffstat (limited to 'manifest_xml.py')
-rw-r--r-- | manifest_xml.py | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/manifest_xml.py b/manifest_xml.py index fe0735a8..a3effd11 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
@@ -191,12 +191,27 @@ class XmlManifest(object): | |||
191 | """ | 191 | """ |
192 | self.Override(name) | 192 | self.Override(name) |
193 | 193 | ||
194 | try: | 194 | # Old versions of repo would generate symlinks we need to clean up. |
195 | if os.path.lexists(self.manifestFile): | 195 | if os.path.lexists(self.manifestFile): |
196 | platform_utils.remove(self.manifestFile) | 196 | platform_utils.remove(self.manifestFile) |
197 | platform_utils.symlink(os.path.join('manifests', name), self.manifestFile) | 197 | # This file is interpreted as if it existed inside the manifest repo. |
198 | except OSError as e: | 198 | # That allows us to use <include> with the relative file name. |
199 | raise ManifestParseError('cannot link manifest %s: %s' % (name, str(e))) | 199 | with open(self.manifestFile, 'w') as fp: |
200 | fp.write("""<?xml version="1.0" encoding="UTF-8"?> | ||
201 | <!-- | ||
202 | DO NOT EDIT THIS FILE! It is generated by repo and changes will be discarded. | ||
203 | If you want to use a different manifest, use `repo init -m <file>` instead. | ||
204 | |||
205 | If you want to customize your checkout by overriding manifest settings, use | ||
206 | the local_manifests/ directory instead. | ||
207 | |||
208 | For more information on repo manifests, check out: | ||
209 | https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | ||
210 | --> | ||
211 | <manifest> | ||
212 | <include name="%s" /> | ||
213 | </manifest> | ||
214 | """ % (name,)) | ||
200 | 215 | ||
201 | def _RemoteToXml(self, r, doc, root): | 216 | def _RemoteToXml(self, r, doc, root): |
202 | e = doc.createElement('remote') | 217 | e = doc.createElement('remote') |