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
commit4d0646300dacb41ec837baf2b4cc13268fcf177c (patch)
tree1a7ebb1755894204f080fd64a011a0b8ecb713b8 /bin/update-nvd
parent15fcfbbe69557cf2b87c0a0ba6750cf722b683cd (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