cve: remove cve_db__query_full_by_sha1() since it's incorrect

To be correct, url and desc fields should be arrays like ids since a
sha1 (fix) can fixed multiple cves.

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
cve_log: introduce cve_log__pretty_print()

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
cve-log: don't parse commit body for commit in mainline

I found a commit that use the "link" pattern to point out another
(boggus) commit. Also the "cherry-pick" pattern is probably used for
mainlined commit.

Therefore don't try to find mainline links in body of mainlined
commits.

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
cve-log: catch some git formatting options that would break the rev parsing

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
cve-import: die early if the passed file is not found

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
cve-show: introduce "--format=format:" option

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
cve-log: add support for 'format:' format specification

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
cve-log: one 'stable' fix can point to several upstream commits

See 143d9963df6580491f9a5c38c9d4883786f78123
cve-log: fix -n<num> option

this was broken by commit 6b75f4f90ef4ac89598940eb53e0e880666dbee7

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
workaround a bug in bash 4.2: trap handlers are not called in 'subshell1 | subshell2' construct

For example in:

 { trap "echo EXIT handler called" EXIT; echo done; } | cat

the exit handler is not called. To fix it, I had to do instead:

 ( trap "echo EXIT handler called" EXIT; echo done; ) | cat
cve-log: use git-merge-base to find boundaries between master and positive sets

It avoids the boundary handling and any other special-cases I may have
missed..

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
cve-listdb: introduce --exclude-from=<file> option

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
cve: add a new column in DB named 'since'

this field indicates when the CVE bug has been introduced in the mainline kernel.

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
Introduce 'kdist cve edit-db' command to modify/remove an existing CVE

For now only 'since' and 'description' fields can be modified.'

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
Remove unused helper version__is_released()

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
Libify cmp_kernel_version() and rename it into version__cmp()

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
cve-list-db: introduce --max-version option

This option is used to filter out CVEs which are known to be present
only for kernels =< version xxx.

For example if a bug has been introduce during 3.7 devel cycle,
--max-version=3.7 would not show the correspond CVE whereas
--max-version=3.[89..] would.

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
cve: introduce __reset_cve_queried_values()
cve: change cve_db__query_by_id() semantic in order to select which fields to query

The new --field option take a shell pattern.

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
cve: notes can be added to CVEs

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>