From patchwork Sat Feb 22 08:57:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1242467 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.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=iIuwBV9e; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48PjHB19f7z9sPk for ; Sat, 22 Feb 2020 20:11:02 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id A1F142262E; Sat, 22 Feb 2020 09:10:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F5a98zpknKxf; Sat, 22 Feb 2020 09:10:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 4D4DC20499; Sat, 22 Feb 2020 09:10:54 +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 CEAD01BF5D7 for ; Sat, 22 Feb 2020 09:10:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id CBFCA855CF for ; Sat, 22 Feb 2020 09:10:44 +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 zI2b8n4Ny4Oh for ; Sat, 22 Feb 2020 09:10:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 242E9855A1 for ; Sat, 22 Feb 2020 09:10:44 +0000 (UTC) Received: by mail-wm1-f44.google.com with SMTP id s10so4177962wmh.3 for ; Sat, 22 Feb 2020 01:10:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+4k25AiIdcA+/zKiV3UsKdWg50MxHk/VT2CjfJafYoc=; b=iIuwBV9egLZ9GgGV3Z3eyeYmpaKgMgS4+QXnymrZiXXVpRePoe2D7TFc1asKRZ5b3L 2va3he9sEGDHHLqjjpLAtSzdWz98h7SBkp6Uc2ASRP6kHgDdHNaCT8FZPEdW9eyP+8dn zLDW8RBWVks8ZlMHJscPkHWnRngEFXdjd5GIQSi5Hafkng6sOKyOlCy2CG9Fv628Dp53 VoWLMMp1UdMuQokzIXF1FqCEgXU7mbyA8+C9EbUx5la7f1Ntjy+7dEr8FiOqWOPmEdY8 Gsey9RIPT4SpNJbGGlJB+Pf5zU75LRIAx+vJ6XUEp9uHkJbWtVFIWXvJU9UATzf9wu66 cmAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+4k25AiIdcA+/zKiV3UsKdWg50MxHk/VT2CjfJafYoc=; b=SdlDrLQB6KW65ohmRE4cWVgQEEkVlIdln8if1VkrPUzTuS4c+UOW69XpszVrXH78Ev Xz9hqAOk6qyyfia77qThlpJuDcOcEIKiDQyWdcLAHJ1UjIYLit6vKrBC80DOt62CfY4v 4/RWBVVz3mb/xsWRZ9VWjgWC7hA264CsNKE25j3catDqNIRzkmUNv3d2WmyEHMIY+AUq PTk6wgeS0BI55lzz7dLDpmwexXZ4fH9oKp5tE4cFDlWGEbvFeupvg6RMVunRW9XoQ/fj 03hHUbTHqwpF9dK7YyTy7JrThfvTvv484HCJ2C2UiuoY7Yl2yWur6d3UeMEtj3UfyTcz t2uw== X-Gm-Message-State: APjAAAULzx81BgK/al6IfWIlU5poFSZ17qzHkt+KzpQIiEsF4NBsXgqf HAN6F+Y2vf2z0FNpj/HqR5v4bZYS X-Google-Smtp-Source: APXvYqyz7J6rvJe8zMNeMkyqPxe6ERJVIH5gWBkwcq4YL10F5+OL0feeQOnq/9qZpr9DfItC8xu+Yw== X-Received: by 2002:a1c:bc46:: with SMTP id m67mr8858820wmf.40.1582362642105; Sat, 22 Feb 2020 01:10:42 -0800 (PST) Received: from t450s.fritz.box (ip5f589959.dynamic.kabel-deutschland.de. [95.88.153.89]) by smtp.gmail.com with ESMTPSA id l6sm603970wrb.75.2020.02.22.01.10.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Feb 2020 01:10:41 -0800 (PST) From: Heiko Thiery To: buildroot@buildroot.org Date: Sat, 22 Feb 2020 09:57:15 +0100 Message-Id: <20200222085715.23769-12-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200222085715.23769-1-heiko.thiery@gmail.com> References: <20200222085715.23769-1-heiko.thiery@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 11/12] support/scripts/pkg-stats: initialize all package status checks 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: Heiko Thiery , Thomas Petazzoni , Titouan Christophe Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Also the list of status checks is added to the json output. Signed-off-by: Heiko Thiery --- support/scripts/pkg-stats | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats index be3b6d7e71..ed22f6b650 100755 --- a/support/scripts/pkg-stats +++ b/support/scripts/pkg-stats @@ -87,6 +87,11 @@ class Package: all_license_files = dict() all_versions = dict() all_ignored_cves = dict() + # This is the list of all possible checks. Add new checks to this list so + # a tool that post-processeds the json output knows the checks before + # iterating over the packages. + status_checks = ['cve', 'developers', 'hash', 'hash-license', 'license', + 'license-files', 'patches', 'pkg-check', 'url', 'version'] def __init__(self, name, path): self.name = name @@ -103,7 +108,15 @@ class Package: self.url_worker = None self.cves = list() self.latest_version = {'status': RM_API_STATUS_ERROR, 'version': None, 'id': None} + self.init_check_status() + + def init_check_status(self): + """ + Set the status of all check to 'na'. + """ self.status = {} + for check in self.status_checks: + self.status[check] = ("na", "no status check done") def pkgvar(self): return self.name.upper().replace("-", "_") @@ -975,6 +988,7 @@ def dump_json(packages, defconfigs, stats, date, commit, output): final = {'packages': pkgs, 'stats': statistics, 'defconfigs': defconfigs, + 'package_status_checks': Package.status_checks, 'commit': commit, 'date': str(date)}