From 820f7fc3d11c4914b1efc85967635629ac1ca405 Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Sun, 19 Feb 2017 09:49:09 +0000 Subject: Avoid hard-coding the list of years since 2002 Calculate the range based on the current year. git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@49060 e39458fd-73e7-0310-bf30-c45bca0a0e42 --- bin/compare-nvd-cve | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'bin/compare-nvd-cve') diff --git a/bin/compare-nvd-cve b/bin/compare-nvd-cve index 1fffbde745..707ac839ea 100755 --- a/bin/compare-nvd-cve +++ b/bin/compare-nvd-cve @@ -45,26 +45,10 @@ while (<$fh>) { close $fh; # -# Fetched from http://static.nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-2016.xml.gz +# Fetched from https://nvd.nist.gov/download.aspx # -for my $cvelist - ( - "nvdcve-2.0-2016.xml", - "nvdcve-2.0-2015.xml", - "nvdcve-2.0-2014.xml", - "nvdcve-2.0-2013.xml", - "nvdcve-2.0-2012.xml", - "nvdcve-2.0-2011.xml", - "nvdcve-2.0-2010.xml", - "nvdcve-2.0-2009.xml", - "nvdcve-2.0-2008.xml", - "nvdcve-2.0-2007.xml", - "nvdcve-2.0-2006.xml", - "nvdcve-2.0-2005.xml", - "nvdcve-2.0-2004.xml", - "nvdcve-2.0-2003.xml", - "nvdcve-2.0-2002.xml", - ) { +for my $year (reverse 2002 .. (gmtime())[5]+1900) { + my $cvelist = "nvdcve-2.0-$year.xml"; print STDERR "Loading $cvelist\n" if $debug; my $ref = XMLin("data/nvd2/" . $cvelist); for my $cve (sort {$b cmp $a} keys %{$ref->{entry}}) { -- cgit v1.2.3