]> code.ossystems Code Review - openembedded-core.git/commit
cve-check: replace Looseversion with custom version class
authorLee Chee Yang <chee.yang.lee@intel.com>
Fri, 22 Jan 2021 10:07:19 +0000 (18:07 +0800)
committerAnuj Mittal <anuj.mittal@intel.com>
Mon, 1 Feb 2021 05:43:10 +0000 (13:43 +0800)
commit02a44b507a1e49a4c460f3e1bec92832b71dfe08
tree437706a5996ad40d9fcaca811249b179b041ee46
parent5e86b849556e2801ec9124b5a4ad83180127b985
cve-check: replace Looseversion with custom version class

The way distutils.version.LooseVersion compare version are tricky, it treat
all these ( "1.0-beta2", "1.0-rc1", "1.0A", "1.0p2" and "1.0pre1") as greater
version than "1.0". This might be right for "1.0A" and "1.0p1" but not for
the rest, also these version could be confusing, the "p" in "1.0p1" can be
"pre" or "patched" version or even other meaning.

Replace Looseversion with custom class, it uses regex to capture common
version format like "1.1.1" or tag format using date like "2020-12-12" as
release section, check for following known string/tags ( beta, rc, pre, dev,
alpha, preview) as pre-release section, any other trailing characters
are difficult to understand/define so ignore them. Compare release
section and pre-release section saperately.

included selftest for the version class.

[YOCTO#14127]

(From OE-Core rev: 6ced85e9ddd3569240f1e8b82130d1ac0fffbc40)

Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 3807c6d9a78ac8ade24c9c69cfe2b9624c49a20d)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
meta/classes/cve-check.bbclass
meta/lib/oe/cve_check.py [new file with mode: 0644]
meta/lib/oeqa/selftest/cases/cve_check.py [new file with mode: 0644]