mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 00:49:33 +02:00
cve_check: add CVE_VERSION_SUFFIX to indicate suffix in versioning
add CVE_VERSION_SUFFIX to indicate the version suffix type, currently
works in two value, "alphabetical" if the version string uses single
alphabetical character suffix as incremental release, blank to not
consider the unidentified suffixes. This can be expand when more suffix
pattern identified.
refactor cve_check.Version class to use functools and add parameter to
handle suffix condition.
Also update testcases to cover new changes.
(From OE-Core rev: 5dfd5ad5144708b474ef31eaa89a846c57be8ac0)
(From OE-Core rev: 73f8c25a44ee33866a8fa61824437285cea96249)
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 86b42289bd)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
76e69a2391
commit
aaf7efefba
@@ -23,5 +23,14 @@ class CVECheck(OESelftestTestCase):
|
||||
self.assertTrue( result, msg="Failed to compare version '1.0_dev' <= '1.0'")
|
||||
|
||||
# ignore "p1" and "p2", so these should be equal
|
||||
result = Version("1.0p2") <= Version("1.0p1") and Version("1.0p2") >= Version("1.0p1")
|
||||
result = Version("1.0p2") == Version("1.0p1")
|
||||
self.assertTrue( result ,msg="Failed to compare version '1.0p2' to '1.0p1'")
|
||||
# ignore the "b" and "r"
|
||||
result = Version("1.0b") == Version("1.0r")
|
||||
self.assertTrue( result ,msg="Failed to compare version '1.0b' to '1.0r'")
|
||||
|
||||
# consider the trailing alphabet as patched level when comparing
|
||||
result = Version("1.0b","alphabetical") < Version("1.0r","alphabetical")
|
||||
self.assertTrue( result ,msg="Failed to compare version with suffix '1.0b' < '1.0r'")
|
||||
result = Version("1.0b","alphabetical") > Version("1.0","alphabetical")
|
||||
self.assertTrue( result ,msg="Failed to compare version with suffix '1.0b' > '1.0'")
|
||||
|
||||
Reference in New Issue
Block a user