1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 09:16:16 +02:00

- Package.__get_files: check for broken files meta

Fixes #170.
This commit is contained in:
Marcus Huewe 2015-09-07 19:28:56 +02:00
parent 7bb0c4b730
commit e697a70921

View File

@ -2076,6 +2076,9 @@ rev: %s
if fmeta_root.get('rev') is None and len(fmeta_root.findall('entry')) > 0: if fmeta_root.get('rev') is None and len(fmeta_root.findall('entry')) > 0:
raise oscerr.APIError('missing rev attribute in _files:\n%s' % ''.join(ET.tostring(fmeta_root, encoding=ET_ENCODING))) raise oscerr.APIError('missing rev attribute in _files:\n%s' % ''.join(ET.tostring(fmeta_root, encoding=ET_ENCODING)))
for i in fmeta_root.findall('entry'): for i in fmeta_root.findall('entry'):
error = i.get('error')
if error is not None:
raise oscerr.APIError('broken files meta: %s' % error)
skipped = i.get('skipped') is not None skipped = i.get('skipped') is not None
f.append(File(i.get('name'), i.get('md5'), f.append(File(i.get('name'), i.get('md5'),
int(i.get('size')), int(i.get('mtime')), skipped)) int(i.get('size')), int(i.get('mtime')), skipped))