diff options
| -rw-r--r-- | manifest_xml.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/manifest_xml.py b/manifest_xml.py index daf5740b..a46cf24e 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
| @@ -283,11 +283,12 @@ class XmlManifest(object): | |||
| 283 | self.branch = b | 283 | self.branch = b |
| 284 | 284 | ||
| 285 | nodes = [] | 285 | nodes = [] |
| 286 | nodes.append(self._ParseManifestXml(self.manifestFile)) | 286 | nodes.append(self._ParseManifestXml(self.manifestFile, |
| 287 | self.manifestProject.worktree)) | ||
| 287 | 288 | ||
| 288 | local = os.path.join(self.repodir, LOCAL_MANIFEST_NAME) | 289 | local = os.path.join(self.repodir, LOCAL_MANIFEST_NAME) |
| 289 | if os.path.exists(local): | 290 | if os.path.exists(local): |
| 290 | nodes.append(self._ParseManifestXml(local)) | 291 | nodes.append(self._ParseManifestXml(local, self.repodir)) |
| 291 | 292 | ||
| 292 | self._ParseManifest(nodes) | 293 | self._ParseManifest(nodes) |
| 293 | 294 | ||
| @@ -297,7 +298,7 @@ class XmlManifest(object): | |||
| 297 | 298 | ||
| 298 | self._loaded = True | 299 | self._loaded = True |
| 299 | 300 | ||
| 300 | def _ParseManifestXml(self, path): | 301 | def _ParseManifestXml(self, path, include_root): |
| 301 | root = xml.dom.minidom.parse(path) | 302 | root = xml.dom.minidom.parse(path) |
| 302 | if not root or not root.childNodes: | 303 | if not root or not root.childNodes: |
| 303 | raise ManifestParseError("no root node in %s" % (path,)) | 304 | raise ManifestParseError("no root node in %s" % (path,)) |
| @@ -310,13 +311,13 @@ class XmlManifest(object): | |||
| 310 | for node in config.childNodes: | 311 | for node in config.childNodes: |
| 311 | if node.nodeName == 'include': | 312 | if node.nodeName == 'include': |
| 312 | name = self._reqatt(node, 'name') | 313 | name = self._reqatt(node, 'name') |
| 313 | fp = os.path.join(os.path.dirname(path), name) | 314 | fp = os.path.join(include_root, name) |
| 314 | if not os.path.isfile(fp): | 315 | if not os.path.isfile(fp): |
| 315 | raise ManifestParseError, \ | 316 | raise ManifestParseError, \ |
| 316 | "include %s doesn't exist or isn't a file" % \ | 317 | "include %s doesn't exist or isn't a file" % \ |
| 317 | (name,) | 318 | (name,) |
| 318 | try: | 319 | try: |
| 319 | nodes.extend(self._ParseManifestXml(fp)) | 320 | nodes.extend(self._ParseManifestXml(fp, include_root)) |
| 320 | # should isolate this to the exact exception, but that's | 321 | # should isolate this to the exact exception, but that's |
| 321 | # tricky. actual parsing implementation may vary. | 322 | # tricky. actual parsing implementation may vary. |
| 322 | except (KeyboardInterrupt, RuntimeError, SystemExit): | 323 | except (KeyboardInterrupt, RuntimeError, SystemExit): |
