Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9345589
D6244.id22602.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D6244.id22602.diff
View Options
diff --git a/swh/loader/package/debian/loader.py b/swh/loader/package/debian/loader.py
--- a/swh/loader/package/debian/loader.py
+++ b/swh/loader/package/debian/loader.py
@@ -41,7 +41,6 @@
@attr.s
class DebianFileMetadata:
- md5sum = attr.ib(type=str)
name = attr.ib(type=str)
"""Filename"""
sha256 = attr.ib(type=str)
@@ -49,6 +48,9 @@
uri = attr.ib(type=str)
"""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
# field which got recorded in the archive. Current versions of dpkg-source
# don't seem to generate them, but keep the field available for
diff --git a/swh/loader/package/debian/tests/test_debian.py b/swh/loader/package/debian/tests/test_debian.py
--- a/swh/loader/package/debian/tests/test_debian.py
+++ b/swh/loader/package/debian/tests/test_debian.py
@@ -3,6 +3,7 @@
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
+from copy import deepcopy
import logging
from os import path
@@ -303,6 +304,18 @@
assert dsc_name is None
+def test_debian_dsc_information_missing_md5sum():
+ package_files = deepcopy(PACKAGE_FILES)
+
+ for package_metadata in package_files["files"].values():
+ del package_metadata["md5sum"]
+
+ p_info = DebianPackageInfo.from_metadata(package_files, url=URL)
+
+ for debian_file_metadata in p_info.files.values():
+ assert not debian_file_metadata.md5sum
+
+
def test_debian_dsc_information_too_many_dsc_entries():
# craft an extra dsc file
fname = "cicero_0.7.2-3.dsc"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 3, 3:26 PM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3226210
Attached To
D6244: package/debian: Handle missing md5sum in source package metadata
Event Timeline
Log In to Comment