diff options
Diffstat (limited to 'manifest_xml.py')
| -rw-r--r-- | manifest_xml.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/manifest_xml.py b/manifest_xml.py index bf981f03..4e476791 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
| @@ -27,6 +27,7 @@ from error import ManifestParseError | |||
| 27 | 27 | ||
| 28 | MANIFEST_FILE_NAME = 'manifest.xml' | 28 | MANIFEST_FILE_NAME = 'manifest.xml' |
| 29 | LOCAL_MANIFEST_NAME = 'local_manifest.xml' | 29 | LOCAL_MANIFEST_NAME = 'local_manifest.xml' |
| 30 | LOCAL_MANIFESTS_DIR_NAME = 'local_manifests' | ||
| 30 | 31 | ||
| 31 | urlparse.uses_relative.extend(['ssh', 'git']) | 32 | urlparse.uses_relative.extend(['ssh', 'git']) |
| 32 | urlparse.uses_netloc.extend(['ssh', 'git']) | 33 | urlparse.uses_netloc.extend(['ssh', 'git']) |
| @@ -301,6 +302,17 @@ class XmlManifest(object): | |||
| 301 | if os.path.exists(local): | 302 | if os.path.exists(local): |
| 302 | nodes.append(self._ParseManifestXml(local, self.repodir)) | 303 | nodes.append(self._ParseManifestXml(local, self.repodir)) |
| 303 | 304 | ||
| 305 | local_dir = os.path.abspath(os.path.join(self.repodir, LOCAL_MANIFESTS_DIR_NAME)) | ||
| 306 | try: | ||
| 307 | for local_file in os.listdir(local_dir): | ||
| 308 | if local_file.endswith('.xml'): | ||
| 309 | try: | ||
| 310 | nodes.append(self._ParseManifestXml(local_file, self.repodir)) | ||
| 311 | except ManifestParseError as e: | ||
| 312 | print >>sys.stderr, '%s' % str(e) | ||
| 313 | except OSError: | ||
| 314 | pass | ||
| 315 | |||
| 304 | self._ParseManifest(nodes) | 316 | self._ParseManifest(nodes) |
| 305 | 317 | ||
| 306 | if self.IsMirror: | 318 | if self.IsMirror: |
| @@ -312,7 +324,7 @@ class XmlManifest(object): | |||
| 312 | def _ParseManifestXml(self, path, include_root): | 324 | def _ParseManifestXml(self, path, include_root): |
| 313 | try: | 325 | try: |
| 314 | root = xml.dom.minidom.parse(path) | 326 | root = xml.dom.minidom.parse(path) |
| 315 | except (OSError, xml.parsers.expat.ExpatError), e: | 327 | except (OSError, xml.parsers.expat.ExpatError) as e: |
| 316 | raise ManifestParseError("error parsing manifest %s: %s" % (path, e)) | 328 | raise ManifestParseError("error parsing manifest %s: %s" % (path, e)) |
| 317 | 329 | ||
| 318 | if not root or not root.childNodes: | 330 | if not root or not root.childNodes: |
