X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=kconfig_hardened_check%2F__init__.py;h=3e4db1c96989a70385becacc6805702e9cbd55a8;hb=4b97fce50b144ea7a266cf7bdd5cb6f274cfa32a;hp=ee0babe223e0cc3977b2ac1ee29a1ce011fb32a8;hpb=e2ecf1ab64d1f4193eddff47df362afce2385c09;p=kconfig-hardened-check.git diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index ee0babe..3e4db1c 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -168,8 +168,8 @@ def parse_kconfig_file(mode, parsed_options, fname): option, value = line[2:].split(' ', 1) assert(value == 'is not set'), \ f'unexpected value of disabled Kconfig option "{line}"' - elif line != '' and not line.startswith('#') and mode != 'json': - print(f'[!] WARNING: strange line in Kconfig file: "{line}"') + elif line != '' and not line.startswith('#'): + sys.exit(f'[!] ERROR: unexpected line in Kconfig file: "{line}"') if option in parsed_options: sys.exit(f'[!] ERROR: Kconfig option "{line}" is found multiple times') @@ -205,7 +205,7 @@ def parse_sysctl_file(mode, parsed_options, fname): for line in f.readlines(): line = line.strip() if not sysctl_pattern.match(line): - sys.exit(f'[!] ERROR: unexpected line in sysctl file: {line}') + sys.exit(f'[!] ERROR: unexpected line in sysctl file: "{line}"') option, value = line.split('=', 1) option = option.strip() value = value.strip()