Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9311815
D2479.id8811.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D2479.id8811.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
@@ -89,27 +89,32 @@
yield release_name(version), p_info
def resolve_revision_from(
- self, known_package_artifacts: Dict, artifact_metadata: Dict) \
+ self, known_package_artifacts: Mapping,
+ artifact_metadata: Mapping[str, Any]) \
-> Optional[bytes]:
- artifacts_to_fetch = artifact_metadata['files']
+ artifacts_to_fetch = artifact_metadata.get('files')
+ # No files in the artifact, no revision resolution possible
+ if not artifacts_to_fetch:
+ return None
logger.debug('k_p_artifacts: %s', known_package_artifacts)
logger.debug('artifacts_to_fetch: %s', artifacts_to_fetch)
for rev_id, known_artifacts in known_package_artifacts.items():
logger.debug('Revision: %s', rev_id)
logger.debug('Associated known_artifacts: %s', known_artifacts)
known_artifacts = known_artifacts['extrinsic']['raw']['files']
- rev_found = True
+ rev_found = False
for a_name, k_artifact in known_artifacts.items():
artifact_to_fetch = artifacts_to_fetch.get(a_name)
logger.debug('artifact_to_fetch: %s', artifact_to_fetch)
if artifact_to_fetch is None:
# as soon as we do not see an artifact, we consider we need
# to check the other revision
- rev_found = False
- if k_artifact['sha256'] != artifact_to_fetch['sha256']:
+ continue
+ if k_artifact['sha256'] == artifact_to_fetch['sha256']:
# Hash is different, we consider we need to check the other
# revisions
- rev_found = False
+ rev_found = True
+ break
if rev_found:
logger.debug('Existing revision %s found for new artifacts.',
rev_id)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 2, 10:32 AM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3234027
Attached To
D2479: debian.loader: Improve resolution computation and fix corner cases
Event Timeline
Log In to Comment