Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/debian/loader.py
Show All 35 Lines | |||||
class DscCountError(ValueError): | class DscCountError(ValueError): | ||||
"""Raised when an unexpected number of .dsc files is seen""" | """Raised when an unexpected number of .dsc files is seen""" | ||||
pass | pass | ||||
@attr.s | @attr.s | ||||
class DebianFileMetadata: | class DebianFileMetadata: | ||||
md5sum = attr.ib(type=str) | |||||
name = attr.ib(type=str) | name = attr.ib(type=str) | ||||
"""Filename""" | """Filename""" | ||||
sha256 = attr.ib(type=str) | sha256 = attr.ib(type=str) | ||||
size = attr.ib(type=int) | size = attr.ib(type=int) | ||||
uri = attr.ib(type=str) | uri = attr.ib(type=str) | ||||
"""URL of this specific file""" | """URL of this specific file""" | ||||
# md5sum is not always available, make it optional | |||||
md5sum = attr.ib(type=str, default="") | |||||
# Some of the DSC files imported in swh apparently had a Checksums-SHA512 | # Some of the DSC files imported in swh apparently had a Checksums-SHA512 | ||||
# field which got recorded in the archive. Current versions of dpkg-source | # field which got recorded in the archive. Current versions of dpkg-source | ||||
# don't seem to generate them, but keep the field available for | # don't seem to generate them, but keep the field available for | ||||
# future-proofing. | # future-proofing. | ||||
sha512 = attr.ib(type=str, default="") | sha512 = attr.ib(type=str, default="") | ||||
@attr.s | @attr.s | ||||
▲ Show 20 Lines • Show All 424 Lines • Show Last 20 Lines |