Skip to content

Commit 9d866e3

Browse files
authored
feat(package-list-parser): improve error messsages for unsupported distros (#1413)
* fixes #1412
1 parent eb26dde commit 9d866e3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

cve_bin_tool/package_list_parser/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,16 @@ def check_file(self):
183183
raise EmptyTxtError(input_file)
184184

185185
if not input_file.endswith("requirements.txt"):
186-
if distro.id() in DEB_DISTROS:
186+
if distro.id() not in SUPPORTED_DISTROS:
187+
LOGGER.warning(
188+
f"Package list support only available for {','.join(SUPPORTED_DISTROS)}!"
189+
)
190+
with ErrorHandler(mode=error_mode):
191+
raise InvalidListError(
192+
f"{distro.id().capitalize()} is not supported"
193+
)
194+
195+
elif distro.id() in DEB_DISTROS:
187196
# Simulate installation on Debian based system using apt-get to check if the file is valid
188197
output = run(
189198
["xargs", "-a", input_file, "apt-get", "install", "-s"],

0 commit comments

Comments
 (0)