diff options
Diffstat (limited to 'meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb')
-rw-r--r-- | meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb b/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb new file mode 100644 index 0000000000..116555962c --- /dev/null +++ b/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb | |||
@@ -0,0 +1,59 @@ | |||
1 | SUMMARY = "cve-check-tool" | ||
2 | DESCRIPTION = "cve-check-tool is a tool for checking known (public) CVEs.\ | ||
3 | The tool will identify potentially vunlnerable software packages within Linux distributions through version matching." | ||
4 | HOMEPAGE = "https://github.com/ikeydoherty/cve-check-tool" | ||
5 | SECTION = "Development/Tools" | ||
6 | LICENSE = "GPL-2.0+" | ||
7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e8c1458438ead3c34974bc0be3a03ed6" | ||
8 | |||
9 | SRC_URI = "https://github.com/ikeydoherty/${BPN}/releases/download/v${PV}/${BP}.tar.xz \ | ||
10 | file://check-for-malloc_trim-before-using-it.patch \ | ||
11 | " | ||
12 | |||
13 | SRC_URI[md5sum] = "c5f4247140fc9be3bf41491d31a34155" | ||
14 | SRC_URI[sha256sum] = "b8f283be718af8d31232ac1bfc10a0378fb958aaaa49af39168f8acf501e6a5b" | ||
15 | |||
16 | DEPENDS = "libcheck glib-2.0 json-glib curl libxml2 sqlite3 openssl ca-certificates" | ||
17 | |||
18 | RDEPENDS_${PN} = "ca-certificates" | ||
19 | |||
20 | inherit pkgconfig autotools | ||
21 | |||
22 | EXTRA_OECONF = "--disable-coverage" | ||
23 | CFLAGS_append = " -Wno-error=pedantic" | ||
24 | |||
25 | python do_populate_cve_db () { | ||
26 | import subprocess | ||
27 | import time | ||
28 | |||
29 | if d.getVar("BB_NO_NETWORK", True) == "1": | ||
30 | bb.error("BB_NO_NETWORK is set; Can't update cve-check-tool database, " | ||
31 | "CVEs won't be checked") | ||
32 | return | ||
33 | |||
34 | bb.utils.export_proxies(d) | ||
35 | # In case we don't inherit cve-check class, use default values defined in the class. | ||
36 | cve_dir = d.getVar("CVE_CHECK_DB_DIR", True) or d.expand("${DL_DIR}/CVE_CHECK") | ||
37 | cve_file = d.getVar("CVE_CHECK_TMP_FILE", True) or d.expand("${TMPDIR}/cve_check") | ||
38 | cve_cmd = "cve-check-update" | ||
39 | cmd = [cve_cmd, "-d", cve_dir] | ||
40 | bb.debug(1, "Updating cve-check-tool database located in %s" % cve_dir) | ||
41 | try: | ||
42 | output = subprocess.check_output(cmd, stderr=subprocess.STDOUT) | ||
43 | bb.debug(2, "Command '%s' returned:\n%s" % ("\n".join(cmd), output)) | ||
44 | time_utc = time.gmtime(time.time()) | ||
45 | time_format = "%Y-%m-%d %H:%M:%S" | ||
46 | with open(cve_file, "w") as f: | ||
47 | f.write("CVE database was updated on %s UTC\n\n" | ||
48 | % time.strftime(time_format, time_utc)) | ||
49 | |||
50 | except subprocess.CalledProcessError as e: | ||
51 | bb.warn("Error in executing cve-check-update: %s (output %s)" % (e, e.output)) | ||
52 | if bb.data.inherits_class('cve-check', d): | ||
53 | bb.warn("Failed to update cve-check-tool database, CVEs won't be checked") | ||
54 | } | ||
55 | |||
56 | addtask populate_cve_db after do_populate_sysroot | ||
57 | do_populate_cve_db[nostamp] = "1" | ||
58 | |||
59 | BBCLASSEXTEND = "native nativesdk" | ||