Exit with fatal error if local manifest file cannot be parsed

If the .repo/local_manifests folder includes a local manifest file
that cannot be parsed, the current behaviour is to catch the parse
exception, print a warning, and continue to process remaining files.

This can cause any errors to go unnoticed.

Remove the exception handling, so that the exception is instead
caught in main._Main, and repo exits with a fatal error.

Change-Id: I75a70b7b850d2eb3e4ac99d435a4568ff598b7f4
This commit is contained in:
David Pursehouse 2012-11-22 13:48:10 +09:00
parent 606eab8043
commit 5f434ed723

View File

@ -344,11 +344,8 @@ class XmlManifest(object):
try: try:
for local_file in sorted(os.listdir(local_dir)): for local_file in sorted(os.listdir(local_dir)):
if local_file.endswith('.xml'): if local_file.endswith('.xml'):
try:
local = os.path.join(local_dir, local_file) local = os.path.join(local_dir, local_file)
nodes.append(self._ParseManifestXml(local, self.repodir)) nodes.append(self._ParseManifestXml(local, self.repodir))
except ManifestParseError as e:
print('%s' % str(e), file=sys.stderr)
except OSError: except OSError:
pass pass