[snapshot/master] Check if the target hash exists when inserting sources by .dsc, to not break so badly in the face of debian-ports stupidity
---
snapshot | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/snapshot b/snapshot
index 6d48c47..da41718 100755
--- a/snapshot
+++ b/snapshot
@@ -1112,8 +1112,12 @@ class PackageIndexer
if e['Checksums-Sha1']
e['Checksums-Sha1'].each do |line|
hash, size, itemname, rest = line.split(/ /)
- insert_src_file_from_digest(srcpkg, hash)
- $logger.debug("[indexrun ##{@mirrorrun_id}] Inserting for source by digest: #{e['Source']} #{e['Source-Version']}: #{itemname} (#{hash})")
+ if $storage.exists?(hash)
+ insert_src_file_from_digest(srcpkg, hash)
+ $logger.debug("[indexrun ##{@mirrorrun_id}] Inserting for source by digest: #{e['Source']} #{e['Source-Version']}: #{itemname} (#{hash})")
+ else
+ $logger.warn("[indexrun ##{@mirrorrun_id}] Failed to insert for source by digest, but no file with that digest exists: #{e['Source']} #{e['Source-Version']}: #{itemname} (#{hash})")
+ end
end
else
e['Files'].each do |line|
--
1.5.6.5
Reply to: