Skip to content

Commit 81a34d7

Browse files
authored
fix: icu checker (#1208)
* fix: icu checker * fix: black and isort fixes #1007
1 parent 0677113 commit 81a34d7

File tree

6 files changed

+44
-19
lines changed

6 files changed

+44
-19
lines changed

cve_bin_tool/checkers/icu.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@
1212

1313

1414
class IcuChecker(Checker):
15-
CONTAINS_PATTERNS = []
16-
FILENAME_PATTERNS = [r"icu", r"international_components_for_unicode"]
15+
CONTAINS_PATTERNS = [
16+
r"-i or --icudatadir directory for locating any needed intermediate data files,",
17+
r"-j or --write-java write a Java ListResourceBundle for ICU4J, followed by optional encoding",
18+
r"failed to load root collator \(ucadata.icu\) - %s",
19+
r"is about 300kB larger than the ucadata-implicithan\.icu version\.",
20+
r"the ucadata-unihan\.icu version of the collation root data",
21+
]
22+
FILENAME_PATTERNS = [r"genrb", r"uconv"]
1723
VERSION_PATTERNS = [
18-
r"icu[_-]([0-9]+\.[0-9]+\.[0-9]+)",
19-
r"ICU ([0-9]+\.[0-9]+\.[0-9]+)",
20-
r"icu[_-][relas-]*((0*(?:[1-6][0-9]?))+(\-[0-9]+)*)",
24+
r"icu-([0-9]+\.[0-9]+(\.[0-9]+)?)",
25+
r"ICU ([0-9]+\.[0-9]+(\.[0-9]+)?)",
2126
]
2227
VENDOR_PRODUCT = [("icu-project", "international_components_for_unicode")]
24.8 KB
Binary file not shown.
27.5 KB
Binary file not shown.
784 KB
Binary file not shown.
52.4 KB
Binary file not shown.

test/test_data/international_components_for_unicode.py

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,50 @@
44
mapping_test_data = [
55
{
66
"product": "international_components_for_unicode",
7-
"version": "3.8.1",
8-
"version_strings": ["CLIENT icu-release-3-8-1"],
7+
"version": "60.3",
8+
"version_strings": ["ICU 60.3"],
99
},
1010
{
1111
"product": "international_components_for_unicode",
12-
"version": "3.8.1",
13-
"version_strings": ["ICU 3.8.1"],
12+
"version": "60.3",
13+
"version_strings": ["icu-60.3"],
1414
},
15+
]
16+
package_test_data = [
1517
{
18+
"url": "http://www.rpmfind.net/linux/openmandriva/cooker/repository/x86_64/main/release/",
19+
"package_name": "icu-68.2-1-omv4002.x86_64.rpm",
1620
"product": "international_components_for_unicode",
17-
"version": "3.8.1",
18-
"version_strings": ["icu-3.8.1"],
21+
"version": "68.2",
1922
},
2023
{
24+
"url": "http://mirror.centos.org/centos/8/BaseOS/aarch64/os/Packages/",
25+
"package_name": "icu-60.3-2.el8_1.aarch64.rpm",
2126
"product": "international_components_for_unicode",
22-
"version": "3.8.1",
23-
"version_strings": ["icu_3.8.1"],
27+
"version": "60.3",
2428
},
25-
]
26-
package_test_data = [
2729
{
28-
"url": "http://www.rpmfind.net/linux/openmandriva/cooker/repository/x86_64/main/release/",
29-
"package_name": "icu-68.2-1-omv4002.x86_64.rpm",
30+
"url": "http://archive.ubuntu.com/ubuntu/pool/main/i/icu/",
31+
"package_name": "icu-devtools_67.1-4_amd64.deb",
3032
"product": "international_components_for_unicode",
31-
"version": "68",
32-
}
33+
"version": "67.1",
34+
},
35+
{
36+
"url": "https://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/8.2/All/",
37+
"package_name": "icu-68.2.tgz",
38+
"product": "international_components_for_unicode",
39+
"version": "68.2",
40+
},
41+
{
42+
"url": "https://rpmfind.net/linux/dag/redhat/el4/en/x86_64/dag/RPMS/",
43+
"package_name": "icu-3.6-1.el4.rf.x86_64.rpm",
44+
"product": "international_components_for_unicode",
45+
"version": "3.6",
46+
},
47+
# {
48+
# "url": "https://rpmfind.net/linux/dag/redhat/el4/en/x86_64/dag/RPMS/",
49+
# "package_name": "icu-2.6.2-1.2.el4.rf.x86_64.rpm",
50+
# "product": "international_components_for_unicode",
51+
# "version": "2.6.2",
52+
# },
3353
]

0 commit comments

Comments
 (0)