Skip to content

Commit

Permalink
Not all rpms seem to have SHA256HEADER.
Browse files Browse the repository at this point in the history
  • Loading branch information
adelton committed Feb 7, 2019
1 parent 6c80f9e commit 63606bf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion lib/dnf-plugins/rpm2swidtag.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ def run(self):
tags = s.tags_for_rpm_packages(pkgs)

remaining_pkgs = []
for p in tags:
for p in pkgs:
if p not in tags:
remaining_pkgs.append(p)
continue
found = False
for d in tags[p]:
full_d = path.join(self.plugin.dir_downloaded, d)
Expand Down
3 changes: 2 additions & 1 deletion lib/rpm2swidtag/repodata.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ def tags_for_repo_packages(self, pkgs):
def tags_for_rpm_packages(self, pkgs):
pkg256headers = {}
for p in pkgs:
pkg256headers[( p["name"].decode("utf-8"), p["SHA256HEADER"].decode("utf-8") )] = p
if p["SHA256HEADER"]:
pkg256headers[( p["name"].decode("utf-8"), p["SHA256HEADER"].decode("utf-8") )] = p
tags = {}
for e in self.xml.xpath("/swidtags:metadata/swidtags:package", namespaces = { "swidtags": SWIDTAGLIST_XMLNS }):
found = None
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name = 'rpm2swidtag',
version = '0.6.3',
version = '0.6.4',
description = 'Tools for producing SWID tags from rpm package headers and inspecting the SWID tags',
author = 'Jan Pazdziora',
author_email = '[email protected]',
Expand Down

0 comments on commit 63606bf

Please sign in to comment.