From patchwork Wed Oct 9 20:28:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 282010 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id C428B2C007A for ; Thu, 10 Oct 2013 07:28:53 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A8ABA4A096; Wed, 9 Oct 2013 22:28:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ENN7xFaNfYN8; Wed, 9 Oct 2013 22:28:44 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8020D4A097; Wed, 9 Oct 2013 22:28:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 681934A067 for ; Wed, 9 Oct 2013 22:28:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f67d1NDbmQvH for ; Wed, 9 Oct 2013 22:28:30 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from avon.wwwdotorg.org (avon.wwwdotorg.org [70.85.31.133]) by theia.denx.de (Postfix) with ESMTPS id 3F5934A07B for ; Wed, 9 Oct 2013 22:28:23 +0200 (CEST) Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id 40EA56224; Wed, 9 Oct 2013 14:28:22 -0600 (MDT) Received: from swarren-lx1.nvidia.com (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id BB29DE47A1; Wed, 9 Oct 2013 14:28:21 -0600 (MDT) From: Stephen Warren To: Simon Glass Date: Wed, 9 Oct 2013 14:28:10 -0600 Message-Id: <1381350490-25867-2-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1381350490-25867-1-git-send-email-swarren@wwwdotorg.org> References: <1381350490-25867-1-git-send-email-swarren@wwwdotorg.org> X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.97.8 at avon.wwwdotorg.org X-Virus-Status: Clean Cc: u-boot@lists.denx.de, Stephen Warren Subject: [U-Boot] [PATCH 2/2] buildman: make board selector argument a regex X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Stephen Warren A common use-case is to build all boards for a particular SoC. This can be achieved by: ./tools/buildman/buildman -b mainline_dev -n tegra20 However, when the SoC is a member of a family of SoCs, and each SoC has a different name, it would be even more useful to build all boards for every SoC in that family. This currently isn't possible since buildman's board selection command-line arguments are compared to board definitions using pure string equality. To enable this, compare using a regex match instead. This matches MAKEALL's handling of command-line arguments. This enables: (all Tegra) ./tools/buildman/buildman -b mainline_dev -n tegra (all Tegra) ./tools/buildman/buildman -b mainline_dev -n '^tegra.*$' (all Tegra114, Tegra30 boards, but not Tegra20) ./tools/buildman/buildman -b mainline_dev -n 'tegra[13]' Signed-off-by: Stephen Warren --- tools/buildman/board.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/buildman/board.py b/tools/buildman/board.py index 1d3db20..5172a47 100644 --- a/tools/buildman/board.py +++ b/tools/buildman/board.py @@ -3,6 +3,8 @@ # SPDX-License-Identifier: GPL-2.0+ # +import re + class Board: """A particular board that we can build""" def __init__(self, status, arch, cpu, soc, vendor, board_name, target, options): @@ -135,14 +137,22 @@ class Boards: due to each argument, arranged by argument. """ result = {} + argres = {} for arg in args: result[arg] = 0 + argres[arg] = re.compile(arg) result['all'] = 0 for board in self._boards: if args: for arg in args: - if arg in board.props: + argre = argres[arg] + match = False + for prop in board.props: + match = argre.match(prop) + if match: + break + if match: if not board.build_it: board.build_it = True result[arg] += 1