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

Merge branch 'fix_verbose_binary_search' of https://github.com/marcus-h/osc

Do not crash when running "osc search --binary --verbose foo".
This commit is contained in:
Marcus Huewe 2021-08-06 14:05:47 +02:00
commit a78a2f2df9

View File

@ -7960,6 +7960,12 @@ Please submit there instead, or use --nodevelproject to force direct submission.
result.append(s)
if opts.verbose:
if opts.binary:
result.append(node.get('repository') or '-')
result.append(node.get('arch') or '-')
result.append(node.get('version') or '-')
result.append(node.get('release') or '-')
else:
title = node.findtext('title').strip()
if len(title) > 60:
title = title[:61] + '...'
@ -7995,6 +8001,10 @@ Please submit there instead, or use --nodevelproject to force direct submission.
headline.append('Rev')
headline.append('Srcmd5')
if opts.verbose:
if opts.binary:
headline.extend(['# Repository', '# Arch', '# Version',
'# Release'])
else:
headline.append('# Title')
if opts.repos_baseurl:
headline.append('# URL')