Display license info in CLI's rpminfo and Web UI

Fixes: https://pagure.io/koji/issue/683
This commit is contained in:
Tomas Kopecek 2017-11-08 14:21:49 +01:00 committed by Mike McLean
parent 43c48c61be
commit c8242ed75f
3 changed files with 7 additions and 1 deletions

View file

@ -3020,6 +3020,8 @@ def anon_handle_rpminfo(goptions, session, args):
print("Built: %s" % time.strftime('%a, %d %b %Y %H:%M:%S %Z', time.localtime(info['buildtime'])))
print("SIGMD5: %(payloadhash)s" % info)
print("Size: %(size)s" % info)
headers = session.getRPMHeaders(rpmID=info['id'], headers=["license"])
print("License: %(license)s" % headers)
if not info.get('external_repo_id', 0):
print("Build ID: %(build_id)s" % info)
if info['buildroot_id'] is None:

View file

@ -1380,9 +1380,10 @@ def rpminfo(environ, rpmID, fileOrder='name', fileStart=None, buildrootOrder='-i
values['enhances'].sort(_sortbyname)
else:
values['optional_deps'] = False
headers = server.getRPMHeaders(rpm['id'], headers=['summary', 'description'])
headers = server.getRPMHeaders(rpm['id'], headers=['summary', 'description', 'license'])
values['summary'] = koji.fixEncoding(headers.get('summary'))
values['description'] = koji.fixEncoding(headers.get('description'))
values['license'] = koji.fixEncoding(headers.get('license'))
buildroots = kojiweb.util.paginateMethod(server, values, 'listBuildroots', kw={'rpmID': rpm['id']},
start=buildrootStart, dataName='buildroots', prefix='buildroot',
order=buildrootOrder)

View file

@ -64,6 +64,9 @@
<tr>
<th><label title="The MD5 digest of the combined header and payload contents. You can query it by `rpmkeys -Kv foo.rpm`">SIGMD5</label></th><td>$rpm.payloadhash</td>
</tr>
<tr>
<th>License</th><td>$license</td>
</tr>
#if $builtInRoot
<tr>
<th>Buildroot</th><td><a href="buildrootinfo?buildrootID=$builtInRoot.id">$util.brLabel($builtInRoot)</a></td>