From patchwork Sat Feb 22 08:57:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1242466 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.133; helo=hemlock.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=UhswK2lH; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48PjH72B4Cz9sRJ for ; Sat, 22 Feb 2020 20:10:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 831538805D; Sat, 22 Feb 2020 09:10:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7PhEp74m2Rhe; Sat, 22 Feb 2020 09:10:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id E37D48807C; Sat, 22 Feb 2020 09:10:55 +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 646E71BF5D7 for ; Sat, 22 Feb 2020 09:10:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 18A3E203FB for ; Sat, 22 Feb 2020 09:10:45 +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 xcinS-8+isOe for ; Sat, 22 Feb 2020 09:10:43 +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 18AC6204B0 for ; Sat, 22 Feb 2020 09:10:43 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id c84so4351769wme.4 for ; Sat, 22 Feb 2020 01:10:42 -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=REDQAUnBfcamcNtQaCK5yzCOoqaTay3IygzONpxLncs=; b=UhswK2lHnOY02KsTfhgBowy3sg3XIC0E3K3nJ18lUM0AnTpI2FTpEBqYPAQhqAouaV aSt06huUtX7g4KoCCr1ZQuWOZTPKnFl/MpCZXFSguKozg6r7UQDj/EqNbcCB1uyMAR6M E+hNgVrnNAFwtOlJbBxC0UNjfgO7i9gR/hjmjBfpPbIj4Y7pACo0UKLhzs8IHQAdL7hR lhGhNqpwCkuwi4hQB898TjxED9q94ma6iGbaU+9TnBxtOz/ANSDolu+9Eu27LOJAQuBn 3bjou8VxT30HVpQdng1iTB/36U8bnHsxqdVoqb4dmZCzdSMWaCanJICgOMcDKh3QgPo0 EPJQ== 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=REDQAUnBfcamcNtQaCK5yzCOoqaTay3IygzONpxLncs=; b=p56TW75NLA0w4hi5ELdf7bY9+RJf8sVYmBsO5H+R3HxP/AL56XPrWhq5ArWJ30l1wL qm9tSNcY5DhwmKC7vNV+DlaXe/ed/uB4kiAi6jVrgyDahad3/1rCz3iqOifXGU2RHiPd JKSLVoP/l47uqoPKaH8KJWXNzJIfLWNO6vEY69mik4DW6gGfND7xSzGs93EDxO+RL1fJ k8+3X+kFe6/X0A/hZ+dGS9PsB5WhUZuoD3SDdWJSVMdrclNTqrBAnEpo7QvcbszMEYMF mYcVW2+ui58iRpzv3soQfe12eoTM0SZlb6ZWINfZ6+85xPjz4qYLHaRF5Uwkti5CLYJx 73Wg== X-Gm-Message-State: APjAAAU+TOiDE3XnqdSP8e6ebvDFG/ELTyeGJSEYcEcNfqom5j9Fx7nC iI0N8Qgp4gCG5JzaE5ayBm7UzvK0 X-Google-Smtp-Source: APXvYqz5MyCiw3lZmw1il8gnJDcrC4FksUjoL0IBen9aQ0o49NUhABX821b1UYrwO+0BaG/YCVXpFg== X-Received: by 2002:a1c:ded7:: with SMTP id v206mr9432042wmg.106.1582362641135; Sat, 22 Feb 2020 01:10:41 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Feb 2020 01:10:40 -0800 (PST) From: Heiko Thiery To: buildroot@buildroot.org Date: Sat, 22 Feb 2020 09:57:14 +0100 Message-Id: <20200222085715.23769-11-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 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 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats index e954dd125e..be3b6d7e71 100755 --- a/support/scripts/pkg-stats +++ b/support/scripts/pkg-stats @@ -125,6 +125,14 @@ class Package: self.status['url'] = ("warning", "missing") fp.close() + def is_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 @@ -146,6 +154,11 @@ class Package: """ Fills in the .status['license'] and .status['license-files'] fields """ + if self.is_valid_infra() == False: + 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") @@ -160,6 +173,11 @@ class Package: """ Fills in the .status['hash'] field """ + if self.is_valid_infra() == False: + 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): @@ -180,6 +198,10 @@ class Package: """ Fills in the .patch_count, .patch_files and .status['patches'] fields """ + if self.is_valid_infra() == False: + 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') @@ -558,6 +580,10 @@ def check_package_latest_version(packages): pkg.latest_version['version'] = r[1] pkg.latest_version['id'] = r[2] + if pkg.is_valid_infra() == False: + pkg.status['version'] = ("na", "no valid package infra") + continue + if pkg.latest_version['status'] == RM_API_STATUS_ERROR: pkg.status['version'] = ('warning', 'RM API error') elif pkg.latest_version['status'] == RM_API_STATUS_NOT_FOUND: