summaryrefslogtreecommitdiffstats
path: root/bin/update-nvd
diff options
context:
space:
mode:
authorFlorian Weimer <fw@deneb.enyo.de>2008-11-20 15:15:24 +0000
committerFlorian Weimer <fw@deneb.enyo.de>2008-11-20 15:15:24 +0000
commit06bb63c6a23cf91adac27b324f828ea0ab5d2298 (patch)
tree3b28e9d614e60d7050b8e306cc77479ccb69dcd2 /bin/update-nvd
parent85246429db6684250dfda0e0a0335aa2ae21d42f (diff)
bin/update-nvd: Remove duplicates before loading NVD data
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@10437 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/update-nvd')
-rw-r--r--bin/update-nvd8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/update-nvd b/bin/update-nvd
index 88fe39450b..281c047dd9 100644
--- a/bin/update-nvd
+++ b/bin/update-nvd
@@ -34,6 +34,14 @@ for name in sys.argv[1:]:
data += nvd.parse(f)
f.close()
+# For some reason, NVD adds duplicates, so we need to get rid of them.
+# Sort afterwords to increase locality in the insert process.
+deduplicate = {}
+for x in data:
+ deduplicate[x[0]] = x
+data = deduplicate.values()
+data.sort()
+
cursor = db.writeTxn()
if incremental:
db.updateNVD(cursor, data)

© 2014-2024 Faster IT GmbH | imprint | privacy policy