From patchwork Mon Mar 2 14:50:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1247691 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=DUf3+GuG; 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 48WNPb4fjdz9sRN for ; Tue, 3 Mar 2020 01:51:15 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 04FCD204B5; Mon, 2 Mar 2020 14:51:14 +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 uCGadwvFCV4p; Mon, 2 Mar 2020 14:51:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 6EE0220496; Mon, 2 Mar 2020 14:51:11 +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 593C61BF973 for ; Mon, 2 Mar 2020 14:51:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 55A0A8587E for ; Mon, 2 Mar 2020 14:51:08 +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 ppHdkEWh2Bxg for ; Mon, 2 Mar 2020 14:51:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 719D7858A6 for ; Mon, 2 Mar 2020 14:50:43 +0000 (UTC) Received: by mail-wm1-f45.google.com with SMTP id m3so10941309wmi.0 for ; Mon, 02 Mar 2020 06:50:43 -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=HkCAuAaCvIIpJjfDDIqEbOcXD06rQTsWsiZYFEEDT3M=; b=DUf3+GuGeJ2DCYOyjbZ+mDSBjRIYNqHAV5LI8/WZw0JLlVpP/C3MD6vPzHf11NTLwd C2q/inGoG1H/a254t87CPJk1nVpO1o4W9UKCww9OlIBEdBHcH/NAdAB7Xq7P7Hy+E8ze mxeDqNxN9bb/6tQokXw6613x3hyfEZ3VntMaCj1lUcg3LcJ7Yu7x3ySV+YsqEC1G7+eD 1WjRBnxroXc+tufgFWmuQ+OseRBjLJXkHTNouv0ncDmgLK+S6R79gUrdXVwb6NjPhmew Nl7Us3OR2Wtr3kcMUoES4uVGHU4pXr8N15Ct4lqGUDnjdA4nNuAapKCOiDQ3I3MBHV3u cDkg== 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=HkCAuAaCvIIpJjfDDIqEbOcXD06rQTsWsiZYFEEDT3M=; b=Z4gco+y3h3P2U/OeD2dwnRTC69bVYpAncdYeOBidI5NtlXtt5+YODlZQ1dgLZo48Lc zMEgHA+7V78+ltCF72zxRwZ9Tr8iEI3Nvd6BeJrQlLCNHDCRP0yM732+fDjIjoiVxjdo 0xu4VA6QAYU8RaVJNxORaF3KaSZhIwEX1UkQyrutyy0O3Fp4ynYCeqVOx4USZ5BpWbFu Txh1pFisdDivo+e8kiEDvQVHFeDRXohYlObB7jDGVeCMN0QIpiJF+wje+CAThAvVKory 8lpcBXKomMLgkDQE4krt+m5qnfq0DrgjL55l/E4h5j6+M9QNix3bWIlMbCiN1zCszmWj od7A== X-Gm-Message-State: APjAAAVTNb4oVl9HmiqbdvyU06GCqT6fchjzn8ggxwrmoDKibAXellGp eXy1A9C4JoE1e75CvSjTufmLqhVG X-Google-Smtp-Source: APXvYqxhlCl3/3DJB248ZIhWVw19m4zRGQ3nKulwr0nLwoPHdP3ipOJ9Dc2qTPJnC8bmt35/zYl18w== X-Received: by 2002:a7b:cb97:: with SMTP id m23mr19212163wmi.37.1583160641649; Mon, 02 Mar 2020 06:50:41 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Mar 2020 06:50:41 -0800 (PST) From: Heiko Thiery To: buildroot@buildroot.org Date: Mon, 2 Mar 2020 15:50:10 +0100 Message-Id: <20200302145013.9574-9-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 08/12] support/scripts/pkg-stats: add defconfig support 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" Scan configs directory and create Defconfig objects. Signed-off-by: Heiko Thiery --- support/scripts/pkg-stats | 43 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats index 1fd306a6d5..432090c251 100755 --- a/support/scripts/pkg-stats +++ b/support/scripts/pkg-stats @@ -54,6 +54,34 @@ RM_API_STATUS_NOT_FOUND = 4 # because it's used by sub-processes. http_pool = None +class Defconfig: + def __init__(self, name, path): + self.name = name + self.path = path + self.developers = None + + def set_developers(self, developers): + """ + Fills in the .developers field + """ + self.developers = [ + developer.name + for developer in developers + if developer.hasfile(self.path) + ] + + +def get_defconfig_list(): + """ + Builds the list of Buildroot defconfigs, returning a list of Defconfig + objects. + """ + return [ + Defconfig(name[:-len('_defconfig')], os.path.join('configs', name)) + for name in os.listdir('configs') + if name.endswith('_defconfig') + ] + class Package: all_licenses = dict() @@ -886,7 +914,7 @@ def dump_html(packages, stats, date, commit, output): f.write(html_footer) -def dump_json(packages, stats, date, commit, output): +def dump_json(packages, defconfigs, stats, date, commit, output): # Format packages as a dictionnary instead of a list # Exclude local field that does not contains real date excluded_fields = ['url_worker', 'name'] @@ -897,6 +925,12 @@ def dump_json(packages, stats, date, commit, output): if k not in excluded_fields } for pkg in packages } + defconfigs = { + d.name: { + k: v + for k, v in d.__dict__.items() + } for d in defconfigs + } # Aggregate infrastructures into a single dict entry statistics = { k: v @@ -907,6 +941,7 @@ def dump_json(packages, stats, date, commit, output): # The actual structure to dump, add commit and date to it final = {'packages': pkgs, 'stats': statistics, + 'defconfigs': defconfigs, 'commit': commit, 'date': str(date)} @@ -948,6 +983,10 @@ def __main__(): packages = get_pkglist(args.npackages, package_list) print("Getting developers ...") developers = parse_developers() + print("Build defconfig list ...") + defconfigs = get_defconfig_list() + for d in defconfigs: + d.set_developers(developers) print("Getting package make info ...") package_init_make_info() print("Getting package details ...") @@ -974,7 +1013,7 @@ def __main__(): dump_html(packages, stats, date, commit, args.html) if args.json: print("Write JSON") - dump_json(packages, stats, date, commit, args.json) + dump_json(packages, defconfigs, stats, date, commit, args.json) __main__()