diff options
author | Florian Weimer <fw@deneb.enyo.de> | 2008-11-20 15:15:24 +0000 |
---|---|---|
committer | Florian Weimer <fw@deneb.enyo.de> | 2008-11-20 15:15:24 +0000 |
commit | adc01e5bdc01fb6db13cfb9fa26b430a8b6e69af (patch) | |
tree | 90cb3e14d44718097a8364c7da2a49fc7b0cd7c4 /bin/update-nvd | |
parent | b14c1c421ff0c00e227cd2b194a4f6bd840114a1 (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-nvd | 8 |
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) |