Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/migrate_extrinsic_metadata.py
Show First 20 Lines • Show All 830 Lines • ▼ Show 20 Lines | elif type_ == "tar": | ||||
else: | else: | ||||
# new format introduced in | # new format introduced in | ||||
# https://forge.softwareheritage.org/D4065 | # https://forge.softwareheritage.org/D4065 | ||||
# it's the same as the first case, but with the @xmlns | # it's the same as the first case, but with the @xmlns | ||||
# declarations stripped | # declarations stripped | ||||
# Most of them should have the "id", but some revisions, | # Most of them should have the "id", but some revisions, | ||||
# like 4d3890004fade1f4ec3bf7004a4af0c490605128, are missing | # like 4d3890004fade1f4ec3bf7004a4af0c490605128, are missing | ||||
# this field | # this field | ||||
assert "id" in actual_metadata or "title" in actual_metadata | assert ( | ||||
"id" in actual_metadata | |||||
or "title" in actual_metadata | |||||
or "atom:title" in actual_metadata | |||||
) | |||||
assert "codemeta:author" in actual_metadata | assert "codemeta:author" in actual_metadata | ||||
(origin, discovery_date) = handle_deposit_row( | (origin, discovery_date) = handle_deposit_row( | ||||
row, discovery_date, origin, storage, deposit_cur, dry_run | row, discovery_date, origin, storage, deposit_cur, dry_run | ||||
) | ) | ||||
del metadata["extrinsic"] | del metadata["extrinsic"] | ||||
else: | else: | ||||
▲ Show 20 Lines • Show All 357 Lines • Show Last 20 Lines |