From patchwork Sat Mar 7 07:56:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1250850 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=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=tQ3WrqQw; dkim-atps=neutral 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 48ZGzP3Fckz9sPK for ; Sat, 7 Mar 2020 18:57:05 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 881EE8772C; Sat, 7 Mar 2020 07:57:03 +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 YwIGQXD97rd8; Sat, 7 Mar 2020 07:56:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 591B2876BE; Sat, 7 Mar 2020 07:56:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 71E0D1BF42C for ; Sat, 7 Mar 2020 07:56:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 69D4220356 for ; Sat, 7 Mar 2020 07:56:50 +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 yQcLK-j2TbZj for ; Sat, 7 Mar 2020 07:56:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by silver.osuosl.org (Postfix) with ESMTPS id 71B131FE2F for ; Sat, 7 Mar 2020 07:56:49 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id p9so4829431wmc.2 for ; Fri, 06 Mar 2020 23:56:49 -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=sAlE2bjgUnL1TQWhgVacG1jE9im3iPhF2ek85Z5uU5k=; b=tQ3WrqQwPCkwU6ifJxrWJthsaJwkNJu2mSASNXX/IedZMS862BLBVSV9JfUA4zqYyK l/CWJkKqJZkcj70kkWNsMArnH7N8BbXVyWtwPjUwR3yp2OIO6RZxS6sxlaD9ikWXTs3o BN7lCLW9dbzYLdgwub+wYVVWo1GCF/v5zPBtcwa4vf7bpcrDuznoStiEp5vJZEgdqDMH jLVvdH3KvBd3d0S0tnpL6BnrQ1oxeoDlvwmK8QqL+ZK3JBVJIOINpgxkLTuG2zn/zQxP Alg89y7VLlO84F9AumIu9rnRRaWt8LxG4q/rLwOIvUbK2REjZR8p8Iho43qooPYutO5e loEg== 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=sAlE2bjgUnL1TQWhgVacG1jE9im3iPhF2ek85Z5uU5k=; b=nvrsQUUOi6k7oeSioDlSfLFsnNrrvg2A0q8HSDVURiKPp4zVOrbytjlGS4WDh3WHq2 vICq83ZJ79YIhtlsq5xe+z7CsKsBvCUH6S7VCpNSDbwqIM6GgNXk2ECViIxUmKEpriv5 wRECNikVWq979HyAuj2vlGYxFrNTZp5BmZYuNZH5lekLumo3lKp0Ac7KmAC7jWk0Cs1y BDrBAu1GpiVpQsUkkKSDeRONDlQpP+0vnIrs21KAGABXw6qWwJqoTqThgboZ9uOOlpkG lzR2ZZJVSXd34+1a8Pq1IxmF/3DB/TDx1HrZfOeIesQRc1GhLCn4J3um/1WFZ4DBm7D0 tX8A== X-Gm-Message-State: ANhLgQ0EQa4d4Lagdxr2KTUcR6gjPzyJudjcbK4V3kd0zhIgoT1FmPs6 /+mDHJ0AYUAlQr5KmxKKVoYfNVaE X-Google-Smtp-Source: ADFU+vuo9iUdRa3BPzsIi7Pab3Xl5akv/56KlD9T8GHrBFqIWbNY2CizutCCB5e8aEvz2a1t9etSFQ== X-Received: by 2002:a05:600c:d4:: with SMTP id u20mr71295wmm.169.1583567807657; Fri, 06 Mar 2020 23:56:47 -0800 (PST) Received: from t450s.fritz.box (ip5f58981a.dynamic.kabel-deutschland.de. [95.88.152.26]) by smtp.gmail.com with ESMTPSA id g129sm19189071wmg.12.2020.03.06.23.56.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Mar 2020 23:56:47 -0800 (PST) From: Heiko Thiery To: buildroot@buildroot.org Date: Sat, 7 Mar 2020 08:56:31 +0100 Message-Id: <20200307075633.7514-11-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200307075633.7514-1-heiko.thiery@gmail.com> References: <20200307075633.7514-1-heiko.thiery@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 10/12] support/scripts/pkg-stats: set status to 'na' for virtual packages 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" If there is no infra set or infra is virtual the status is set to 'na'. This is done for the follwing checks: - license - license-files - hash - hash-license - patches - version Signed-off-by: Heiko Thiery --- support/scripts/pkg-stats | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats index 8849c7a1c3..8e75abe1d3 100755 --- a/support/scripts/pkg-stats +++ b/support/scripts/pkg-stats @@ -132,6 +132,15 @@ class Package: def patch_count(self): return len(self.patch_files) + @property + def has_valid_infra(self): + try: + if self.infras[0][1] == 'virtual': + return False + except IndexError: + return False + return True + def set_infra(self): """ Fills in the .infras field @@ -153,6 +162,11 @@ class Package: """ Fills in the .status['license'] and .status['license-files'] fields """ + if not self.has_valid_infra: + self.status['license'] = ("na", "no valid package infra") + self.status['license-files'] = ("na", "no valid package infra") + return + var = self.pkgvar() self.status['license'] = ("error", "missing") self.status['license-files'] = ("error", "missing") @@ -167,6 +181,11 @@ class Package: """ Fills in the .status['hash'] field """ + if not self.has_valid_infra: + self.status['hash'] = ("na", "no valid package infra") + self.status['hash-license'] = ("na", "no valid package infra") + return + hashpath = self.path.replace(".mk", ".hash") self.status['hash-license'] = ("na", "no hash file") if os.path.exists(hashpath): @@ -187,6 +206,10 @@ class Package: """ Fills in the .patch_count, .patch_files and .status['patches'] fields """ + if not self.has_valid_infra: + self.status['patches'] = ("na", "no valid package infra") + return + pkgdir = os.path.dirname(self.path) for subdir, _, _ in os.walk(pkgdir): self.patch_files = fnmatch.filter(os.listdir(subdir), '*.patch') @@ -566,6 +589,10 @@ def check_package_latest_version(packages): for pkg, r in zip(packages, results): pkg.latest_version = dict(zip(['status', 'version', 'id'], r)) + if not pkg.has_valid_infra: + pkg.status['version'] = ("na", "no valid package infra") + continue + if pkg.latest_version['status'] == RM_API_STATUS_ERROR: pkg.status['version'] = ('warning', "Release Monitoring API error") elif pkg.latest_version['status'] == RM_API_STATUS_NOT_FOUND: