#686 Display license info in CLI's rpminfo and Web UI
Merged 6 years ago by mikem. Opened 6 years ago by tkopecek.
tkopecek/koji issue683  into  master

@@ -3020,6 +3020,8 @@ 

              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:

file modified
+2 -1
@@ -1380,9 +1380,10 @@ 

              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)

@@ -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>