mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-24 03:02:12 +01:00
Merge pull request #155 from arunpersaud/ET.parse_error
More meaningful error if ET.parse runs into problems. Fixes #153.
This commit is contained in:
commit
7352a47930
@ -750,7 +750,13 @@ class Project:
|
|||||||
|
|
||||||
packages_file = os.path.join(self.absdir, store, '_packages')
|
packages_file = os.path.join(self.absdir, store, '_packages')
|
||||||
if os.path.isfile(packages_file) and os.path.getsize(packages_file):
|
if os.path.isfile(packages_file) and os.path.getsize(packages_file):
|
||||||
return ET.parse(packages_file)
|
try:
|
||||||
|
result = ET.parse(packages_file)
|
||||||
|
except:
|
||||||
|
msg = 'Cannot read package file \'%s\'. ' % packages_file
|
||||||
|
msg += 'You can try to remove it and then run osc repairwc.'
|
||||||
|
raise oscerr.OscIOError(None, msg)
|
||||||
|
return result
|
||||||
else:
|
else:
|
||||||
# scan project for existing packages and migrate them
|
# scan project for existing packages and migrate them
|
||||||
cur_pacs = []
|
cur_pacs = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user