From patchwork Tue Sep 13 05:18:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 669152 X-Patchwork-Delegate: trini@ti.com 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 3sYCfl6lCCz9sRZ for ; Tue, 13 Sep 2016 15:19:59 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=ezbdwkvZ; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D1387A752D; Tue, 13 Sep 2016 07:19:50 +0200 (CEST) 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 erShzXnTUyvT; Tue, 13 Sep 2016 07:19:50 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7262EB3810; Tue, 13 Sep 2016 07:19:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BDFD84B98B for ; Tue, 13 Sep 2016 07:19:28 +0200 (CEST) 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 l4wMyCVIuJLG for ; Tue, 13 Sep 2016 07:19:28 +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 mail-oi0-f48.google.com (mail-oi0-f48.google.com [209.85.218.48]) by theia.denx.de (Postfix) with ESMTPS id 079CD4BB1A for ; Tue, 13 Sep 2016 07:19:21 +0200 (CEST) Received: by mail-oi0-f48.google.com with SMTP id q188so246127243oia.3 for ; Mon, 12 Sep 2016 22:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=UWY0SEBoh3YbLMMhHabubpO9/gwpqWCiqcVxcsDtauA=; b=ezbdwkvZ/v1HD9BkYsw7Ttoa3tyEIyYdqoK54pvXH65aYJxuif24jQbXLgfX9mrJOY L0EiXVpu1xmjuE/tBgULFPSQMk/5S5CJG37iNKcMXTvJjZZyS6xVcSJkIkJck86+Rwu7 NoTxEGDtWY3nzHC/VBH4CzsjDdWbdg8TyxdxthJvNUuOR1xU2HUB9pgmKJyvlkbIcl3y 5IN7CSSPNHj4STnxj+Ag/vxLSghka4Gm/ujQP8215+jazQpAw3iJ5cZAXVLZxSx/tAsw RMH/L1t+zSriHSoKfHv3PaJLcWjV5wGIipbIISb/5aCUqd5GmtnyFDHNVi/rLO/CHPRC xz1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=UWY0SEBoh3YbLMMhHabubpO9/gwpqWCiqcVxcsDtauA=; b=f8foEr5nto6DlMFbzawNaeIPUElvbw6VnSqJHDBaTkZN91tpo0cZtyBA5hyw+Ya+F6 ZsIkSID/7rdvcoabJKaZ8erYkIZSMVCVv11CflUO8s0lpDUP5ejnIumFCHe3K2uo/pLN ggqEhfGXGlKfDss5Q2nUTvzhQ+/E28iexwVFUUHHhyZ1vbW8rVLMR2+OiWZr1xMYRLBV thEGDgACGbsyhu3ls/OQeR0UODfsaAuMQrK4pkow1IGTZfZS+J4zMALrzSHs5BiOd+2w HwodKKwYJXhpGELY2WTSKBlfcUnFdx24O0BwRS830/Fhxvm2lSeUz4GBqyKY7n+/ouln FHng== X-Gm-Message-State: AE9vXwOXVdqiFwLYfziMLe0CFK1K0c0TtO4CxKbnhC7UIi89OC78bnVwXZtIWOn+aTN3E3kZ X-Received: by 10.202.195.215 with SMTP id t206mr4368997oif.126.1473743960000; Mon, 12 Sep 2016 22:19:20 -0700 (PDT) Received: from kaki.bld.corp.google.com ([2620:0:1005:12:30be:bb2b:5a2a:a5ee]) by smtp.gmail.com with ESMTPSA id v7sm10830981itd.6.2016.09.12.22.19.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Sep 2016 22:19:19 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 7EBCB220C42; Mon, 12 Sep 2016 23:19:18 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Mon, 12 Sep 2016 23:18:20 -0600 Message-Id: <1473743943-15003-3-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1473743943-15003-1-git-send-email-sjg@chromium.org> References: <1473743943-15003-1-git-send-email-sjg@chromium.org> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 02/45] moveconfig: Add an option to skip prompts X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" At present it is not easy to use moveconfig from a script since it asks for user input a few times. Add a -y option to skip this and assume that 'y' was entered. Signed-off-by: Simon Glass --- Changes in v3: None Changes in v2: - Add some notes on this option to moveconfig.py tools/moveconfig.py | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index bdfa039..52ec1bd 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -162,6 +162,10 @@ Available options -v, --verbose Show any build errors as boards are built + -y, --yes + Instead of prompting, automatically go ahead with all operations. This + includes cleaning up headers and CONFIG_SYS_EXTRA_OPTIONS. + To see the complete list of supported options, run $ tools/moveconfig.py -h @@ -482,14 +486,15 @@ def cleanup_headers(configs, options): configs: A list of CONFIGs to remove. options: option flags. """ - while True: - choice = raw_input('Clean up headers? [y/n]: ').lower() - print choice - if choice == 'y' or choice == 'n': - break + if not options.yes: + while True: + choice = raw_input('Clean up headers? [y/n]: ').lower() + print choice + if choice == 'y' or choice == 'n': + break - if choice == 'n': - return + if choice == 'n': + return patterns = [] for config in configs: @@ -561,14 +566,16 @@ def cleanup_extra_options(configs, options): configs: A list of CONFIGs to remove. options: option flags. """ - while True: - choice = raw_input('Clean up CONFIG_SYS_EXTRA_OPTIONS? [y/n]: ').lower() - print choice - if choice == 'y' or choice == 'n': - break + if not options.yes: + while True: + choice = (raw_input('Clean up CONFIG_SYS_EXTRA_OPTIONS? [y/n]: '). + lower()) + print choice + if choice == 'y' or choice == 'n': + break - if choice == 'n': - return + if choice == 'n': + return configs = [ config[len('CONFIG_'):] for config in configs ] @@ -1252,6 +1259,8 @@ def main(): help='the number of jobs to run simultaneously') parser.add_option('-r', '--git-ref', type='string', help='the git ref to clone for building the autoconf.mk') + parser.add_option('-y', '--yes', action='store_true', default=False, + help="respond 'yes' to any prompts") parser.add_option('-v', '--verbose', action='store_true', default=False, help='show any build errors as boards are built') parser.usage += ' CONFIG ...'