cve: Use a more compact format for the list of package/versions.
authorLudovic Courtès <ludo@gnu.org>
Fri, 27 May 2016 22:44:36 +0000 (00:44 +0200)
committerLudovic Courtès <ludo@gnu.org>
Fri, 27 May 2016 23:07:12 +0000 (01:07 +0200)
commit870bf71eb0983f0f7f7221434db3ff5f785b3b2c
treec7556c43f2545dba2b5224b3bb24b3f633e1f9b1
parent494dc2fc628b754a9cc86a54c90202b13e0b68c6
cve: Use a more compact format for the list of package/versions.

On a warm cache, "guix lint -c cve vorbis-tools" goes down
from 6.5s to 2.4s.

* guix/cve.scm (cpe->package-name): Change to return two values instead
of a pair.
(cpe->product-alist): New procedure.
(%parse-vulnerability-feed): Use it instead of 'filter-map'.
(fetch-vulnerabilities): Bump sexp format version to 1.
(vulnerabilities->lookup-proc): Adjust accordingly.  When #:version is
omitted, return a list of vulnerabilities instead of a list of
version/vulnerability pairs.
* tests/cve.scm (%expected-vulnerabilities)
("vulnerabilities->lookup-proc): Adjust accordingly.
guix/cve.scm
tests/cve.scm