Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4F8AC001DF for ; Sun, 16 Jul 2023 00:46:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A5F08866CE; Sun, 16 Jul 2023 02:40:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="mOpziGVs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 82B3D86610; Sun, 16 Jul 2023 02:38:23 +0200 (CEST) Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BB56D865F0 for ; Sun, 16 Jul 2023 02:38:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd30.google.com with SMTP id ca18e2360f4ac-78372625badso162283339f.3 for ; Sat, 15 Jul 2023 17:38:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689467883; x=1692059883; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BZm+1a353I79c8D6dn1leUGO9RupSNiqjRS17negNKQ=; b=mOpziGVsIxv7p/1LsgSwWxSL6/RDNUOEYcNBIg2BU9Om0hAjbkzqfkq+qTnlBMopWT V9YFyzEeYa+ARNn/34xrVtBr9dXpG9Uns1ZAYTped9+XCyzHtfwVGhGyrEEUS6fHM4w7 OBjXxffL0OYEJsyaYTVOnspojNyrvr4K163lo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689467883; x=1692059883; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BZm+1a353I79c8D6dn1leUGO9RupSNiqjRS17negNKQ=; b=WjSeGeyW0tppFyjrce5mnge8vF89nQNxodVn8/3dQhacW0Yw5bnl73md3oZh02/m0e 8jght8KFqgQVREcws2zFLGEGLOXKuuh7uhLhuw7mH9TV3q+XadRKoUTahyRc7YPo6eZe YoLhKfCf7fofYz/ml/zSVR9xnZSb18tah/t3Ds9g3M8T44fxydrawmObdG+woYdVC79N gi0wLGmyLxYkCiYiG7QkhvjU/D/gQDxW0NBc0azZhIp5YlKdoW96RZLpRArZ8Luas89+ 1xuBrGC0wbi+oqoXau240XrDOCFop7QMBcFBTY6+ClmdB3S6sfxv7U3ApD/pNUJ6aLbO GVCA== X-Gm-Message-State: ABy/qLYSoMsm33F4EUqtzpDecGhD76vnSDvf4WxxOgn2bhp6O1R9uAZL iMkv5QDbsdDOzgbNUJbDY2DPfds7qUSpY+PoNE0= X-Google-Smtp-Source: APBJJlFjYW95Vs4UCIBUGkpEVBFIKe+3TPETviQZ7guwi1FQ6fyMgOFmp/HggEPRBQGQOEO0+29tUw== X-Received: by 2002:a6b:fd0c:0:b0:787:8cf:fe8a with SMTP id c12-20020a6bfd0c000000b0078708cffe8amr8734413ioi.2.1689467883204; Sat, 15 Jul 2023 17:38:03 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id t3-20020a05663801e300b0042b52dc77e3sm3510512jaq.158.2023.07.15.17.38.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jul 2023 17:38:03 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v3 57/81] buildman: Split parser creation in two Date: Sat, 15 Jul 2023 18:36:25 -0600 Message-ID: <20230716003718.231903-58-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.455.g037347b96a-goog In-Reply-To: <20230716003718.231903-1-sjg@chromium.org> References: <20230716003718.231903-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Split this into two functions to avoid a warning about too many statements. Signed-off-by: Simon Glass --- (no changes since v1) tools/buildman/cmdline.py | 44 +++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/tools/buildman/cmdline.py b/tools/buildman/cmdline.py index a5febe9da3e9..e218c8ffae76 100644 --- a/tools/buildman/cmdline.py +++ b/tools/buildman/cmdline.py @@ -14,19 +14,14 @@ import pathlib BUILDMAN_DIR = pathlib.Path(__file__).parent HAS_TESTS = os.path.exists(BUILDMAN_DIR / "test.py") -def parse_args(): - """Parse command line arguments from sys.argv[] - - Returns: - tuple containing: - options: command line options - args: command lin arguments - """ - epilog = """ [list of target/arch/cpu/board/vendor/soc to build] +def add_upto_m(parser): + """Add arguments up to 'M' - Build U-Boot for all commits in a branch. Use -n to do a dry run""" + Args: + parser (ArgumentParser): Parse to add to - parser = argparse.ArgumentParser(epilog=epilog) + This is split out to avoid having too many statements in one function + """ parser.add_argument('-a', '--adjust-cfg', type=str, action='append', help='Adjust the Kconfig settings in .config before building') parser.add_argument('-A', '--print-prefix', action='store_true', @@ -107,6 +102,16 @@ def parse_args(): parser.add_argument('-N', '--no-subdirs', action='store_true', dest='no_subdirs', default=False, help="Don't create subdirectories when building current source for a single board") + + +def add_after_m(parser): + """Add arguments after 'M' + + Args: + parser (ArgumentParser): Parse to add to + + This is split out to avoid having too many statements in one function + """ parser.add_argument('-o', '--output-dir', type=str, dest='output_dir', help='Directory where all builds happen and buildman has its workspace (default is ../)') parser.add_argument('-O', '--override-toolchain', type=str, @@ -156,6 +161,23 @@ def parse_args(): parser.add_argument('-Y', '--filter-migration-warnings', action='store_true', default=False, help='Filter out migration warnings from output') + + +def parse_args(): + """Parse command line arguments from sys.argv[] + + Returns: + tuple containing: + options: command line options + args: command lin arguments + """ + epilog = """ [list of target/arch/cpu/board/vendor/soc to build] + + Build U-Boot for all commits in a branch. Use -n to do a dry run""" + + parser = argparse.ArgumentParser(epilog=epilog) + add_upto_m(parser) + add_after_m(parser) parser.add_argument('terms', type=str, nargs='*', help='Board / SoC names to build') -- 2.41.0.455.g037347b96a-goog