Skip to content

Commit

Permalink
Merge pull request #2973 from nexB/2971-distroless-system-packages
Browse files Browse the repository at this point in the history
Convert package data dict to PackageData #2971
  • Loading branch information
pombredanne authored May 20, 2022
2 parents a314fa3 + 3c6db5a commit 175383f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/packagedcode/debian.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def assemble(cls, package_data, resource, codebase):
package.update(
package_data=pkgdt,
datafile_path=res.path,
)
)

res.for_packages.append(package_uid)
res.save(codebase)
Expand Down Expand Up @@ -545,7 +545,7 @@ def parse_debian_files_list(location, datasource_id, package_type):

ref = models.FileReference(path=path, md5=md5sum)
file_references.append(ref)

if not file_references:
return

Expand Down
3 changes: 3 additions & 0 deletions src/packagedcode/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,9 @@ def update(self, package_data, datafile_path, replace=False):
if not package_data:
return

if isinstance(package_data, dict):
package_data = PackageData.from_dict(package_data)

if not self.is_compatible(package_data, include_qualifiers=False):
if TRACE_UPDATE:
logger_debug(f'update: {self.purl} not compatible with: {package_data.purl}')
Expand Down

0 comments on commit 175383f

Please sign in to comment.