1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 06:46:15 +01:00

fix getbinaries with DOD binaries

getbinaries of dod binaries do not have a size or mtime.
This will break. So just set to None and print unkown instead.
This commit is contained in:
lethliel 2018-03-13 14:56:33 +01:00
parent 8cb0246c10
commit 9b42897413
2 changed files with 6 additions and 3 deletions

View File

@ -384,7 +384,10 @@ class Osc(cmdln.Cmdln):
if opts.verbose:
for f in result[1]:
print("%9d %s %-40s" % (f.size, shorttime(f.mtime), f.name))
if f.size is None and f.mtime is None:
print("%9s %12s %-40s" % ('unknown', 'unknown', f.name))
else:
print("%9d %s %-40s" % (f.size, shorttime(f.mtime), f.name))
else:
for f in result[1]:
print(indent+f)

View File

@ -5587,8 +5587,8 @@ def get_binarylist(apiurl, prj, repo, arch, package=None, verbose=False):
for node in tree.findall('binary'):
f = File(node.get('filename'),
None,
int(node.get('size')),
int(node.get('mtime')))
int(node.get('size') or 0) or None,
int(node.get('mtime') or 0) or None)
l.append(f)
return l