From patchwork Tue May 26 23:42:14 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: 476864 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id DD17C14078C for ; Wed, 27 May 2015 09:45:19 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=heFFjx0z; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 284B333673; Tue, 26 May 2015 23:45:19 +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 8s4SMrrksEpt; Tue, 26 May 2015 23:45:10 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id D5D46336CA; Tue, 26 May 2015 23:43:09 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 00DAE1C1EB5 for ; Tue, 26 May 2015 23:42:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id EF9E3A3D0B for ; Tue, 26 May 2015 23:42:45 +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 ZnI-SVbOYuDF for ; Tue, 26 May 2015 23:42:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 3D666A3CE3 for ; Tue, 26 May 2015 23:42:45 +0000 (UTC) Received: by wgez8 with SMTP id z8so110460729wge.0 for ; Tue, 26 May 2015 16:42:43 -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=YQrRVAH3gkZXAuxkTIxuiC6M1zTZkeIBLnf6T+4cLBI=; b=heFFjx0z4vPDo8onIRFSZeQ2trXtYVjG8tm7PgFnXJk5ro0v6TOOoUE+CdkJZecIXJ MTKjle1jcudPdLHhWhWmYZJmIZEIInEHcg3LHx5A+E53qkHmGqEeS68/swfT2UD+Tdyo MbdzEB0wU5Zg37KB1hKw3bFrpNMY5P3z5qOFmmX+CZFwJjYNehTPh9BmWCdhCb23WTVo m+JtOeSdMs8BMSXlYPnvGtgaSnYHPqS1zaold50JDvjBIR0+gRZ/fZZAzP9YPmaZLd1c iMEX6dji2/5EBw6+xS7WNtOg12H83J6tLXgwsyq5ija5IvOMu5JGnTc0hRRaz/Ii1Ahw 7FLg== X-Received: by 10.180.79.73 with SMTP id h9mr9555726wix.35.1432683763841; Tue, 26 May 2015 16:42:43 -0700 (PDT) Received: from gourin.bzh.lan (ns304657.ip-46-105-103.eu. [46.105.103.66]) by mx.google.com with ESMTPSA id n3sm19280168wix.1.2015.05.26.16.42.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 May 2015 16:42:43 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Wed, 27 May 2015 01:42:14 +0200 Message-Id: <66a04ef770db393a305d62f2e4a084be747446e2.1432681414.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: Thomas Petazzoni , "Yann E. MORIN" , Peter Korsgaard Subject: [Buildroot] [PATCH 19/21 RFC] 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 ec59030..7d9356c 100644 --- a/support/scripts/gen-manual-lists.py +++ b/support/scripts/gen-manual-lists.py @@ -146,7 +146,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" @@ -187,12 +186,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()) # The kconfiglib requires an environment variable named "srctree" to # load the configuration, so set it. os.environ.update({'srctree': self.base_dir}) @@ -266,9 +275,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': @@ -495,6 +505,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="""\ @@ -509,6 +521,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()