Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert package data dict to PackageData #2971 #2973

Merged
merged 2 commits into from
May 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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