From patchwork Mon Mar 2 14:50:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1247687 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=jzaxoqpE; 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 48WNPD6DTBz9sRR for ; Tue, 3 Mar 2020 01:50:56 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 23B9B8619A; Mon, 2 Mar 2020 14:50:55 +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 JnwsNnrQ3z3D; Mon, 2 Mar 2020 14:50:50 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id DF33A86117; Mon, 2 Mar 2020 14:50:49 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 0D40B1BF39F for ; Mon, 2 Mar 2020 14:50:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0851D86096 for ; Mon, 2 Mar 2020 14:50:48 +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 423ucolMI-X7 for ; Mon, 2 Mar 2020 14:50:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by whitealder.osuosl.org (Postfix) with ESMTPS id 33C82860A8 for ; Mon, 2 Mar 2020 14:50:45 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id q8so9728wrm.4 for ; Mon, 02 Mar 2020 06:50:45 -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=ik/E/X8zilHYacwrHfwx1Ixmy9paHB6Fr/9Pd7Wd/R4=; b=jzaxoqpEcc1G70g3nAdzOn33OE7eQcJtBmGXBkpsVhtUu/0onXp5nuUEO4JDKnB8Qk hzeChmqXHH6fc5gWHmGQqOMa+OT24Bc80XetniGPq2bwwXHOrdWyDmAOi5i7UbswTX7y q0bzbRkYc1byzy23Bwr6rvnGHDnDCmTGWQqsXCK1a7AP/LIc9nHmcS802znOf/6E8tlo LaSJPl5PLMCfsUEqyzvO1wiI/gadD40IKhXBJAGY3nuSAAwnD0NdACu607cOivOnugT2 oAJ6NVLzc81pzboq+vYO6YbOgeBYFtYwGxScoO2FJm30Ol1Y5Y8RdwXnh+B+k3hw+ogG Jx6A== 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=ik/E/X8zilHYacwrHfwx1Ixmy9paHB6Fr/9Pd7Wd/R4=; b=RMMXJWBrc4Fo2RDQRyIx/f6xBB0jK/J7NYeZsAN5DqBYOts5S9aOIXdwnU+rhRKk6P ygR7Trf4HgTOeWwufGnUCLTk5Z6PfzbU093nJj3HbRmRg9abCDm/+mmuw/zemeYugbn6 7AHfx/8Any56K3WqI91xdJ5GRIx0zjnRSlFU0J6mrzVC82oIoiLJz/hDr986x+r0PvAi oGm+UgladRBGSBJbDY20I22FShzLlGSfC2ieaLvcR9cbKwLu9lzQ0hpzoq/GFhB3XSAq WTZb+1cjHbkwZ3bCHDOv6g3kZ/6GlqeRCXhAe165PltOLGAXUC4riNI7XwWrQfHq8F+0 BLoA== X-Gm-Message-State: ANhLgQ0dg7aocyYPVZb+o+oTpdDgOhaU7HM6y3BaFg+bbj9DhORAVJG5 8BElYwQOxQtSz4ZqmbrpOepIfcE9 X-Google-Smtp-Source: ADFU+vtzYOF/wGgL7jpQ2p5jyGDao9b66h8QFEiyfUEaDcBxljwxa5OEYHDHw0IEx3IuBLqZMdIsIw== X-Received: by 2002:adf:ee85:: with SMTP id b5mr21847wro.34.1583160643374; Mon, 02 Mar 2020 06:50:43 -0800 (PST) Received: from hthiery01.sab.local ([213.135.10.150]) by smtp.gmail.com with ESMTPSA id h17sm29648355wro.52.2020.03.02.06.50.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2020 06:50:42 -0800 (PST) From: Heiko Thiery To: buildroot@buildroot.org Date: Mon, 2 Mar 2020 15:50:12 +0100 Message-Id: <20200302145013.9574-11-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200302145013.9574-1-heiko.thiery@gmail.com> References: <20200302145013.9574-1-heiko.thiery@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v4 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 c9287b416e..4cf1a919f3 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') @@ -564,6 +587,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: