[Buildroot] [PATCH 02/10] support/scripts/cve-checker: parse arguments earlier

Thomas Petazzoni thomas.petazzoni at bootlin.com
Wed Nov 4 14:51:36 UTC 2020


This allows to have --help working, and the argument error checking
before we read from stdin, and potentially block if we get nothing on
stdin.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
---
 support/scripts/cve-checker | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/support/scripts/cve-checker b/support/scripts/cve-checker
index 998ea5b8af..ff110fc17c 100755
--- a/support/scripts/cve-checker
+++ b/support/scripts/cve-checker
@@ -172,6 +172,8 @@ def parse_args():
 
 
 def __main__():
+    args = parse_args()
+
     packages = list()
     content = json.load(sys.stdin)
     for item in content:
@@ -179,7 +181,6 @@ def __main__():
         p = Package(item, pkg.get('version', ''), pkg.get('ignore_cves', ''))
         packages.append(p)
 
-    args = parse_args()
     date = datetime.datetime.utcnow()
 
     print("Checking packages CVEs")
-- 
2.26.2




More information about the buildroot mailing list