Skip to content
Open
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
2 changes: 1 addition & 1 deletion src/packagedcode/debian.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def build_package_data_from_package_filename(filename, datasource_id, package_ty
deb = DebArchive.from_filename(filename=filename)

if deb.architecture:
qualifiers = dict(architecture=deb.architecture)
qualifiers = dict(arch=deb.architecture)
else:
qualifiers = {}

Expand Down
6 changes: 4 additions & 2 deletions tests/packagedcode/test_debian.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ def test_build_package_data_from_package_filename_deb_does_not_crash_on_version(
datasource_id='debian_deb',
package_type='deb',
)
assert str(result.purl) == 'pkg:deb/debian/libapache2-mod-md@2.4.38-3%2Bdeb10u10?architecture=amd64'
assert result.qualifiers == {'arch': 'amd64'}
assert str(result.purl) == 'pkg:deb/debian/libapache2-mod-md@2.4.38-3%2Bdeb10u10?arch=amd64'

def test_build_package_data_from_package_filename_orig_sdoes_not_crash_on_version(self):
filename = 'abseil_0~20200923.3.orig.tar.gz'
Expand All @@ -222,4 +223,5 @@ def test_build_package_data_from_package_filename_debian_tar_sdoes_not_crash_on_
def test_DebianDebPackageHandler_parse_does_not_crash_on_version(self):
location = 'foo/bar/libapache2-mod-md_2.4.38-3+deb10u10_amd64.deb'
result = list(DebianDebPackageHandler.parse(location))[0]
assert str(result.purl) == 'pkg:deb/debian/libapache2-mod-md@2.4.38-3%2Bdeb10u10?architecture=amd64'
assert result.qualifiers == {'arch': 'amd64'}
assert str(result.purl) == 'pkg:deb/debian/libapache2-mod-md@2.4.38-3%2Bdeb10u10?arch=amd64'