From patchwork Thu Oct 22 20:34:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 534583 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id D217D14131F for ; Fri, 23 Oct 2015 07:35:08 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=iRuYyxLW; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0C31D87F9C; Thu, 22 Oct 2015 20:35:08 +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 2JQcfkMvzIaI; Thu, 22 Oct 2015 20:35:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id B047688B7A; Thu, 22 Oct 2015 20:35:06 +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 38E4B1CE71B for ; Thu, 22 Oct 2015 20:34:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 330CA89618 for ; Thu, 22 Oct 2015 20:34:43 +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 0v2OoSiYeIHY for ; Thu, 22 Oct 2015 20:34:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by whitealder.osuosl.org (Postfix) with ESMTPS id 72CD888B96 for ; Thu, 22 Oct 2015 20:34:41 +0000 (UTC) Received: by wicfx6 with SMTP id fx6so5113243wic.1 for ; Thu, 22 Oct 2015 13:34:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=l6V2kGBDFoFeiqtazYfKdmylSncjpBViZ2+lf0M89Po=; b=iRuYyxLWDzuuJ/uBVJoY5GkrWhwCdBqHJezgIJdbhBLSUwxUlo0Mta6YfD9+EXZVcv HtQ15YusZodMIdHWBtsBfYvvq9Qu2TRR/SQxgebEkDbKqEWZMWmVZpuALEPxs0iVLhCQ WAJ0ADFGzi3yGO1o7l/jygfBoEOP7R5aVQziZ6cAzn16poh+8l4eXH0+eyDMd8qUdGS/ Nt/5Ku3cHIc1X5OyR0DfTUHr7Jy4tqer0YHOeO/DOINLA9Al6XjeyJ7IjG2bsjpGb0At 825Iw51s967+gT7d1wLo1gou6aEsqJxzILXzVBJ6J/IF8l67jkPogY6iXQIthHDjW5HE bmsA== X-Received: by 10.194.205.162 with SMTP id lh2mr19231377wjc.61.1445546080179; Thu, 22 Oct 2015 13:34:40 -0700 (PDT) Received: from gourin.bzh.lan (ns304657.ip-46-105-103.eu. [46.105.103.66]) by smtp.gmail.com with ESMTPSA id jt9sm3691097wjc.24.2015.10.22.13.34.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Oct 2015 13:34:39 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Thu, 22 Oct 2015 22:34:13 +0200 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: Thomas Petazzoni , "Yann E. MORIN" , Peter Korsgaard Subject: [Buildroot] [PATCH 18/21 v2] support/scripts: teach gen-manual-lists about BR2_EXTERNAL X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When using BR2_EXTERNAL, generate the list of packages from there. This is currently effectively unused for now, as BR2_EXTERNAL is not available (not exported in the environment); that will be updated in a later patch. Signed-off-by: "Yann E. MORIN" Cc: Samuel Martin Cc: Thomas Petazzoni Cc: Peter Korsgaard Cc: Thomas De Schampheleire --- support/scripts/gen-manual-lists.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/support/scripts/gen-manual-lists.py b/support/scripts/gen-manual-lists.py index d231eda..a672b7b 100644 --- a/support/scripts/gen-manual-lists.py +++ b/support/scripts/gen-manual-lists.py @@ -141,7 +141,6 @@ class Buildroot: """ root_config = "Config.in" - package_dirname = "package" package_prefixes = ["BR2_PACKAGE_", "BR2_PACKAGE_HOST_"] re_pkg_prefix = re.compile(r"^(" + "|".join(package_prefixes) + ").*") deprecated_symbol = "BR2_DEPRECATED" @@ -182,12 +181,22 @@ class Buildroot: 'format': "_format_symbol_prompt_location", 'sorted': False, }, + 'external': { + 'filename': "br2-external-package-list", + 'root_menu': "User-provided options", + 'filter': "_is_real_package", + 'format': "_format_symbol_prompt_location", + 'sorted': True, + }, } def __init__(self): self.base_dir = os.environ.get("TOPDIR") self.output_dir = os.environ.get("O") - self.package_dir = os.path.join(self.base_dir, self.package_dirname) + self.package_dirs = [] + self.package_dirs.append(os.path.join(self.base_dir, "package")) + if os.getenv('BR2_EXTERNAL'): + self.package_dirs.extend(os.environ["BR2_EXTERNAL"].split()) self.config = kconfiglib.Config(os.path.join(self.base_dir, self.root_config), self.base_dir) @@ -259,9 +268,10 @@ class Buildroot: # symbol. if not hasattr(self, "_package_list"): pkg_list = [] - for _, _, files in os.walk(self.package_dir): - for file_ in (f for f in files if f.endswith(".mk")): - pkg_list.append(re.sub(r"(.*?)\.mk", r"\1", file_)) + for d in self.package_dirs: + for _, _, files in os.walk(d): + for file_ in (f for f in files if f.endswith(".mk")): + pkg_list.append(re.sub(r"(.*?)\.mk", r"\1", file_)) setattr(self, "_package_list", pkg_list) for pkg in getattr(self, "_package_list"): if type == 'real': @@ -491,6 +501,8 @@ class Buildroot: if __name__ == '__main__': list_types = ['target-packages', 'host-packages', 'virtual-packages', 'deprecated'] + if os.getenv('BR2_EXTERNAL'): + list_types.append('external') parser = ArgumentParser() parser.add_argument("list_type", nargs="?", choices=list_types, help="""\ @@ -505,6 +517,8 @@ Generate the given list (generate all lists if unspecified)""") help="Output virtual package file") parser.add_argument("--output-deprecated", dest="output_deprecated", help="Output deprecated file") + parser.add_argument("--output-external", dest="output_external", + help="Output br2-external file") args = parser.parse_args() lists = [args.list_type] if args.list_type else list_types buildroot = Buildroot()