From patchwork Wed Nov 4 14:51:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1394031 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CR8kc0FD3z9sTK for ; Thu, 5 Nov 2020 01:52:07 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1B4F186658; Wed, 4 Nov 2020 14:52:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CynvoplpHPxi; Wed, 4 Nov 2020 14:52:02 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 08313864B2; Wed, 4 Nov 2020 14:52:02 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id E11151BF2CE for ; Wed, 4 Nov 2020 14:51:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id DE10686360 for ; Wed, 4 Nov 2020 14:51:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vaJ3zOAcD2na for ; Wed, 4 Nov 2020 14:51:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by fraxinus.osuosl.org (Postfix) with ESMTPS id D83A8861A1 for ; Wed, 4 Nov 2020 14:51:58 +0000 (UTC) X-Originating-IP: 86.201.80.25 Received: from localhost (lfbn-tou-1-236-25.w86-201.abo.wanadoo.fr [86.201.80.25]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id E23941C000D; Wed, 4 Nov 2020 14:51:54 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Wed, 4 Nov 2020 15:51:36 +0100 Message-Id: <20201104145145.1316167-3-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201104145145.1316167-1-thomas.petazzoni@bootlin.com> References: <20201104145145.1316167-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 02/10] support/scripts/cve-checker: parse arguments earlier X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matt Weber , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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 --- 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")