From patchwork Thu Aug 10 16:31:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819947 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=YSuwNb+j; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCBp27Scz1yfB for ; Fri, 11 Aug 2023 02:32:34 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7DDE386886; Thu, 10 Aug 2023 18:32:25 +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="YSuwNb+j"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 027688666E; Thu, 10 Aug 2023 18:32:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (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 EB43D86886 for ; Thu, 10 Aug 2023 18:32:21 +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-il1-x135.google.com with SMTP id e9e14a558f8ab-3498811fcf8so3804485ab.3 for ; Thu, 10 Aug 2023 09:32:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685140; x=1692289940; 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=KFXQzaie98/zvOM2JN1EyUzp1J9P5aT5IwQGa/Gg++Y=; b=YSuwNb+jRzb2zmVIk2knNz/bqG2iv19SoT/Yn9CDs71PvnQKcTtDhqqRfdLJucvKPd hrcQSWhKnoHbU8p03x/09Kb1q0viiVBkP05UyXxsbi6tMOAlJFHosjHzjPc3zj6l42co 4bmXQOzzpRmEkD8e8TJFmMMJ7MmWAxMcYPupI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685140; x=1692289940; 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=KFXQzaie98/zvOM2JN1EyUzp1J9P5aT5IwQGa/Gg++Y=; b=Q5WDFQiyZ9IrbC5IMt4d7Dc44rz/VCug221VcKem3qyMPkMIGzqWzPcJHbQaE7k9XW a+6UOtA9kmybfoiEHQzMSN5YG9LS5/qK0Cs+ZEJ8HxQODrOVlCCn/y1KYnVMMQf0gy/v 8Kq5Hpgoiia9X02LORuUbolvZKtYg9nGdVucUaHqtuGH9JGhQLrDHrHlA3HDzgeFdy9f 5ukIXTutCKM5a9ajs+DV7O/YWXBNVtlvkY2jEY1lvV5s8Zavo/vgYOsfCcP0yi0osGD7 OxYlv761LkRB+YSj/6okKeDqsW15iGzeW64Ry/e3/4fauDDBsUIZF69QdlaFLoafzZ94 ECDA== X-Gm-Message-State: AOJu0YxEYoYag6EaDTu1VGpIqlWczXJBAn4oxXCD/azN3RvnXuJxENnR Gf/bM6EUuyq2HGUhnd9uAoV/z89fWDNlD/J6UdQ= X-Google-Smtp-Source: AGHT+IHCvL95rcggW3eX9xrS4eLvc6jjiIVKpNkREkLDXyYFTlZhheyjiP5XuoYxhbXA/PWvS0Tg+Q== X-Received: by 2002:a92:cd8e:0:b0:346:7502:aeaa with SMTP id r14-20020a92cd8e000000b003467502aeaamr3802147ilb.18.1691685140578; Thu, 10 Aug 2023 09:32:20 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:20 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 01/28] moveconfig: Drop -C option Date: Thu, 10 Aug 2023 10:31:33 -0600 Message-ID: <20230810163212.2368374-2-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Drop this option, which is no longer needed now that we have converted all CONFIG options to Kconfig. Signed-off-by: Simon Glass --- tools/moveconfig.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 6cbecc3d5c8..83c53911284 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -1940,8 +1940,6 @@ doc/develop/moveconfig.rst for documentation.''' help='build a CONFIG database') parser.add_argument('-c', '--color', action='store_true', default=False, help='display the log in color') - parser.add_argument('-C', '--commit', action='store_true', default=False, - help='Create a git commit for the operation') parser.add_argument('-d', '--defconfigs', type=str, help='a file containing a list of defconfigs to move, ' "one per line (for example 'snow_defconfig') " @@ -2048,18 +2046,6 @@ doc/develop/moveconfig.rst for documentation.''' cleanup_headers(configs, args) cleanup_readme(configs, args) - if args.commit: - subprocess.call(['git', 'add', '-u']) - if configs: - msg = 'Convert %s %sto Kconfig' % (configs[0], - 'et al ' if len(configs) > 1 else '') - msg += ('\n\nThis converts the following to Kconfig:\n %s\n' % - '\n '.join(configs)) - else: - msg = 'configs: Resync with savedefconfig' - msg += '\n\nRsync all defconfig files using moveconfig.py' - subprocess.call(['git', 'commit', '-s', '-m', msg]) - if args.build_db: with open(CONFIG_DATABASE, 'w', encoding='utf-8') as fd: for defconfig, configs in config_db.items(): From patchwork Thu Aug 10 16:31:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819948 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=QD0DDbEy; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCC024Cxz1yfB for ; Fri, 11 Aug 2023 02:32:44 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C4548868CE; Thu, 10 Aug 2023 18:32:27 +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="QD0DDbEy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E200C86878; Thu, 10 Aug 2023 18:32:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (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 D75A6868AE for ; Thu, 10 Aug 2023 18:32:22 +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-il1-x12e.google.com with SMTP id e9e14a558f8ab-34913c049c4so4002005ab.2 for ; Thu, 10 Aug 2023 09:32:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685141; x=1692289941; 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=a2Mndy8f8odFv0bF2pJvvF1Zhu4dzCw7Waa6X5TzwiE=; b=QD0DDbEy2lH+SC4p8Ue37cypgZ2LCyX3nLpPk6EcpyYBhaArglGZglDha5tBOfbTxP piiJ5tYNkclSQVid1uWG2ZH9fvuNlvVAJA9KRk8tMZXgyDgim5rjJjZFAjvoYt2Sbiz5 UEH84zp4BUlUGV2sKUnyVy1VsORZvfCd9IQQc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685141; x=1692289941; 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=a2Mndy8f8odFv0bF2pJvvF1Zhu4dzCw7Waa6X5TzwiE=; b=ZXBceVvOKxiL+RMDjdNiOBmjk+v+lkUaJmNMTB0wrLXtVCJdq25866ESml+GS0z4ff AbVoWxFvGH6R1tCBUv5g4JDLqLqAb20g/nemlTkE4Ltij2itFqn30JiPuYnAFlI6CLCu IGjdv7kfCAKjmttLGFNGcZm9blC4FV0F+1Vy65VtWHM1ZSpce1TKAvyXwR384BiNBovx plZrnYHFZ8SiCIE/n57RSpV551PmgoVpoQt+LBPKAqZ0EKw5BfU4IA8BzrLZuida9KPB 087f04eqnJQTizfP9aby3x43r5sU1KlkJybu75YQ/IESTXBTdZO5CNQxpi0i4nC6ZDuH nZZw== X-Gm-Message-State: AOJu0YwsIbreeRmuA36zsObZHQbir+YGoPGrYAwJxTrod4Oosb2ARFaL rrYdrHnYy3EF5zMWHIgXQPvTPLE42JpMEBlTA8U= X-Google-Smtp-Source: AGHT+IFLL+Yym9bqqb9/QvgTbBxxCfCVacto7xjWrwi2BQmHlh+u5rpEC+hQNFMg17j0BeehenejIw== X-Received: by 2002:a05:6e02:e12:b0:345:787a:cb1c with SMTP id a18-20020a056e020e1200b00345787acb1cmr3161820ilk.6.1691685141450; Thu, 10 Aug 2023 09:32:21 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:21 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 02/28] moveconfig: Drop -H option Date: Thu, 10 Aug 2023 10:31:34 -0600 Message-ID: <20230810163212.2368374-3-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Drop this option, which is no longer needed now that we have converted all CONFIG options to Kconfig. Signed-off-by: Simon Glass --- tools/moveconfig.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 83c53911284..7b7426726bd 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -1949,9 +1949,6 @@ doc/develop/moveconfig.rst for documentation.''' help='exit immediately on any error') parser.add_argument('-f', '--find', action='store_true', default=False, help='Find boards with a given config combination') - parser.add_argument('-H', '--headers-only', dest='cleanup_headers_only', - action='store_true', default=False, - help='only cleanup the headers') parser.add_argument('-i', '--imply', action='store_true', default=False, help='find options which imply others') parser.add_argument('-I', '--imply-flags', type=str, default='', @@ -2033,14 +2030,13 @@ doc/develop/moveconfig.rst for documentation.''' t.setDaemon(True) t.start() - if not args.cleanup_headers_only: - check_clean_directory() - bsettings.setup('') - toolchains = toolchain.Toolchains() - toolchains.GetSettings() - toolchains.Scan(verbose=False) - move_config(toolchains, configs, args, db_queue) - db_queue.join() + check_clean_directory() + bsettings.setup('') + toolchains = toolchain.Toolchains() + toolchains.GetSettings() + toolchains.Scan(verbose=False) + move_config(toolchains, configs, args, db_queue) + db_queue.join() if configs: cleanup_headers(configs, args) From patchwork Thu Aug 10 16:31:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819949 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=SvlffBjl; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCCC48tZz1yfB for ; Fri, 11 Aug 2023 02:32:55 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1219486892; Thu, 10 Aug 2023 18:32:28 +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="SvlffBjl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 39839868BF; Thu, 10 Aug 2023 18:32:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (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 24FB78666E for ; Thu, 10 Aug 2023 18:32:24 +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-pl1-x62d.google.com with SMTP id d9443c01a7336-1bc99545d53so9764555ad.1 for ; Thu, 10 Aug 2023 09:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685142; x=1692289942; 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=WsVMuGsPdHESl4TPihkrBKz1N7cAL8q/bg4R9M8CS6I=; b=SvlffBjllVwP5nn/iQZJTskjz5d0mT+2u3vGFDlq19iIjcAMPtSiADMtPNHW4dOn6e b5sOxPiqhd5nBAjH9QoL3TWXdjpTkL7uKxds+TC/uv7+CLFSaf1caGh3ymadexquhuoU CqZvHE4xPjA2NhVv2sxhbNFUqn7/l3YoSTl04= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685142; x=1692289942; 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=WsVMuGsPdHESl4TPihkrBKz1N7cAL8q/bg4R9M8CS6I=; b=aiChYByrXtlP5dSTAfVpT5kfpdHHxcKaNt0/3E3b7OuOjCpwjmbB+29xBv1QABJmp6 alWDXKtrB8nipbpF/EffHh9tClymtnjLCr5BRZb3Bku6+gl6rIXamZMMMldzMnARIJom uY30TjqoJFWtVCrqwWYAI6z+1rr9wH7DWeN9sELKGS+fopm3cX3IxIIZFdIbgwIP9ZLD 3Xi4AnGiSA5GT3Rgd/ti758DtxZBMuUvNaLiwQeOPM5vlhO1XEtEJW5bWqeGkMzMqzAA vrjFyCapB7aD33NgW+3Kghu19BUKpFqigyWyewc9F6Vsx+jbG5qPrLCRRTiSkyuKYSkd Mg1Q== X-Gm-Message-State: AOJu0YyhJcqe/05ywTUTPebaYLslJvelG5+g5Yueljk5NPBwPY4jqAAn GHprIcQ9M0Qapg8ZkT6sBQjY3xa7cO+mRgeYYto= X-Google-Smtp-Source: AGHT+IFCU9Tja2JFfQZV+2l/7GaAv3RO63t8/duLOjBcmGBbJqSalXm8kGhP6ZWIf4U1Q4Se6sb2pg== X-Received: by 2002:a17:903:41d1:b0:1b8:16c7:a786 with SMTP id u17-20020a17090341d100b001b816c7a786mr3858422ple.4.1691685142173; Thu, 10 Aug 2023 09:32:22 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:21 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 03/28] moveconfig: Avoid deprecation warning for setDaemon Date: Thu, 10 Aug 2023 10:31:35 -0600 Message-ID: <20230810163212.2368374-4-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Use the recommended new way of setting a thread to be a daemon. This avoids a warning: DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead Signed-off-by: Simon Glass --- tools/moveconfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 7b7426726bd..446b68bcd10 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -2027,7 +2027,7 @@ doc/develop/moveconfig.rst for documentation.''' config_db = {} db_queue = queue.Queue() t = DatabaseThread(config_db, db_queue) - t.setDaemon(True) + t.daemon = True t.start() check_clean_directory() From patchwork Thu Aug 10 16:31:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819950 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=aUfN6mD9; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCCP5KY9z1yfB for ; Fri, 11 Aug 2023 02:33:05 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 58919868BF; Thu, 10 Aug 2023 18:32:28 +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="aUfN6mD9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 64032868CB; Thu, 10 Aug 2023 18:32:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) (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 5F6B2867D0 for ; Thu, 10 Aug 2023 18:32:24 +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-il1-x12d.google.com with SMTP id e9e14a558f8ab-34911a634edso4057945ab.0 for ; Thu, 10 Aug 2023 09:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685143; x=1692289943; 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=32FLEXW/k05zRGB+EAMdSDKUrxuzhlkkpvxT4xDCTi8=; b=aUfN6mD9SJ7xKH8TDVFcmZ10E/qTGHPc/xDgE6YemZY+Y9ptEc5Z3AHaMQrFxL7U5r q2q8TEF0jNEpq4E0vL/1K2grgvl0Yk5GG3hnFu5aLn3qD8draJ5+d1S9kFRkwhR3Xpql UY5TqyXOprWOseb6Oc0JzE+p99DzY2H/rBI7w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685143; x=1692289943; 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=32FLEXW/k05zRGB+EAMdSDKUrxuzhlkkpvxT4xDCTi8=; b=Li65PHDVMpmeKeJNZaKpNvxUCVcie/i6+LLVJH7ntgGtcqidin/RtaAsRpQLaLX2Af IXjiMmRLFb/M1ocjx2iGwFE8eRfjdTv/QYEPcVirBr5yqUsUoNANMe2RmbZkYBbIDyie igV/kN/SmSRtghNUKykcQ+zb9+QPF/oo7spjz9RY6soiYydPh27BmcaSxQcXs12hyuyC T0rkQW5rWQLn57M80tds7MwPG13MYAz4JSDS57IDQoaRm42nizZTMHQ7+VrK7bj7GedN 6nL0vI4P4CS4y1Xn7Thnrn2KqxIKeCkCWAaP44nExLbqT8t1zIf4b2omcPOqNQAvtPpK VtIA== X-Gm-Message-State: AOJu0Ywmz7IOv73X/eKnC8+OUCl+UE/c0dcrG2/3Wxq6b+YRWF2IAa+M mg0aC1L0k/I/eEyafBa3pqIBnfaA/Ope4HXMwVk= X-Google-Smtp-Source: AGHT+IGh8seguCsH3lzGVrCfa5GQTA5cesR+0/D9onQSiq9n33wYNrZIZYF8XSWMkx5Xj8eGfgtnlA== X-Received: by 2002:a92:c565:0:b0:349:7832:5d8 with SMTP id b5-20020a92c565000000b00349783205d8mr3979626ilj.5.1691685142997; Thu, 10 Aug 2023 09:32:22 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:22 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 04/28] moveconfig: Correct ordering of asteval import Date: Thu, 10 Aug 2023 10:31:36 -0600 Message-ID: <20230810163212.2368374-5-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 This should be after the standard imports. Move it to avoid a lot of pylint warnings. Signed-off-by: Simon Glass --- tools/moveconfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 446b68bcd10..70dc6a4d144 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -11,7 +11,6 @@ See doc/develop/moveconfig.rst for documentation. """ from argparse import ArgumentParser -import asteval import collections from contextlib import ExitStack import copy @@ -32,6 +31,7 @@ import threading import time import unittest +import asteval from buildman import bsettings from buildman import kconfiglib from buildman import toolchain From patchwork Thu Aug 10 16:31:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819951 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=MYlgyR7N; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCCb2HWpz1yfB for ; Fri, 11 Aug 2023 02:33:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A094B86878; Thu, 10 Aug 2023 18:32:30 +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="MYlgyR7N"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 64326868CE; Thu, 10 Aug 2023 18:32:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (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 269A3866B5 for ; Thu, 10 Aug 2023 18:32:25 +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-il1-x12c.google.com with SMTP id e9e14a558f8ab-3493862cfb1so4027165ab.1 for ; Thu, 10 Aug 2023 09:32:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685143; x=1692289943; 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=t79fUuIABjU6Jie7AhgmIUBL8DYS+7Od7VWJ+xTzMT4=; b=MYlgyR7NWog/WD8yFI4AArcMSJWDOzI5fgGzYegI1KSMNR2uBYPmZxUvrYXzrX02j8 2UivvGE3R0fYtLfIjPcvVogvElqik/N4BNR4H8T7wklJ9p7iPeNiZ1DXJB7tHq+e1gYb nX6MCEIHkXfDkTusJ6DtZy7Ubkp7KnhpoyZP4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685143; x=1692289943; 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=t79fUuIABjU6Jie7AhgmIUBL8DYS+7Od7VWJ+xTzMT4=; b=FfykJwoE4LAars6p+EcBb3Up8rRe3jzvGqfZW0ViT6HdG2pEdP+6vQpZrNMd+FrB7g o7HrRKWKsHxvYzmMNadzIHR7szgUf3zFvSrc4T2b7CYU+71ZvbhlIlS08wCpJV5pw1x8 91iNBhRuMkqDmy+ub69zLWHsK36bJSrSbmJ+BYG8Loya41U/tjBO+rKwlJuHK5y3SODp YjsKaEpXhym+iVrgxo7czZxrB4l/OTJ4Gedwz7QW6HCMmhaoXKBI3S2LD7jEpf44Vfvp FGTHYpYfvL4TZzkwMnM42hB8qjMmG6alTE+Fc8cljClXAMBsl7Ru2QmKLpftzrOclilB VIhA== X-Gm-Message-State: AOJu0YzYxUeHGPPFT/rd+ich7gkv4Pco0emhJ6eIfJ+pUHlIlg7tlOgg draZ2WToBHHTlNO+OlryKIRef3EgK6kijFIg2xA= X-Google-Smtp-Source: AGHT+IFkFROUhaG1uzZCAXrvhHdD00c/EXoBs8iB46S5TJ58ovxQgPScepLllYmAsYq7+LxkkTtcbA== X-Received: by 2002:a05:6e02:d42:b0:349:76c3:e8af with SMTP id h2-20020a056e020d4200b0034976c3e8afmr2874072ilj.16.1691685143699; Thu, 10 Aug 2023 09:32:23 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:23 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 05/28] moveconfig: Drop unused cleanup options Date: Thu, 10 Aug 2023 10:31:37 -0600 Message-ID: <20230810163212.2368374-6-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Cleaning up the README and config.h files are not needed now, since we don't have any CONFIG options to convert. Drop this code. Signed-off-by: Simon Glass --- tools/moveconfig.py | 254 +------------------------------------------- 1 file changed, 2 insertions(+), 252 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 70dc6a4d144..767aee39a79 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -13,8 +13,6 @@ See doc/develop/moveconfig.rst for documentation. from argparse import ArgumentParser import collections from contextlib import ExitStack -import copy -import difflib import doctest import filecmp import fnmatch @@ -205,102 +203,6 @@ def color_text(color_enabled, color, string): for s in string.split('\n') ]) return string -def show_diff(alines, blines, file_path, color_enabled): - """Show unidified diff. - - Args: - alines (list of str): A list of lines (before) - blines (list of str): A list of lines (after) - file_path (str): Path to the file - color_enabled (bool): Display the diff in color - """ - diff = difflib.unified_diff(alines, blines, - fromfile=os.path.join('a', file_path), - tofile=os.path.join('b', file_path)) - - for line in diff: - if line.startswith('-') and not line.startswith('--'): - print(color_text(color_enabled, COLOR_RED, line)) - elif line.startswith('+') and not line.startswith('++'): - print(color_text(color_enabled, COLOR_GREEN, line)) - else: - print(line) - -def extend_matched_lines(lines, matched, pre_patterns, post_patterns, - extend_pre, extend_post): - """Extend matched lines if desired patterns are found before/after already - matched lines. - - Args: - lines (list of str): list of lines handled. - matched (list of int): list of line numbers that have been already - matched (will be updated by this function) - pre_patterns (list of re.Pattern): list of regular expression that should - be matched as preamble - post_patterns (list of re.Pattern): list of regular expression that should - be matched as postamble - extend_pre (bool): Add the line number of matched preamble to the matched - list - extend_post (bool): Add the line number of matched postamble to the - matched list - """ - extended_matched = [] - - j = matched[0] - - for i in matched: - if i == 0 or i < j: - continue - j = i - while j in matched: - j += 1 - if j >= len(lines): - break - - for pat in pre_patterns: - if pat.search(lines[i - 1]): - break - else: - # not matched - continue - - for pat in post_patterns: - if pat.search(lines[j]): - break - else: - # not matched - continue - - if extend_pre: - extended_matched.append(i - 1) - if extend_post: - extended_matched.append(j) - - matched += extended_matched - matched.sort() - -def confirm(args, prompt): - """Ask the user to confirm something - - Args: - args (Namespace ): program arguments - - Returns: - bool: True to confirm, False to cancel/stop - """ - if not args.yes: - while True: - choice = input(f'{prompt} [y/n]: ') - choice = choice.lower() - print(choice) - if choice in ('y', 'n'): - break - - if choice == 'n': - return False - - return True - def write_file(fname, data): """Write data to a file @@ -344,155 +246,6 @@ def read_file(fname, as_lines=True, skip_unicode=False): print("Failed on file %s': %s" % (fname, e)) return None -def cleanup_empty_blocks(header_path, args): - """Clean up empty conditional blocks - - Args: - header_path (str): path to the cleaned file. - args (Namespace): program arguments - """ - pattern = re.compile(r'^\s*#\s*if.*$\n^\s*#\s*endif.*$\n*', flags=re.M) - data = read_file(header_path, as_lines=False, skip_unicode=True) - if data is None: - return - - new_data = pattern.sub('\n', data) - - show_diff(data.splitlines(True), new_data.splitlines(True), header_path, - args.color) - - if args.dry_run: - return - - if new_data != data: - write_file(header_path, new_data) - -def cleanup_one_header(header_path, patterns, args): - """Clean regex-matched lines away from a file. - - Args: - header_path: path to the cleaned file. - patterns: list of regex patterns. Any lines matching to these - patterns are deleted. - args (Namespace): program arguments - """ - lines = read_file(header_path, skip_unicode=True) - if lines is None: - return - - matched = [] - for i, line in enumerate(lines): - if i - 1 in matched and lines[i - 1].endswith('\\'): - matched.append(i) - continue - for pattern in patterns: - if pattern.search(line): - matched.append(i) - break - - if not matched: - return - - # remove empty #ifdef ... #endif, successive blank lines - pattern_if = re.compile(r'#\s*if(def|ndef)?\b') # #if, #ifdef, #ifndef - pattern_elif = re.compile(r'#\s*el(if|se)\b') # #elif, #else - pattern_endif = re.compile(r'#\s*endif\b') # #endif - pattern_blank = re.compile(r'^\s*$') # empty line - - while True: - old_matched = copy.copy(matched) - extend_matched_lines(lines, matched, [pattern_if], - [pattern_endif], True, True) - extend_matched_lines(lines, matched, [pattern_elif], - [pattern_elif, pattern_endif], True, False) - extend_matched_lines(lines, matched, [pattern_if, pattern_elif], - [pattern_blank], False, True) - extend_matched_lines(lines, matched, [pattern_blank], - [pattern_elif, pattern_endif], True, False) - extend_matched_lines(lines, matched, [pattern_blank], - [pattern_blank], True, False) - if matched == old_matched: - break - - tolines = copy.copy(lines) - - for i in reversed(matched): - tolines.pop(i) - - show_diff(lines, tolines, header_path, args.color) - - if args.dry_run: - return - - write_file(header_path, tolines) - -def cleanup_headers(configs, args): - """Delete config defines from board headers. - - Args: - configs: A list of CONFIGs to remove. - args (Namespace): program arguments - """ - if not confirm(args, 'Clean up headers?'): - return - - patterns = [] - for config in configs: - patterns.append(re.compile(r'#\s*define\s+%s\b' % config)) - patterns.append(re.compile(r'#\s*undef\s+%s\b' % config)) - - for dir in 'include', 'arch', 'board': - for (dirpath, dirnames, filenames) in os.walk(dir): - if dirpath == os.path.join('include', 'generated'): - continue - for filename in filenames: - if not filename.endswith(('~', '.dts', '.dtsi', '.bin', - '.elf','.aml','.dat')): - header_path = os.path.join(dirpath, filename) - # This file contains UTF-16 data and no CONFIG symbols - if header_path == 'include/video_font_data.h': - continue - cleanup_one_header(header_path, patterns, args) - cleanup_empty_blocks(header_path, args) - -def find_matching(patterns, line): - for pat in patterns: - if pat.search(line): - return True - return False - -def cleanup_readme(configs, args): - """Delete config description in README - - Args: - configs: A list of CONFIGs to remove. - args (Namespace): program arguments - """ - if not confirm(args, 'Clean up README?'): - return - - patterns = [] - for config in configs: - patterns.append(re.compile(r'^\s+%s' % config)) - - lines = read_file('README') - - found = False - newlines = [] - for line in lines: - if not found: - found = find_matching(patterns, line) - if found: - continue - - if found and re.search(r'^\s+CONFIG', line): - found = False - - if not found: - newlines.append(line) - - write_file('README', newlines) - def try_expand(line): """If value looks like an expression, try expanding it Otherwise just return the existing value @@ -2024,6 +1777,7 @@ doc/develop/moveconfig.rst for documentation.''' do_find_config(configs) return + # We are either building the database or forcing a sync of defconfigs config_db = {} db_queue = queue.Queue() t = DatabaseThread(config_db, db_queue) @@ -2035,13 +1789,9 @@ doc/develop/moveconfig.rst for documentation.''' toolchains = toolchain.Toolchains() toolchains.GetSettings() toolchains.Scan(verbose=False) - move_config(toolchains, configs, args, db_queue) + move_config(toolchains, [], args, db_queue) db_queue.join() - if configs: - cleanup_headers(configs, args) - cleanup_readme(configs, args) - if args.build_db: with open(CONFIG_DATABASE, 'w', encoding='utf-8') as fd: for defconfig, configs in config_db.items(): From patchwork Thu Aug 10 16:31:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819952 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=XGbjmjp6; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCCp223Pz1yfB for ; Fri, 11 Aug 2023 02:33:26 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E711C868DF; Thu, 10 Aug 2023 18:32:30 +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="XGbjmjp6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 70339868D7; Thu, 10 Aug 2023 18:32:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (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 2AE75868BC for ; Thu, 10 Aug 2023 18:32:26 +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-xd2a.google.com with SMTP id ca18e2360f4ac-79194701ce9so10337139f.1 for ; Thu, 10 Aug 2023 09:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685144; x=1692289944; 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=3wbqTOnyTEhfgXCXdzfF6s8MW1cTnuIwCmPuXbuN2l4=; b=XGbjmjp6zInohZhQG/7wuxtYzk/cwxBlwFgit0qLiAvrN3phl+H/K1zeYUngXz5+DO Visbfxs2+LM6TtHIr2my5xU4UlIpoEWbDhkElaYI/kOKD3tjAFxpPvAbuyYK7xzj+FS4 d/DlwYOkpUq1W2f3laex1waT4Uh2SDcO67HY0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685144; x=1692289944; 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=3wbqTOnyTEhfgXCXdzfF6s8MW1cTnuIwCmPuXbuN2l4=; b=Oyc40E07xLl0hqwZrgWFd/q/2k5pCaFuSy6u8bRFRCTstXnhNcCIqqrzBHY3SWZj4W oPdeFzU1duyV22BBNRzMbPyOnbkLrQcM9DIXPpqWhqPOTZxI1gFCRM5K6iKcIJffiYKC 5K+oZacx/BSj3POj2ZKkedmeUcKAUpptAWiF4X4GuN5CIUW6s83rcPyB8Cmz3E3rWb/7 2i1tvNRglzckHH3UUWUiJ9YOu3tdq5oqpA92O75xZbKsp2AR4YL39G1mzJsiAASUuXN8 WZim9w3HA/TLH+MACHZhreUSavT3IWYM1IkwBqCx26sh3KPaOUu67MSqByDA4jfve9Ae 11sA== X-Gm-Message-State: AOJu0YxoKBTW6pCmu8hIGfo6ns47hUp7hc4j0RuM/yJ+CrctXWWevbKZ zCAstUmDEGkPsgo6OpA7+B5rjt1+je5oAEbWBB0= X-Google-Smtp-Source: AGHT+IFYCqq1hnuSYap+0supaQ7JppRrQY9Bo8FxMVtbL8JxmPnN2DjP6mjCPbBDux4Iqzhx+nx77g== X-Received: by 2002:a6b:3105:0:b0:791:3791:527b with SMTP id j5-20020a6b3105000000b007913791527bmr3644599ioa.14.1691685144496; Thu, 10 Aug 2023 09:32:24 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:24 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 06/28] moveconfig: Drop CONFIG-moving code Date: Thu, 10 Aug 2023 10:31:38 -0600 Message-ID: <20230810163212.2368374-7-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 As a step towards cleaning out old code, drop most of the code that moves CONFIG options to Kconfig. This includes parse_one_config(). Drop the ACTION_... values as well, since they are no-longer used. Signed-off-by: Simon Glass --- tools/moveconfig.py | 163 ++++++-------------------------------------- 1 file changed, 19 insertions(+), 144 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 767aee39a79..b32a9002b18 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -42,11 +42,6 @@ STATE_DEFCONFIG = 1 STATE_AUTOCONF = 2 STATE_SAVEDEFCONFIG = 3 -ACTION_MOVE = 0 -ACTION_NO_ENTRY = 1 -ACTION_NO_ENTRY_WARN = 2 -ACTION_NO_CHANGE = 3 - COLOR_BLACK = '0;30' COLOR_RED = '0;31' COLOR_GREEN = '0;32' @@ -312,15 +307,13 @@ class KconfigParser: re_arch = re.compile(r'CONFIG_SYS_ARCH="(.*)"') re_cpu = re.compile(r'CONFIG_SYS_CPU="(.*)"') - def __init__(self, configs, args, build_dir): + def __init__(self, args, build_dir): """Create a new parser. Args: - configs: A list of CONFIGs to move. args (Namespace): program arguments build_dir: Build directory. """ - self.configs = configs self.args = args self.dotconfig = os.path.join(build_dir, '.config') self.autoconf = os.path.join(build_dir, 'include', 'autoconf.mk') @@ -355,56 +348,6 @@ class KconfigParser: return arch - def parse_one_config(self, config, dotconfig_lines, autoconf_lines): - """Parse .config, defconfig, include/autoconf.mk for one config. - - This function looks for the config options in the lines from - defconfig, .config, and include/autoconf.mk in order to decide - which action should be taken for this defconfig. - - Args: - config: CONFIG name to parse. - dotconfig_lines: lines from the .config file. - autoconf_lines: lines from the include/autoconf.mk file. - - Returns: - A tupple of the action for this defconfig and the line - matched for the config. - """ - not_set = '# %s is not set' % config - - for line in autoconf_lines: - line = line.rstrip() - if line.startswith(config + '='): - new_val = line - break - else: - new_val = not_set - - new_val = try_expand(new_val) - - for line in dotconfig_lines: - line = line.rstrip() - if line.startswith(config + '=') or line == not_set: - old_val = line - break - else: - if new_val == not_set: - return (ACTION_NO_ENTRY, config) - else: - return (ACTION_NO_ENTRY_WARN, config) - - # If this CONFIG is neither bool nor trisate - if old_val[-2:] != '=y' and old_val[-2:] != '=m' and old_val != not_set: - # tools/scripts/define2mk.sed changes '1' to 'y'. - # This is a problem if the CONFIG is int type. - # Check the type in Kconfig and handle it correctly. - if new_val[-2:] == '=y': - new_val = new_val[:-1] + '1' - - return (ACTION_NO_CHANGE if old_val == new_val else ACTION_MOVE, - new_val) - def update_dotconfig(self): """Parse files for the config options and update the .config. @@ -420,66 +363,17 @@ class KconfigParser: The "updated flag" is True if the .config was updated, False otherwise. The "log string" shows what happend to the .config. """ - - results = [] updated = False suspicious = False - rm_files = [self.config_autoconf, self.autoconf] - if self.args.spl: - if os.path.exists(self.spl_autoconf): - autoconf_path = self.spl_autoconf - rm_files.append(self.spl_autoconf) - else: - for f in rm_files: - os.remove(f) - return (updated, suspicious, - color_text(self.args.color, COLOR_BROWN, - "SPL is not enabled. Skipped.") + '\n') - else: - autoconf_path = self.autoconf + autoconf_path = self.autoconf dotconfig_lines = read_file(self.dotconfig) autoconf_lines = read_file(autoconf_path) - for config in self.configs: - result = self.parse_one_config(config, dotconfig_lines, - autoconf_lines) - results.append(result) - log = '' - for (action, value) in results: - if action == ACTION_MOVE: - actlog = "Move '%s'" % value - log_color = COLOR_LIGHT_GREEN - elif action == ACTION_NO_ENTRY: - actlog = '%s is not defined in Kconfig. Do nothing.' % value - log_color = COLOR_LIGHT_BLUE - elif action == ACTION_NO_ENTRY_WARN: - actlog = '%s is not defined in Kconfig (suspicious). Do nothing.' % value - log_color = COLOR_YELLOW - suspicious = True - elif action == ACTION_NO_CHANGE: - actlog = "'%s' is the same as the define in Kconfig. Do nothing." \ - % value - log_color = COLOR_LIGHT_PURPLE - else: - sys.exit('Internal Error. This should not happen.') - - log += color_text(self.args.color, log_color, actlog) + '\n' - - with open(self.dotconfig, 'a', encoding='utf-8') as out: - for (action, value) in results: - if action == ACTION_MOVE: - out.write(value + '\n') - updated = True - - self.results = results - for f in rm_files: - os.remove(f) - return (updated, suspicious, log) def check_defconfig(self): @@ -494,14 +388,6 @@ class KconfigParser: defconfig_lines = read_file(self.defconfig) - for (action, value) in self.results: - if action != ACTION_MOVE: - continue - if not value in defconfig_lines: - log += color_text(self.args.color, COLOR_YELLOW, - "'%s' was removed by savedefconfig.\n" % - value) - return log @@ -541,13 +427,12 @@ class Slot: for faster processing. """ - def __init__(self, toolchains, configs, args, progress, devnull, + def __init__(self, toolchains, args, progress, devnull, make_cmd, reference_src_dir, db_queue): """Create a new process slot. Args: toolchains: Toolchains object containing toolchains. - configs: A list of CONFIGs to move. args: Program arguments progress: A progress indicator. devnull: A file object of '/dev/null'. @@ -564,7 +449,7 @@ class Slot: self.make_cmd = (make_cmd, 'O=' + self.build_dir) self.reference_src_dir = reference_src_dir self.db_queue = db_queue - self.parser = KconfigParser(configs, args, self.build_dir) + self.parser = KconfigParser(args, self.build_dir) self.state = STATE_IDLE self.failed_boards = set() self.suspicious_boards = set() @@ -783,13 +668,11 @@ class Slots: """Controller of the array of subprocess slots.""" - def __init__(self, toolchains, configs, args, progress, - reference_src_dir, db_queue): + def __init__(self, toolchains, args, progress, reference_src_dir, db_queue): """Create a new slots controller. Args: toolchains: Toolchains object containing toolchains. - configs: A list of CONFIGs to move. args: Program arguments progress: A progress indicator. reference_src_dir: Determine the true starting config state from this @@ -801,9 +684,8 @@ class Slots: devnull = subprocess.DEVNULL make_cmd = get_make_cmd() for i in range(args.jobs): - self.slots.append(Slot(toolchains, configs, args, progress, - devnull, make_cmd, reference_src_dir, - db_queue)) + self.slots.append(Slot(toolchains, args, progress, devnull, + make_cmd, reference_src_dir, db_queue)) def add(self, defconfig): """Add a new subprocess if a vacant slot is found. @@ -913,22 +795,18 @@ class ReferenceSource: return self.src_dir -def move_config(toolchains, configs, args, db_queue): - """Move config options to defconfig files. +def move_config(toolchains, args, db_queue): + """Build database or sync config options to defconfig files. Args: - configs: A list of CONFIGs to move. + toolchains: Toolchains to use args: Program arguments + db_queue: Queue for database updates """ - if len(configs) == 0: - if args.force_sync: - print('No CONFIG is specified. You are probably syncing defconfigs.', end=' ') - elif args.build_db: - print('Building %s database' % CONFIG_DATABASE) - else: - print('Neither CONFIG nor --force-sync is specified. Nothing will happen.', end=' ') - else: - print('Move ' + ', '.join(configs), end=' ') + if args.force_sync: + print('Syncing defconfigs', end=' ') + elif args.build_db: + print('Building %s database' % CONFIG_DATABASE) print('(jobs: %d)\n' % args.jobs) if args.git_ref: @@ -943,8 +821,7 @@ def move_config(toolchains, configs, args, db_queue): defconfigs = get_all_defconfigs() progress = Progress(len(defconfigs)) - slots = Slots(toolchains, configs, args, progress, reference_src_dir, - db_queue) + slots = Slots(toolchains, args, progress, reference_src_dir, db_queue) # Main loop to process defconfig files: # Add a new subprocess into a vacant slot. @@ -1729,7 +1606,6 @@ doc/develop/moveconfig.rst for documentation.''' parser.add_argument('configs', nargs='*') args = parser.parse_args() - configs = args.configs if args.test: sys.argv = [sys.argv[0]] @@ -1742,13 +1618,12 @@ doc/develop/moveconfig.rst for documentation.''' do_scan_source(os.getcwd(), args.update) return - if not any((len(configs), args.force_sync, args.build_db, args.imply, - args.find)): + if not any((args.force_sync, args.build_db, args.imply, args.find)): parser.print_usage() sys.exit(1) # prefix the option name with CONFIG_ if missing - configs = [prefix_config(cfg) for cfg in configs] + configs = [prefix_config(cfg) for cfg in args.configs] check_top_directory() @@ -1789,7 +1664,7 @@ doc/develop/moveconfig.rst for documentation.''' toolchains = toolchain.Toolchains() toolchains.GetSettings() toolchains.Scan(verbose=False) - move_config(toolchains, [], args, db_queue) + move_config(toolchains, args, db_queue) db_queue.join() if args.build_db: From patchwork Thu Aug 10 16:31:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819953 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=OZA3CwKo; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCD10YTXz1yfB for ; Fri, 11 Aug 2023 02:33:37 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 38658868EC; Thu, 10 Aug 2023 18:32:31 +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="OZA3CwKo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3C1E7868D8; Thu, 10 Aug 2023 18:32:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (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 81C5E86851 for ; Thu, 10 Aug 2023 18:32:26 +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-il1-x132.google.com with SMTP id e9e14a558f8ab-34978cc9e53so3935805ab.2 for ; Thu, 10 Aug 2023 09:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685145; x=1692289945; 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=HNdECsJMXLXnIj3IBa994c6pZ7Je8x3s2gJaScMo/sU=; b=OZA3CwKo0LVqRJ3/1MGMKAII7CQsPe6Wbch0dhaarykSJg7XPn0Ve+01KqEfsyl1N6 /xIOZ5sMjULuJnCdoRVqdbxJes/vyp6wjk3i+bQc/urttlzYUAsRSVBsDmCK7qXX82Gt CQSUq6MZKoc5EHkYNxWuYCNjHTIBXq/8kzvkA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685145; x=1692289945; 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=HNdECsJMXLXnIj3IBa994c6pZ7Je8x3s2gJaScMo/sU=; b=O1c6Bh0Xwf4X5wb+oY4OOOkq4tvPrNJ0Di6m3h+7mVKmqguPY7tVRI2pSY3Ezd9SFy cA0oef6ksSp9iVsBd6btzg44pqHhJaHvTCt+Y+C8YsZD2BVJ0UGAgbBuZEVmdKwwbkEs vFZENKhbDmMPGoOPHrwxXD2SGlM+p1/gTvvCQmkYg3ZAqEU4HqAYdP/Vp7h55lJcnK3n wH+YNe5TMCuM09LPSVg1vf3XBKgcXSIQFEq5q9wrk+3DPORnQWgMbO0cNSTzejyO2ANJ biP6w6b5qZkAxrI4El18owP29G9jtguhCpSbGiK5vnHpMz9xenZx82OrAJVoCxOH3Fd4 2jAQ== X-Gm-Message-State: AOJu0YzaeC1uh3DkRwYkc+n1TkQSqCuVnvhGJA/k3qofBeKE/DDCmiZj fH/dvC64dUskWUrrCOhXl7tQj4Wx+IUW2yvOl9c= X-Google-Smtp-Source: AGHT+IGoq+SqHqkK5BPVFJLuGvG601HiezI+MP9RL9m83sHNHA9sr1L2crxwEn9sq/+UTePRpLi3WQ== X-Received: by 2002:a92:c203:0:b0:345:a319:ba83 with SMTP id j3-20020a92c203000000b00345a319ba83mr3249745ilo.29.1691685145188; Thu, 10 Aug 2023 09:32:25 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:25 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 07/28] moveconfig: Drop check_defconfig() and update_dotconfig() Date: Thu, 10 Aug 2023 10:31:39 -0600 Message-ID: <20230810163212.2368374-8-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 These functions are not needed anymore. Drop them. Signed-off-by: Simon Glass --- tools/moveconfig.py | 62 ++------------------------------------------- 1 file changed, 2 insertions(+), 60 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index b32a9002b18..4f9bea0827f 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -348,48 +348,6 @@ class KconfigParser: return arch - def update_dotconfig(self): - """Parse files for the config options and update the .config. - - This function parses the generated .config and include/autoconf.mk - searching the target options. - Move the config option(s) to the .config as needed. - - Args: - defconfig: defconfig name. - - Returns: - Return a tuple of (updated flag, log string). - The "updated flag" is True if the .config was updated, False - otherwise. The "log string" shows what happend to the .config. - """ - updated = False - suspicious = False - - autoconf_path = self.autoconf - - dotconfig_lines = read_file(self.dotconfig) - - autoconf_lines = read_file(autoconf_path) - - log = '' - - return (updated, suspicious, log) - - def check_defconfig(self): - """Check the defconfig after savedefconfig - - Returns: - Return additional log if moved CONFIGs were removed again by - 'make savedefconfig'. - """ - - log = '' - - defconfig_lines = read_file(self.defconfig) - - return log - class DatabaseThread(threading.Thread): """This thread processes results from Slot threads. @@ -452,7 +410,6 @@ class Slot: self.parser = KconfigParser(args, self.build_dir) self.state = STATE_IDLE self.failed_boards = set() - self.suspicious_boards = set() def __del__(self): """Delete the working directory @@ -588,20 +545,10 @@ class Slot: def do_savedefconfig(self): """Update the .config and run 'make savedefconfig'.""" - - (updated, suspicious, log) = self.parser.update_dotconfig() - if suspicious: - self.suspicious_boards.add(self.defconfig) - self.log += log - - if not self.args.force_sync and not updated: + if not self.args.force_sync: self.finish(True) return - if updated: - self.log += color_text(self.args.color, COLOR_LIGHT_GREEN, - 'Syncing by savedefconfig...\n') - else: - self.log += 'Syncing by savedefconfig (forced by option)...\n' + self.log += 'Syncing by savedefconfig (forced by option)...\n' cmd = list(self.make_cmd) cmd.append('savedefconfig') @@ -611,11 +558,6 @@ class Slot: def update_defconfig(self): """Update the input defconfig and go back to the idle state.""" - - log = self.parser.check_defconfig() - if log: - self.suspicious_boards.add(self.defconfig) - self.log += log orig_defconfig = os.path.join('configs', self.defconfig) new_defconfig = os.path.join(self.build_dir, 'defconfig') updated = not filecmp.cmp(orig_defconfig, new_defconfig) From patchwork Thu Aug 10 16:31:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819954 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=kam9umkb; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCDC3NTtz1yfB for ; Fri, 11 Aug 2023 02:33:47 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7EEE2868F1; Thu, 10 Aug 2023 18:32:31 +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="kam9umkb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D3B41868CB; Thu, 10 Aug 2023 18:32:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) (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 61B70868D3 for ; Thu, 10 Aug 2023 18:32:27 +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-il1-x134.google.com with SMTP id e9e14a558f8ab-34994cad252so1705295ab.2 for ; Thu, 10 Aug 2023 09:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685146; x=1692289946; 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=LZjglUxs+GLXkiqHXRQai/X3R6mZ1qDzBLg/H/eIO6Q=; b=kam9umkbBj8U3/1Ht0IH+C3WU8Jp/EeSL7bUn72KR6vwvFO4pdTQ6RhphV44byLqcG AMLmCwiuEi/04/r8Ycv4+LVTvQav0Nc/kaUAstD7TWrZ4cdccC4L9X3VSBlPSMKIw3p2 ih0vjGbvLxxdBk5HatJuJsFlvOHFvbgQJ3eJo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685146; x=1692289946; 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=LZjglUxs+GLXkiqHXRQai/X3R6mZ1qDzBLg/H/eIO6Q=; b=JLHL25bomp7jzMc9wUnbYsahld0P/2Gvef5sf1I3LXSZewQ4v0tGcm95UaCbHbl0FN +M4s1J/ujKpx7z5zGZVyomRcCQnIvr5cji0fruPx0SKN818fxwg8owFUhi6bpuTUeIvK 3+f2uuqqqTuapzuTNmwJ46rOw0N7wyDQw1tnc2oFDekZbcztF8hlQPIys2O++7SKdIF2 Kiuxnxk7bVrnE0cyfPyhBaaXr4ecWF8tB2qOmgH0rnkgwt/4YaDFA3L2WYen4fyES9Wp wZHP+MCJAQaH6lb2VOQ9oLje3/yg+kPlECtCN7l8gNp5YJVfhSkCVnuB/aqplCazcUEq biUw== X-Gm-Message-State: AOJu0YyZOxNU50dkD+b9xhWFNRpenayJEOLvlNKG2OM+sbyQjbKJVt6b NCWxQ+2Oi4NvqYQDBvOpF+EH5Tj3FFY9ZSVX5uY= X-Google-Smtp-Source: AGHT+IEtLqTNqifwzSId5vUbHiCvbXD+/ZFHlaYn3ycntewGW46j31GdglXSt6Z+ZTyaPZ1sv99Wnw== X-Received: by 2002:a05:6e02:1241:b0:349:77e2:1414 with SMTP id j1-20020a056e02124100b0034977e21414mr2656769ilq.32.1691685146014; Thu, 10 Aug 2023 09:32:26 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:25 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 08/28] moveconfig: Drop suspicious boards Date: Thu, 10 Aug 2023 10:31:40 -0600 Message-ID: <20230810163212.2368374-9-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 This code isn't needed anymore. Drop it. Signed-off-by: Simon Glass --- tools/moveconfig.py | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 4f9bea0827f..45b86cb1db5 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -601,11 +601,6 @@ class Slot: """ return self.failed_boards - def get_suspicious_boards(self): - """Returns a set of boards (defconfigs) with possible misconversion. - """ - return self.suspicious_boards - self.failed_boards - class Slots: """Controller of the array of subprocess slots.""" @@ -684,25 +679,6 @@ class Slots: write_file(output_file, boards) - def show_suspicious_boards(self): - """Display all boards (defconfigs) with possible misconversion.""" - boards = set() - output_file = 'moveconfig.suspicious' - - for slot in self.slots: - boards |= slot.get_suspicious_boards() - - if boards: - boards = '\n'.join(boards) + '\n' - msg = 'The following boards might have been converted incorrectly.\n' - msg += 'It is highly recommended to check them manually:\n' - msg += boards - msg += '(the list has been saved in %s)\n' % output_file - print(color_text(self.args.color, COLOR_YELLOW, - msg), file=sys.stderr) - - write_file(output_file, boards) - class ReferenceSource: """Reference source against which original configs should be parsed.""" @@ -780,7 +756,6 @@ def move_config(toolchains, args, db_queue): print('') slots.show_failed_boards() - slots.show_suspicious_boards() def find_kconfig_rules(kconf, config, imply_config): """Check whether a config has a 'select' or 'imply' keyword From patchwork Thu Aug 10 16:31:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819955 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=IoKg3i50; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCDR03g1z1yfB for ; Fri, 11 Aug 2023 02:33:59 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C84B986851; Thu, 10 Aug 2023 18:32:33 +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="IoKg3i50"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 391FC866B5; Thu, 10 Aug 2023 18:32:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (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 300668666E for ; Thu, 10 Aug 2023 18:32:28 +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-xd29.google.com with SMTP id ca18e2360f4ac-76c64da0e46so35775039f.0 for ; Thu, 10 Aug 2023 09:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685147; x=1692289947; 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=h1So9sAu7+YW7O4a4siYrM7pAzQBpeeSIB/YArgFsXA=; b=IoKg3i50d7I9Off4CFtJz2oGyz6OdoAE3Xb07R8hGvlKkc6Cks2m0JSAJQZ69UTpxF fbLroaKRl+jUgS9SMrBDukTTo/W+ATbC/HMhj0GvrG7wy1auMV23iqvq2HEvaf3lqOnJ 9ieQ1QR1ycI3F+R4PdNfR1i6xFIZSqTloMlBw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685147; x=1692289947; 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=h1So9sAu7+YW7O4a4siYrM7pAzQBpeeSIB/YArgFsXA=; b=JtKDNgZ+bAc7yM1gF3E5x0O1i+5uC0BxrC+ytG3snvsmaNMmk7okKuNwrquq/SCcqA lyYFcDxL44COOBi23i8bUSkKQKhI8SpZa/+A0AWwSnDJ9Ws2krwqVrmJN2Co6oTeZbpx RfpnD4KH2ByyOCyHSIcC9hSbWgezsNbTo4UjNBH+zba2fyibyMQxtjQG+sMrVhLczcaX +CmOoxjLi9wVmLPSyKxrtGEZMDn32Iq+bUXXRvjjJvlhlZSF2VGEXK+SDxIXcHAX6ic5 vT66grqqJiiLNn+abY8YI24Lbk7J1sQvU5j9grt0kvOX5ikoJ3gX+pm8lmGzbE74l+Xa 5mvQ== X-Gm-Message-State: AOJu0YzsAabA9mO5i9VobpVDSdo/6jrr5iXr85lqepBrmpvDwwAjmXxt BnI4zmxqDnAvkeoTFeG3sl/DEn8Sb6pa39iWGNs= X-Google-Smtp-Source: AGHT+IEB2fShj0dktC5H2LHKeQ1/MfjnLkQYE7EDGRjI2LiP/i0laSU7dkgGLexxJzD9OAdJQdsskg== X-Received: by 2002:a6b:f20a:0:b0:787:1cfc:5423 with SMTP id q10-20020a6bf20a000000b007871cfc5423mr3814623ioh.16.1691685146790; Thu, 10 Aug 2023 09:32:26 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:26 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 09/28] moveconfig: Correct some regular-expression strings Date: Thu, 10 Aug 2023 10:31:41 -0600 Message-ID: <20230810163212.2368374-10-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Use the 'r' prefix for these strings to avoid pylint warnings. Signed-off-by: Simon Glass --- tools/moveconfig.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 45b86cb1db5..a282ae90d05 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -1153,10 +1153,10 @@ def prefix_config(cfg): return op + cfg -RE_MK_CONFIGS = re.compile('CONFIG_(\$\(SPL_(?:TPL_)?\))?([A-Za-z0-9_]*)') -RE_IFDEF = re.compile('(ifdef|ifndef)') -RE_C_CONFIGS = re.compile('CONFIG_([A-Za-z0-9_]*)') -RE_CONFIG_IS = re.compile('CONFIG_IS_ENABLED\(([A-Za-z0-9_]*)\)') +RE_MK_CONFIGS = re.compile(r'CONFIG_(\$\(SPL_(?:TPL_)?\))?([A-Za-z0-9_]*)') +RE_IFDEF = re.compile(r'(ifdef|ifndef)') +RE_C_CONFIGS = re.compile(r'CONFIG_([A-Za-z0-9_]*)') +RE_CONFIG_IS = re.compile(r'CONFIG_IS_ENABLED\(([A-Za-z0-9_]*)\)') class ConfigUse: def __init__(self, cfg, is_spl, fname, rest): From patchwork Thu Aug 10 16:31:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819957 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=aRIfZFHt; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCDg1PdKz1yfB for ; Fri, 11 Aug 2023 02:34:11 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 18F7686904; Thu, 10 Aug 2023 18:32:34 +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="aRIfZFHt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 305CA868E6; Thu, 10 Aug 2023 18:32:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) (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 116A5868D7 for ; Thu, 10 Aug 2023 18:32:29 +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-il1-x133.google.com with SMTP id e9e14a558f8ab-34914684b62so3967375ab.3 for ; Thu, 10 Aug 2023 09:32:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685147; x=1692289947; 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=63YDcrhb53IiI7Mr+NHXsPju2fq1vMQTwMaDZqYCxxk=; b=aRIfZFHtU5SMNDG7W+wALP4BU2jleXgDPw3RduOTb6+cpWwFAKqzUifUevPzufYCML SFRj5eaNDKm7IYaAYLMmZmRgAgW6rKHbeU1sHMSZY5A+u/VMxz6jTGckRbRsUgxUHPe6 OmIFXYKYwO3ZFuvVOOEe6tftdlIoD2whvJ3Uk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685147; x=1692289947; 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=63YDcrhb53IiI7Mr+NHXsPju2fq1vMQTwMaDZqYCxxk=; b=ZWBP7Wi46vIgUJTf06y713NPJOwIQjjfe3RygxRcTCWQtDz4+nQVxFUiz9DKY705Ym Exj2WBW0KMAOdmsBdVaInhPBwWOpujO5su/6uqA1KnrMkYH4sYUK/VEIVAAejff1BW2y G+euX/PzNtM51toPsnFwnkF0KJVvAqvttpPC78eb2Szsd95cWeiw4osg5Io3h+bsdm83 o5wb6uJQUN3C93nU3fgCx4EGsCzo3oHhehVtgFMwVrDf0kBohRy850AEonqFxBxEw3ZH curqlnlpMP1BRX6N1Vemo+4MCw4BAfvo6z6LctWRnQ18xvn6nusKIXf2Tl9DZrnGx886 1nug== X-Gm-Message-State: AOJu0Yx7cNvsXKEHdutl95HEQh1fklRT6su7c+dKYwYV+5d8ui0fdu5O Dfz52EK3MuK4T8YCqnX28IGiOYbdcGhYmRfsY1E= X-Google-Smtp-Source: AGHT+IGCoMNVpPFA5EGlIjcXVN0LB5zWtCI5tq60FMx3fR99QOsb1sx7AkLgMRbTCa95C6lcQ6nf9w== X-Received: by 2002:a05:6e02:1252:b0:348:d5fc:fed with SMTP id j18-20020a056e02125200b00348d5fc0fedmr3088709ilq.32.1691685147650; Thu, 10 Aug 2023 09:32:27 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:27 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 10/28] moveconfig: Correct parameter-type warnings Date: Thu, 10 Aug 2023 10:31:42 -0600 Message-ID: <20230810163212.2368374-11-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Fix pylint warnings related to parameter types. Signed-off-by: Simon Glass --- tools/moveconfig.py | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index a282ae90d05..54ce8ef7d51 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -218,7 +218,7 @@ def read_file(fname, as_lines=True, skip_unicode=False): Args: fname (str): Filename to read from - as_lines: Return file contents as a list of lines + as_lines (bool): Return file contents as a list of lines skip_unicode (bool): True to report unicode errors and continue Returns: @@ -434,7 +434,7 @@ class Slot: the slot is occupied (i.e. the current subprocess is still running). Args: - defconfig: defconfig name. + defconfig (str): defconfig name. Returns: Return True on success or False on failure @@ -574,7 +574,7 @@ class Slot: """Display log along with progress and go to the idle state. Args: - success: Should be True when the defconfig was processed + success (bool): Should be True when the defconfig was processed successfully, or False when it fails. """ # output at least 30 characters to hide the "* defconfigs out of *". @@ -628,7 +628,7 @@ class Slots: """Add a new subprocess if a vacant slot is found. Args: - defconfig: defconfig name to be put into. + defconfig (str): defconfig name to be put into. Returns: Return True on success or False on failure @@ -717,9 +717,9 @@ def move_config(toolchains, args, db_queue): """Build database or sync config options to defconfig files. Args: - toolchains: Toolchains to use - args: Program arguments - db_queue: Queue for database updates + toolchains (Toolchains): Toolchains to use + args (Namespace): Program arguments + db_queue (Queue): Queue for database updates """ if args.force_sync: print('Syncing defconfigs', end=' ') @@ -761,10 +761,10 @@ def find_kconfig_rules(kconf, config, imply_config): """Check whether a config has a 'select' or 'imply' keyword Args: - kconf: Kconfiglib.Kconfig object - config: Name of config to check (without CONFIG_ prefix) - imply_config: Implying config (without CONFIG_ prefix) which may or - may not have an 'imply' for 'config') + kconf (Kconfiglib.Kconfig): Kconfig object + config (str): Name of config to check (without CONFIG_ prefix) + imply_config (str): Implying config (without CONFIG_ prefix) which may + or may not have an 'imply' for 'config') Returns: Symbol object for 'config' if found, else None @@ -783,16 +783,17 @@ def check_imply_rule(kconf, config, imply_config): to add an 'imply' for 'config' to that part of the Kconfig. Args: - kconf: Kconfiglib.Kconfig object - config: Name of config to check (without CONFIG_ prefix) - imply_config: Implying config (without CONFIG_ prefix) which may or - may not have an 'imply' for 'config') + kconf (Kconfiglib.Kconfig): Kconfig object + config (str): Name of config to check (without CONFIG_ prefix) + imply_config (str): Implying config (without CONFIG_ prefix) which may + or may not have an 'imply' for 'config') Returns: tuple: - filename of Kconfig file containing imply_config, or None if none - line number within the Kconfig file, or 0 if none - message indicating the result + str: filename of Kconfig file containing imply_config, or None if + none + int: line number within the Kconfig file, or 0 if none + str: message indicating the result """ sym = kconf.syms.get(imply_config) if not sym: @@ -815,9 +816,9 @@ def add_imply_rule(config, fname, linenum): """Add a new 'imply' option to a Kconfig Args: - config: config option to add an imply for (without CONFIG_ prefix) - fname: Kconfig filename to update - linenum: Line number to place the 'imply' before + config (str): config option to add an imply for (without CONFIG_ prefix) + fname (str): Kconfig filename to update + linenum (int): Line number to place the 'imply' before Returns: Message indicating the result From patchwork Thu Aug 10 16:31:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819958 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=hxYyxjgN; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCDt4yn7z1yfB for ; Fri, 11 Aug 2023 02:34:22 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5EB1D86919; Thu, 10 Aug 2023 18:32:34 +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="hxYyxjgN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8187486902; Thu, 10 Aug 2023 18:32:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) (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 446798666E for ; Thu, 10 Aug 2023 18:32:30 +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-oa1-x2d.google.com with SMTP id 586e51a60fabf-1bbafe6fd8fso994452fac.3 for ; Thu, 10 Aug 2023 09:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685149; x=1692289949; 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=lFPgYzeE1ag9E33pUJatJqBI5an7VebeKfBFRhmkKHU=; b=hxYyxjgNqX2a0PrKvzdbipiwXj7ypXcJ/wWZoBmrBexI2ht/O40zdXPnMlXSHd1udl cjQDsZcEW2WiVV0OsDSmT8jQMFMKHPMYijTrzeRY+LG2jH1FC5jBrYFMY0JPi08NjhCz RtB3dJfkKnM0jcX1kXyYM6BEF6Qwf42oEsFIY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685149; x=1692289949; 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=lFPgYzeE1ag9E33pUJatJqBI5an7VebeKfBFRhmkKHU=; b=BcVmQ8OvPvYiCzazwxyYxZvML006OAO3uFUcIDjyPeW+akhGLLq18kjBpgiYRwgg6a S+lTCjyobK/vc3qvle517FCCN1NmuRUBME6J2HQrtHJgaunH/Ehy8TNDXqjybQ9GmWHD uwX9hjgO39GER5YxKOi6H9b8217sQB1lJ7jqqHbNlhigkfKmbmxPC0wOAhmDC/Rk3fgI F7UKaZsi6ll45zl02LpZqUuP0atOIo7QkXE6LjlJobzA8GTumTdJxG6kDj/xHiV3sZ+J zd58gaD5Y2mkC0kJ3HB33nBzVl6UoGn+Bpq51GFQPBmNHPSMtD/lOVbVsq8CRgqVTtdk fZOA== X-Gm-Message-State: AOJu0YxVIlD1ZyE9GnStLzOnfLEndzLWXQjLOXBtpLCE+ZPYZO/wkoss tiSrnkYOZNmztmsrK0vNSwjiNvmiaHUPG5ufgrk= X-Google-Smtp-Source: AGHT+IG+lLoPTvs3DOOeZ/ePm2ejf775O8V36xusKducIoPqK31NJoVF0FBmqDhH4R3PEbXJex19vg== X-Received: by 2002:a05:6870:148f:b0:1c0:25c0:ebe5 with SMTP id k15-20020a056870148f00b001c025c0ebe5mr3736136oab.53.1691685148683; Thu, 10 Aug 2023 09:32:28 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:28 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 11/28] moveconfig: Use f strings where possible Date: Thu, 10 Aug 2023 10:31:43 -0600 Message-ID: <20230810163212.2368374-12-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Avoid pylint warnings by using 'f' strings where possible. Signed-off-by: Simon Glass --- tools/moveconfig.py | 56 ++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 54ce8ef7d51..cc35c4bce9d 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -238,7 +238,7 @@ def read_file(fname, as_lines=True, skip_unicode=False): except UnicodeDecodeError as e: if not skip_unicode: raise - print("Failed on file %s': %s" % (fname, e)) + print(f"Failed on file '{fname}: {e}") return None def try_expand(line): @@ -254,10 +254,10 @@ def try_expand(line): val= val.strip('\"') if re.search(r'[*+-/]|<<|SZ_+|\(([^\)]+)\)', val): newval = hex(aeval(val)) - print('\tExpanded expression %s to %s' % (val, newval)) + print(f'\tExpanded expression {val} to {newval}') return cfg+'='+newval except: - print('\tFailed to expand expression in %s' % line) + print(f'\tFailed to expand expression in {line}') return line @@ -283,7 +283,7 @@ class Progress: def show(self): """Display the progress.""" - print(' %d defconfigs out of %d\r' % (self.current, self.total), end=' ') + print(f' {self.current} defconfigs out of {self.total}\r', end=' ') sys.stdout.flush() @@ -520,7 +520,7 @@ class Slot: toolchain = self.toolchains.Select(arch) except ValueError: self.log += color_text(self.args.color, COLOR_YELLOW, - "Tool chain for '%s' is missing. Do nothing.\n" % arch) + f"Tool chain for '{arch}' is missing. Do nothing.\n") self.finish(False) return env = toolchain.MakeEnvironment(False) @@ -673,7 +673,7 @@ class Slots: boards = '\n'.join(boards) + '\n' msg = 'The following boards were not processed due to error:\n' msg += boards - msg += '(the list has been saved in %s)\n' % output_file + msg += f'(the list has been saved in {output_file})\n' print(color_text(self.args.color, COLOR_LIGHT_RED, msg), file=sys.stderr) @@ -693,8 +693,9 @@ class ReferenceSource: print('Cloning git repo to a separate work directory...') subprocess.check_output(['git', 'clone', os.getcwd(), '.'], cwd=self.src_dir) - print("Checkout '%s' to build the original autoconf.mk." % \ - subprocess.check_output(['git', 'rev-parse', '--short', commit]).strip()) + rev = subprocess.check_output(['git', 'rev-parse', '--short', + commit]).strip() + print(f"Checkout '{rev}' to build the original autoconf.mk.") subprocess.check_output(['git', 'checkout', commit], stderr=subprocess.STDOUT, cwd=self.src_dir) @@ -724,8 +725,8 @@ def move_config(toolchains, args, db_queue): if args.force_sync: print('Syncing defconfigs', end=' ') elif args.build_db: - print('Building %s database' % CONFIG_DATABASE) - print('(jobs: %d)\n' % args.jobs) + print(f'Building {CONFIG_DATABASE} database') + print(f'(jobs: {args.jobs})\n') if args.git_ref: reference_src = ReferenceSource(args.git_ref) @@ -800,17 +801,17 @@ def check_imply_rule(kconf, config, imply_config): return 'cannot find sym' nodes = sym.nodes if len(nodes) != 1: - return '%d locations' % len(nodes) + return f'{len(nodes)} locations' node = nodes[0] fname, linenum = node.filename, node.linenr cwd = os.getcwd() if cwd and fname.startswith(cwd): fname = fname[len(cwd) + 1:] - file_line = ' at %s:%d' % (fname, linenum) + file_line = f' at {fname}:{linenum}' data = read_file(fname) - if data[linenum - 1] != 'config %s' % imply_config: - return None, 0, 'bad sym format %s%s' % (data[linenum], file_line) - return fname, linenum, 'adding%s' % file_line + if data[linenum - 1] != f'config {imply_config}': + return None, 0, f'bad sym format {data[linenum]}{file_line})' + return fname, linenum, f'adding{file_line}' def add_imply_rule(config, fname, linenum): """Add a new 'imply' option to a Kconfig @@ -823,15 +824,15 @@ def add_imply_rule(config, fname, linenum): Returns: Message indicating the result """ - file_line = ' at %s:%d' % (fname, linenum) + file_line = f' at {fname}:{linenum}' data = read_file(fname) linenum -= 1 for offset, line in enumerate(data[linenum:]): if line.strip().startswith('help') or not line: - data.insert(linenum + offset, '\timply %s' % config) + data.insert(linenum + offset, f'\timply {config}') write_file(fname, data) - return 'added%s' % file_line + return f'added{file_line}' return 'could not insert%s' @@ -946,15 +947,14 @@ def do_imply_config(config_list, add_imply, imply_flags, skip_added, for config in config_list: defconfigs = defconfig_db.get(config) if not defconfigs: - print('%s not found in any defconfig' % config) + print(f'{config} not found in any defconfig') continue # Get the set of defconfigs without this one (since a config cannot # imply itself) non_defconfigs = all_defconfigs - defconfigs num_defconfigs = len(defconfigs) - print('%s found in %d/%d defconfigs' % (config, num_defconfigs, - len(all_configs))) + print(f'{config} found in {num_defconfigs}/{len(all_configs)} defconfigs') # This will hold the results: key=config, value=defconfigs containing it imply_configs = {} @@ -1035,7 +1035,7 @@ def do_imply_config(config_list, add_imply, imply_flags, skip_added, fname, linenum = nodes[0].filename, nodes[0].linenr if cwd and fname.startswith(cwd): fname = fname[len(cwd) + 1:] - kconfig_info = '%s:%d' % (fname, linenum) + kconfig_info = f'{fname}:{linenum}' if skip_added: show = False else: @@ -1061,8 +1061,8 @@ def do_imply_config(config_list, add_imply, imply_flags, skip_added, add_list[fname].append(linenum) if show and kconfig_info != 'skip': - print('%5d : %-30s%-25s %s' % (num_common, iconfig.ljust(30), - kconfig_info, missing_str)) + print(f'{num_common:5d} : ' + f'{iconfig.ljust(30):-30s}{kconfig_info:-25s} {missing_str}') # Having collected a list of things to add, now we add them. We process # each file from the largest line number to the smallest so that @@ -1554,11 +1554,11 @@ doc/develop/moveconfig.rst for documentation.''' for flag in args.imply_flags.split(','): bad = flag not in IMPLY_FLAGS if bad: - print("Invalid flag '%s'" % flag) + print(f"Invalid flag '{flag}'") if flag == 'help' or bad: print("Imply flags: (separate with ',')") for name, info in IMPLY_FLAGS.items(): - print(' %-15s: %s' % (name, info[1])) + print(f' {name:-15s}: {info[1]}') parser.print_usage() sys.exit(1) imply_flags |= IMPLY_FLAGS[flag][0] @@ -1588,9 +1588,9 @@ doc/develop/moveconfig.rst for documentation.''' if args.build_db: with open(CONFIG_DATABASE, 'w', encoding='utf-8') as fd: for defconfig, configs in config_db.items(): - fd.write('%s\n' % defconfig) + fd.write(f'{defconfig}\n') for config in sorted(configs.keys()): - fd.write(' %s=%s\n' % (config, configs[config])) + fd.write(f' {config}={configs[config]}\n') fd.write('\n') if __name__ == '__main__': From patchwork Thu Aug 10 16:31:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819959 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Qf8lgMwn; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCF61yfJz1yfB for ; Fri, 11 Aug 2023 02:34:34 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9E8D78691E; Thu, 10 Aug 2023 18:32:34 +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="Qf8lgMwn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 45B68867D0; Thu, 10 Aug 2023 18:32:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) (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 24433868BB for ; Thu, 10 Aug 2023 18:32:31 +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-il1-x12d.google.com with SMTP id e9e14a558f8ab-34995e5b4bfso1645735ab.1 for ; Thu, 10 Aug 2023 09:32:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685149; x=1692289949; 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=oo4YSQGppuq29LbLOMdht4HDyrJxIP7Xa0+KZE7BtJI=; b=Qf8lgMwnabYNiKgQ+cEesaU5Pk23ii/NXA29UyxyidAov8JoyJd0XGn/WiMdBOdkyf pteUr7NxnkiHnha+buUQgLj2VI0TS7yNI7otp+U+jHvew+ST1PKizYra8Edp1tqbLzUh GFvpgtiQuTa7FoUSAYZX5ematEc4wRn5asAl0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685149; x=1692289949; 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=oo4YSQGppuq29LbLOMdht4HDyrJxIP7Xa0+KZE7BtJI=; b=jJBBnrw4CFfMfr2TcBrPBEQZuxpAbHM/Ay70toawqsHSspACPPEzfFgfjkYbqHApvR cNhHn/5ReP3h01bKqnllQ6Xk+531Yjq87iV/Pp6AsyjtNBaogCMNHfMVRhj7laDRi4OH Mfhm5jhgFwFkjhxQ53/9Jjgd7qgaCsu/4jOFr3xEGmZWcB9ky5N9JhBnY+hzmEUGfGs0 kIf+omK7j8QnTf5OfNcb7Fc4BSEpTYN+z0zakob58E/40lc5rMtwouBRMPfDNxIvqfS3 nR2m4VsB+wLNVFAE5K5PHJHkuD3PVI5aryKA1wVwPJuy5N6XV0DM91qqVIXEsL8ANNun N21A== X-Gm-Message-State: AOJu0Yz3EtOqYj0fzG0ILQ9hD2UhM6/wilpMivNGcHw4+Q9lvCQlHiz+ 9u9+Fpc2+EByqL9SOkeA8fVrJKuJl9zFAUS+p5s= X-Google-Smtp-Source: AGHT+IHFmDccdzV43eOtIPkZXVU0jIKzkyctOrMJmNOUyunwbrz37J/q1c1bCgrztgiwME8u2eFzcg== X-Received: by 2002:a92:cd81:0:b0:349:785:adad with SMTP id r1-20020a92cd81000000b003490785adadmr4057539ilb.10.1691685149672; Thu, 10 Aug 2023 09:32:29 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:29 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 12/28] moveconfig: Correct unused variables Date: Thu, 10 Aug 2023 10:31:44 -0600 Message-ID: <20230810163212.2368374-13-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Fix pylint warnings about unused variables. Signed-off-by: Simon Glass --- tools/moveconfig.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index cc35c4bce9d..02c1d13f865 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -620,7 +620,7 @@ class Slots: self.slots = [] devnull = subprocess.DEVNULL make_cmd = get_make_cmd() - for i in range(args.jobs): + for _ in range(args.jobs): self.slots.append(Slot(toolchains, args, progress, devnull, make_cmd, reference_src_dir, db_queue)) @@ -772,7 +772,7 @@ def find_kconfig_rules(kconf, config, imply_config): """ sym = kconf.syms.get(imply_config) if sym: - for sel, cond in (sym.selects + sym.implies): + for sel, _ in (sym.selects + sym.implies): if sel.name == config: return sym return None @@ -941,7 +941,7 @@ def do_imply_config(config_list, add_imply, imply_flags, skip_added, if add_imply and add_imply != 'all': add_imply = add_imply.split(',') - all_configs, all_defconfigs, config_db, defconfig_db = read_database() + all_configs, all_defconfigs, _, defconfig_db = read_database() # Work through each target config option in turn, independently for config in config_list: @@ -1101,7 +1101,7 @@ def do_find_config(config_list): is preceded by a tilde (~) then it must be false, otherwise it must be true) """ - all_configs, all_defconfigs, config_db, defconfig_db = read_database() + _, all_defconfigs, config_db, _ = read_database() # Start with all defconfigs out = all_defconfigs @@ -1199,9 +1199,7 @@ def scan_makefiles(fnames): fname_uses = {} for fname, rest in fnames: m_iter = RE_MK_CONFIGS.finditer(rest) - found = False for m in m_iter: - found = True real_opt = m.group(2) if real_opt == '': continue @@ -1242,9 +1240,11 @@ def scan_src_files(fnames): >>> RE_CONFIG_IS.search('#if CONFIG_IS_ENABLED(OF_PLATDATA)').groups() ('OF_PLATDATA',) """ + fname = None + rest = None + def add_uses(m_iter, is_spl): for m in m_iter: - found = True real_opt = m.group(1) if real_opt == '': continue @@ -1302,7 +1302,7 @@ def do_scan_source(path, do_update): """ # Make sure we know about all the options not_found = collections.defaultdict(list) - for use, rest in all_uses.items(): + for use, _ in all_uses.items(): name = use.cfg if name in IGNORE_SYMS: continue @@ -1314,7 +1314,6 @@ def do_scan_source(path, do_update): # If it is an SPL symbol, try prepending all SPL_ prefixes to # find at least one SPL symbol if use.is_spl: - add_to_dict = False for prefix in SPL_PREFIXES: try_name = prefix + name sym = kconf.syms.get(try_name) @@ -1332,7 +1331,6 @@ def do_scan_source(path, do_update): elif not use.is_spl: check = False else: # MODE_NORMAL - debug = False sym = kconf.syms.get(name) if not sym: proper_name = is_not_proper(name) @@ -1373,7 +1371,7 @@ def do_scan_source(path, do_update): print(f'Scanning source in {path}') args = ['git', 'grep', '-E', r'IS_ENABLED|\bCONFIG'] with subprocess.Popen(args, stdout=subprocess.PIPE) as proc: - out, err = proc.communicate() + out, _ = proc.communicate() lines = out.splitlines() re_fname = re.compile('^([^:]*):(.*)') src_list = [] @@ -1407,7 +1405,7 @@ def do_scan_source(path, do_update): print(f'Not sure how to handle file {fname}') # Scan the Makefiles - all_uses, fname_uses = scan_makefiles(mk_list) + all_uses, _ = scan_makefiles(mk_list) spl_not_found = set() proper_not_found = set() @@ -1428,7 +1426,7 @@ def do_scan_source(path, do_update): proper_not_found |= set([key for key in not_found.keys()]) # Scan the source code - all_uses, fname_uses = scan_src_files(src_list) + all_uses, _ = scan_src_files(src_list) # Make sure we know about all the options print('\nCONFIG options present in source but not Kconfig:') @@ -1527,7 +1525,7 @@ doc/develop/moveconfig.rst for documentation.''' if args.test: sys.argv = [sys.argv[0]] - fail, count = doctest.testmod() + fail, _ = doctest.testmod() if fail: return 1 unittest.main() From patchwork Thu Aug 10 16:31:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819960 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=By3eR0zj; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCFL0Nkhz1yfB for ; Fri, 11 Aug 2023 02:34:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E595B8690A; Thu, 10 Aug 2023 18:32:35 +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="By3eR0zj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9F46A86923; Thu, 10 Aug 2023 18:32:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) (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 655AB86901 for ; Thu, 10 Aug 2023 18:32:32 +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-pl1-x62b.google.com with SMTP id d9443c01a7336-1bbf8cb694aso9709825ad.3 for ; Thu, 10 Aug 2023 09:32:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685150; x=1692289950; 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=yzOD6o1c9xUvuHqUNhbCzERW/21zZG8WIXzQf3yXD8w=; b=By3eR0zjf6SehklBFlqxZIXCdZBIggc11ZAaz8RI1d7i6KqSjC6s/ANl75bn4BZi/g e9f08pHAqnNZH/ZFm+jBrs4kAXzAG865whHaGCkfhQjolYNO5tAyn4F9fRnnp0FMr9lP W9/Z1dLqRU+PEm5yrIWGamw1xDHH+JY4VJO58= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685150; x=1692289950; 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=yzOD6o1c9xUvuHqUNhbCzERW/21zZG8WIXzQf3yXD8w=; b=CvC+7fII5xzDBYnBJEIBAhGsO+woznWTRJ2hRS3A0AiPtisNOosecgi/eC8zm4OE8A 7KeSSV6PagxSCe8C9q+YcmqgJJLKvl5r5k59vFFxvEphGV85bIAYIfzQY56AoPU0DYPw BpAsRUqIOSSQoHm/55lZ4A9+jbWjjBLUlkzyRkOk4YoGFaMiHwVZeOE0fXZ1OrKq2S7h 0jySjt0pBMoSzAY2vnb4I2V6QvbSifEWjHdVji1uTvWnkqBNRvU/spWRF5e1uC1TKhKz 1By5mt/wUSSBbqGdzcdZhOpLAJ6yAWEvEJg6KwIAdS8rpawzeB9UUfuMb3HyUBYTPuBw Xnjg== X-Gm-Message-State: AOJu0Yxp/ZeKN1MGWHR6PYfNMzifo80Da7MzHXRIvApxEuXrV/EgxuAU Zjt6KTmimKaod4Y+ClE85Jnv2n6otymndSwpeJw= X-Google-Smtp-Source: AGHT+IEPSS8Q6S7wsxij9bfylZsC9Z9jGXI8ZCk0/sSX72WosdpU7cSWbHw3f8HMpxFyg4mZciMq0g== X-Received: by 2002:a17:902:b40a:b0:1bc:66a3:9a4b with SMTP id x10-20020a170902b40a00b001bc66a39a4bmr2712347plr.5.1691685150608; Thu, 10 Aug 2023 09:32:30 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:30 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 13/28] moveconfig: Correct non-snake variables names Date: Thu, 10 Aug 2023 10:31:45 -0600 Message-ID: <20230810163212.2368374-14-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Correct some variable names that do not conform to snake case, with the three-character minimum. Signed-off-by: Simon Glass --- tools/moveconfig.py | 70 ++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 02c1d13f865..4a47d1578eb 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -235,10 +235,10 @@ def read_file(fname, as_lines=True, skip_unicode=False): return [line.rstrip('\n') for line in inf.readlines()] else: return inf.read() - except UnicodeDecodeError as e: + except UnicodeDecodeError as exc: if not skip_unicode: raise - print(f"Failed on file '{fname}: {e}") + print(f"Failed on file '{fname}: {exc}") return None def try_expand(line): @@ -331,13 +331,13 @@ class KconfigParser: arch = '' cpu = '' for line in read_file(self.dotconfig): - m = self.re_arch.match(line) - if m: - arch = m.group(1) + m_arch = self.re_arch.match(line) + if m_arch: + arch = m_arch.group(1) continue - m = self.re_cpu.match(line) - if m: - cpu = m.group(1) + m_cpu = self.re_cpu.match(line) + if m_cpu: + cpu = m_cpu.group(1) if not arch: return None @@ -422,7 +422,7 @@ class Slot: If the subprocess is still running, wait until it finishes. """ if self.state != STATE_IDLE: - while self.ps.poll() == None: + while self.proc.poll() == None: pass shutil.rmtree(self.build_dir) @@ -467,10 +467,10 @@ class Slot: if self.state == STATE_IDLE: return True - if self.ps.poll() == None: + if self.proc.poll() == None: return False - if self.ps.poll() != 0: + if self.proc.poll() != 0: self.handle_error() elif self.state == STATE_DEFCONFIG: if self.reference_src_dir and not self.current_src_dir: @@ -499,7 +499,7 @@ class Slot: 'Failed to process.\n') if self.args.verbose: self.log += color_text(self.args.color, COLOR_LIGHT_CYAN, - self.ps.stderr.read().decode()) + self.proc.stderr.read().decode()) self.finish(False) def do_defconfig(self): @@ -507,9 +507,9 @@ class Slot: cmd = list(self.make_cmd) cmd.append(self.defconfig) - self.ps = subprocess.Popen(cmd, stdout=self.devnull, - stderr=subprocess.PIPE, - cwd=self.current_src_dir) + self.proc = subprocess.Popen(cmd, stdout=self.devnull, + stderr=subprocess.PIPE, + cwd=self.current_src_dir) self.state = STATE_DEFCONFIG def do_autoconf(self): @@ -528,9 +528,9 @@ class Slot: cmd = list(self.make_cmd) cmd.append('KCONFIG_IGNORE_DUPLICATES=1') cmd.append(AUTO_CONF_PATH) - self.ps = subprocess.Popen(cmd, stdout=self.devnull, env=env, - stderr=subprocess.PIPE, - cwd=self.current_src_dir) + self.proc = subprocess.Popen(cmd, stdout=self.devnull, env=env, + stderr=subprocess.PIPE, + cwd=self.current_src_dir) self.state = STATE_AUTOCONF def do_build_db(self): @@ -552,8 +552,8 @@ class Slot: cmd = list(self.make_cmd) cmd.append('savedefconfig') - self.ps = subprocess.Popen(cmd, stdout=self.devnull, - stderr=subprocess.PIPE) + self.proc = subprocess.Popen(cmd, stdout=self.devnull, + stderr=subprocess.PIPE) self.state = STATE_SAVEDEFCONFIG def update_defconfig(self): @@ -1145,13 +1145,13 @@ def prefix_config(cfg): >>> prefix_config('A123') 'CONFIG_A123' """ - op = '' + oper = '' if cfg[0] == '~': - op = cfg[0] + oper = cfg[0] cfg = cfg[1:] if not cfg.startswith('CONFIG_'): cfg = 'CONFIG_' + cfg - return op + cfg + return oper + cfg RE_MK_CONFIGS = re.compile(r'CONFIG_(\$\(SPL_(?:TPL_)?\))?([A-Za-z0-9_]*)') @@ -1199,12 +1199,12 @@ def scan_makefiles(fnames): fname_uses = {} for fname, rest in fnames: m_iter = RE_MK_CONFIGS.finditer(rest) - for m in m_iter: - real_opt = m.group(2) + for mat in m_iter: + real_opt = mat.group(2) if real_opt == '': continue is_spl = False - if m.group(1): + if mat.group(1): is_spl = True use = ConfigUse(real_opt, is_spl, fname, rest) if fname not in fname_uses: @@ -1244,8 +1244,8 @@ def scan_src_files(fnames): rest = None def add_uses(m_iter, is_spl): - for m in m_iter: - real_opt = m.group(1) + for mat in m_iter: + real_opt = mat.group(1) if real_opt == '': continue use = ConfigUse(real_opt, is_spl, fname, rest) @@ -1571,9 +1571,9 @@ doc/develop/moveconfig.rst for documentation.''' # We are either building the database or forcing a sync of defconfigs config_db = {} db_queue = queue.Queue() - t = DatabaseThread(config_db, db_queue) - t.daemon = True - t.start() + dbt = DatabaseThread(config_db, db_queue) + dbt.daemon = True + dbt.start() check_clean_directory() bsettings.setup('') @@ -1584,12 +1584,12 @@ doc/develop/moveconfig.rst for documentation.''' db_queue.join() if args.build_db: - with open(CONFIG_DATABASE, 'w', encoding='utf-8') as fd: + with open(CONFIG_DATABASE, 'w', encoding='utf-8') as outf: for defconfig, configs in config_db.items(): - fd.write(f'{defconfig}\n') + outf.write(f'{defconfig}\n') for config in sorted(configs.keys()): - fd.write(f' {config}={configs[config]}\n') - fd.write('\n') + outf.write(f' {config}={configs[config]}\n') + outf.write('\n') if __name__ == '__main__': sys.exit(main()) From patchwork Thu Aug 10 16:31:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819961 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=k4anYByl; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCFZ0JWDz1yfB for ; Fri, 11 Aug 2023 02:34:58 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3E60C8693D; Thu, 10 Aug 2023 18:32:36 +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="k4anYByl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0ACD08692D; Thu, 10 Aug 2023 18:32:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (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 09393866B5 for ; Thu, 10 Aug 2023 18:32:33 +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-il1-x131.google.com with SMTP id e9e14a558f8ab-3492905f546so3894825ab.0 for ; Thu, 10 Aug 2023 09:32:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685151; x=1692289951; 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=Z7c7srwu5Ra1sb4JLPTaKpeJXyImp+wWPCgJ6cIp+iY=; b=k4anYByl4gvf5yaUC8tW9MPW0ihO+Kpld2Yc6PvFTvi5RNL9ffSLfLZNEmJW08l7fp TCCqeFv+waK4mC3R37loS566xRwAU3d1vCt4LjIP3+/woZcUlthGettjM9U3qgZ7h9hP A9X420Qbr1WtncQ9XhwW41zDDt2zZ0txkYiXs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685151; x=1692289951; 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=Z7c7srwu5Ra1sb4JLPTaKpeJXyImp+wWPCgJ6cIp+iY=; b=B/FFPOIpbkgx+8sQFGJHO+SV7HwJrhqqBcFv0wGmV8eYiygPGWsnRjC537bW4+p+et Ikt43RDd2fORLnpSIF6s0BNJZ61/Ro7CAMF1bFYRA7JtwI8aWz10ci41aYt8hZ68DpE7 gspKh2BuuNwCX5MNhYSZOWVqqXfL0f6YHSvqTIACG/qIkRMGICZW1Y7jbG91NWnLHDfD y6BeZj2XbIAdHOjUWKMKJxf9oE7wRnCHztbvzTrWG/EfTZqUVxA/9mRQncechpiNetkG IE9eUp8TBZw7ZP56j1kuGyBbej5A1y9w2GOnElFf10opTOVjDZdHJFMDV9brvq4Mwr4B tX1A== X-Gm-Message-State: AOJu0YzjVT7qF3I5ellqY+fqfgz0PUkGcNjpqmigRBwwfuwQMIYnoch9 bmES92CabsvPvv+8RGU8lgCl1nncDjW/yZZ0sx0= X-Google-Smtp-Source: AGHT+IGzRepIa3trKjxjD5b9MpanCJ8L/cSSpKyGwJdEvOyBapQEzcmvcWegqF0/FDACGXeN1i05Eg== X-Received: by 2002:a05:6e02:1bec:b0:349:3808:e387 with SMTP id y12-20020a056e021bec00b003493808e387mr3888661ilv.11.1691685151628; Thu, 10 Aug 2023 09:32:31 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:31 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 14/28] moveconfig: Correct use of members not declared in __init__() Date: Thu, 10 Aug 2023 10:31:46 -0600 Message-ID: <20230810163212.2368374-15-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Fix these pylint warnings. Signed-off-by: Simon Glass --- tools/moveconfig.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 4a47d1578eb..fbfa71b186a 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -410,6 +410,10 @@ class Slot: self.parser = KconfigParser(args, self.build_dir) self.state = STATE_IDLE self.failed_boards = set() + self.defconfig = None + self.log = '' + self.current_src_dir = None + self.proc = None def __del__(self): """Delete the working directory From patchwork Thu Aug 10 16:31:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819962 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=XJpuTuVX; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCFn6Kykz1yYl for ; Fri, 11 Aug 2023 02:35:09 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 827D08692D; Thu, 10 Aug 2023 18:32:38 +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="XJpuTuVX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DB4E786938; Thu, 10 Aug 2023 18:32:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) (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 CBC64868D8 for ; Thu, 10 Aug 2023 18:32:33 +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-xd2c.google.com with SMTP id ca18e2360f4ac-7914633a110so37604439f.0 for ; Thu, 10 Aug 2023 09:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685152; x=1692289952; 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=qUpzoc7IMw4JANzNCNpKIbxbHSEqJTK6z02hGlxAAsE=; b=XJpuTuVXflRPCmblCtDHN0bEFJoNcfHr6h6Ua9YvmxRT1Rtos5tvZR/uXfwmA9z+hY ndUaxM38pYJK+vqT8LOfg6WagLs1G9dlhG0s1h57mmnJyNPSLmN9NuHcj0s0Pi+py1Uq Ll05mDNak/iBbjRQ90s4QDrU20HkySV+gQ/6A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685152; x=1692289952; 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=qUpzoc7IMw4JANzNCNpKIbxbHSEqJTK6z02hGlxAAsE=; b=NlNX0VKGld1IDw8nk+OnNHED7UMoQm6Ik+pQglfwnizsuPm/JfZDINplltPNkVm17D 94ddYEGqRShLQ8IgHlCA4GIU7QeBxHqxFNWm0SfdjcgvsGrN6NHJQsH+hw3UP2Tn9PaY TQl1GoKbLD8B2QIFbgj3Zt2NyssH1YU0RMHNBhOv/9v5U3eeJ216tHwAlt3HlmF//VAD VR5yRY5xACaq+pp7jn/PRvXMKYDex2WnNBukoAkw6x6Ab8gvgoKXES0LebtdjyKyWPil pmdJni798o+942ONtb63WkzqVBqo6Cuwe94WVQ45ZXHhEKcEMXKG9Ecwe/4su2rxIeFH ftPw== X-Gm-Message-State: AOJu0YwtjBqz8B8v125VKMXQxlkjZEe03xNN2nyQJWIZYr+Qt/wXVx/s yjFzps8IWDvfOVuNaaor3ZHWXCdFyL17FQ0qISQ= X-Google-Smtp-Source: AGHT+IHOoz/tzUNdIl6udatA+vI10Pu680EN7o+v2LiegE3a3JSVrBY3U5qfmFfGt9/ygY2JsT9KTw== X-Received: by 2002:a5e:8815:0:b0:787:8cf:fd08 with SMTP id l21-20020a5e8815000000b0078708cffd08mr3956668ioj.17.1691685152478; Thu, 10 Aug 2023 09:32:32 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:32 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 15/28] moveconfig: Correct list-comprehension warnings Date: Thu, 10 Aug 2023 10:31:47 -0600 Message-ID: <20230810163212.2368374-16-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Correct some pylint warnings about needing to use list comprehension. Signed-off-by: Simon Glass --- tools/moveconfig.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index fbfa71b186a..309ff89f7af 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -1422,12 +1422,12 @@ def do_scan_source(path, do_update): print('\nCONFIG options present in Makefiles but not Kconfig (SPL):') not_found = check_not_found(all_uses, MODE_SPL) show_uses(not_found) - spl_not_found |= set([is_not_proper(key) or key for key in not_found.keys()]) + spl_not_found |= {is_not_proper(key) or key for key in not_found.keys()} print('\nCONFIG options used as Proper in Makefiles but without a non-SPL_ variant:') not_found = check_not_found(all_uses, MODE_PROPER) show_uses(not_found) - proper_not_found |= set([key for key in not_found.keys()]) + proper_not_found |= {not_found.keys()} # Scan the source code all_uses, _ = scan_src_files(src_list) @@ -1440,12 +1440,12 @@ def do_scan_source(path, do_update): print('\nCONFIG options present in source but not Kconfig (SPL):') not_found = check_not_found(all_uses, MODE_SPL) show_uses(not_found) - spl_not_found |= set([is_not_proper(key) or key for key in not_found.keys()]) + spl_not_found |= {is_not_proper(key) or key for key in not_found.keys()} print('\nCONFIG options used as Proper in source but without a non-SPL_ variant:') not_found = check_not_found(all_uses, MODE_PROPER) show_uses(not_found) - proper_not_found |= set([key for key in not_found.keys()]) + proper_not_found |= {not_found.keys()} print('\nCONFIG options used as SPL but without an SPL_ variant:') for item in sorted(spl_not_found): From patchwork Thu Aug 10 16:31:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819963 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=P1/hc3Ep; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCG14sWsz1yYl for ; Fri, 11 Aug 2023 02:35:21 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C963086937; Thu, 10 Aug 2023 18:32:38 +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="P1/hc3Ep"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A8E0186948; Thu, 10 Aug 2023 18:32:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (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 A29B58666E for ; Thu, 10 Aug 2023 18:32:34 +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-xd33.google.com with SMTP id ca18e2360f4ac-790bed44880so37457439f.0 for ; Thu, 10 Aug 2023 09:32:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685153; x=1692289953; 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=ZPbczy1aTGD5XgMBW79HBvNWpuXGT5Nd6fK2cYfeKXc=; b=P1/hc3EpsjZO82tIUfVSbZVUM+8hzgLLg8oA6kExvxSTSefDrFJBoznkXtNMUbQlTa TfbcSCPeHFt6m6oYFG1vTv1G+RQjuEFBiF2V4dDY49GOTh1i5dbHInwiqB0rB93g9udQ XbYBPTxBJWUfAveybuhVHCBK/bVygBUju0dk8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685153; x=1692289953; 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=ZPbczy1aTGD5XgMBW79HBvNWpuXGT5Nd6fK2cYfeKXc=; b=K8JpBTZ/Ktj7cqRgGhGFk8PjVIWappuS9NylZVgyy8mG7eYJ7amAkTCtFXDxGKuNjH jrbqw0LyL15uxe5MbGmkWUWfn6xRPXeZCNY8s9ShXgVewQuRj8nS+n4SIOFgRJMlsdtu ys1pAbh1/E/4qn1AXhLF/yxkLfIvCBOsGA5AS5Utz9tMyRQkKTK0RIbywvi7iTq3boaT EcKaVrg32pcTjRhKC6mio1M8jQm0kpYYTQIF3DQK1Vdp9/h3rbGUc6T0+sH635BMo74U ho3X4k4yMJDQBrWziHQj2mJZglaN6A6kKCerDxX7OT5O7pMtT845XZ5pcwlkKX9ZskzD fJ8w== X-Gm-Message-State: AOJu0Yx6+h7J34RzzKfWcNnEh2LEpXW3Y5nHFuOnuNvFu/lMbErzI0r4 wFd2eqgVYLXCY11AKHrsfC1Wm6rXKhd4o8PCuvk= X-Google-Smtp-Source: AGHT+IHsKhYSg91ysHW9fES7Vh3W9n0E3nYk+f2Ag6y5rwXv3NHMpcDTjJv2YoamDGWEcaYOBQVqfA== X-Received: by 2002:a6b:d605:0:b0:790:6629:b222 with SMTP id w5-20020a6bd605000000b007906629b222mr3981297ioa.5.1691685153302; Thu, 10 Aug 2023 09:32:33 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:32 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 16/28] moveconfig: Use an encoding with open() Date: Thu, 10 Aug 2023 10:31:48 -0600 Message-ID: <20230810163212.2368374-17-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Fix pylint warnings about needing an explicit character encoding. Signed-off-by: Simon Glass --- tools/moveconfig.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 309ff89f7af..5896deb8c71 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -1457,12 +1457,14 @@ def do_scan_source(path, do_update): # Write out the updated information if do_update: - with open(os.path.join(path, 'scripts', 'conf_nospl'), 'w') as out: + with open(os.path.join(path, 'scripts', 'conf_nospl'), 'w', + encoding='utf-8') as out: print('# These options should not be enabled in SPL builds\n', file=out) for item in sorted(spl_not_found): print(item, file=out) - with open(os.path.join(path, 'scripts', 'conf_noproper'), 'w') as out: + with open(os.path.join(path, 'scripts', 'conf_noproper'), 'w', + encoding='utf-8') as out: print('# These options should not be enabled in Proper builds\n', file=out) for item in sorted(proper_not_found): From patchwork Thu Aug 10 16:31:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819964 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=DdZX5NSw; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCGF0GYXz1yfW for ; Fri, 11 Aug 2023 02:35:33 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1E17086944; Thu, 10 Aug 2023 18:32:39 +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="DdZX5NSw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BB80386913; Thu, 10 Aug 2023 18:32:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) (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 894DB86933 for ; Thu, 10 Aug 2023 18:32:35 +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-xd2d.google.com with SMTP id ca18e2360f4ac-79194701ce9so10345739f.1 for ; Thu, 10 Aug 2023 09:32:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685154; x=1692289954; 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=vvKebEoKRJuFwA4Zd5xwpCy9xQBCfb0eyrLFyRv9vDU=; b=DdZX5NSwfCdXje+8njzS6VpEH+MlawhwUywaOrEGLqHCM2sTFZ5m54j4PaTRFrvi7H UKGqlVr+01V+TQGLLXaFBbZb51qxOLvsatbGT077aoqGmkdb6lmBTo9Jx+HAEpljG292 e09aUcLdUeUhYqut8DwjJwMnUxf8cN5pV/D+c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685154; x=1692289954; 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=vvKebEoKRJuFwA4Zd5xwpCy9xQBCfb0eyrLFyRv9vDU=; b=ez3ZJHU93YvdqhqLYQ2dYR4InbTup4Psv0HGoV95mPlsBtGLgmZXFvP+00XHTTV5Jg 6Wm8zH+I7t1NXLaFYmPWXGENMV3o5+M13fCrC2UThIMUcLerCfqBR3tZrxKreG5LFG8/ LLeUx03lMLeVDv/hGTozfZQaK8G3MrpaPEUZdc0RrLM0JvfoWHRTWNXmC1k8mfjAzE7o QzU7eAInCVklbNLWjWyyBR2ZTWWnOFE05wiOla4q4Xo/hP96OQEHmzr8bqega8m3coZE CB8shU7AnVrBGSu1mxeF4Xu1xO/eyEA8ytX82mMfj96sV/bPrwVp7f6kkLBflO3aVpXb 9jpA== X-Gm-Message-State: AOJu0Yxx1DvNAnlP2xPo2PcZ7inMyanzixtfj7P3HRyneIXwvdpL9BZS 6PsbrWIYZAssk7ObMGuvLg7MoeClrZHcgVmN/VA= X-Google-Smtp-Source: AGHT+IFCo67QTdQzV+F9fVAcRToG5qBQNfwAC4wF0ihNvfs+6v72vwJhhfjkWjxzl+Gkh3+3hAjgDw== X-Received: by 2002:a6b:c416:0:b0:783:60f7:ade9 with SMTP id y22-20020a6bc416000000b0078360f7ade9mr3909800ioa.5.1691685154192; Thu, 10 Aug 2023 09:32:34 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:33 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 17/28] moveconfig: Fix misc pylint warnings Date: Thu, 10 Aug 2023 10:31:49 -0600 Message-ID: <20230810163212.2368374-18-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Fix various remaining pylint warnings. Signed-off-by: Simon Glass --- tools/moveconfig.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 5896deb8c71..816eb151bdf 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -233,8 +233,7 @@ def read_file(fname, as_lines=True, skip_unicode=False): try: if as_lines: return [line.rstrip('\n') for line in inf.readlines()] - else: - return inf.read() + return inf.read() except UnicodeDecodeError as exc: if not skip_unicode: raise @@ -426,7 +425,7 @@ class Slot: If the subprocess is still running, wait until it finishes. """ if self.state != STATE_IDLE: - while self.proc.poll() == None: + while self.proc.poll() is None: pass shutil.rmtree(self.build_dir) @@ -471,7 +470,7 @@ class Slot: if self.state == STATE_IDLE: return True - if self.proc.poll() == None: + if self.proc.poll() is None: return False if self.proc.poll() != 0: @@ -494,7 +493,7 @@ class Slot: else: sys.exit('Internal Error. This should not happen.') - return True if self.state == STATE_IDLE else False + return self.state == STATE_IDLE def handle_error(self): """Handle error cases.""" @@ -521,13 +520,13 @@ class Slot: arch = self.parser.get_arch() try: - toolchain = self.toolchains.Select(arch) + tchain = self.toolchains.Select(arch) except ValueError: self.log += color_text(self.args.color, COLOR_YELLOW, f"Tool chain for '{arch}' is missing. Do nothing.\n") self.finish(False) return - env = toolchain.MakeEnvironment(False) + env = tchain.MakeEnvironment(False) cmd = list(self.make_cmd) cmd.append('KCONFIG_IGNORE_DUPLICATES=1') @@ -1004,7 +1003,7 @@ def do_imply_config(config_list, add_imply, imply_flags, skip_added, # skip imply_config because prev is a superset skip = True break - elif count > prev_count: + if count > prev_count: # delete prev because imply_config is a superset del imply_configs[prev] if not skip: @@ -1538,7 +1537,7 @@ doc/develop/moveconfig.rst for documentation.''' if args.scan_source: do_scan_source(os.getcwd(), args.update) - return + return 0 if not any((args.force_sync, args.build_db, args.imply, args.find)): parser.print_usage() @@ -1568,11 +1567,11 @@ doc/develop/moveconfig.rst for documentation.''' imply_flags |= IMPLY_FLAGS[flag][0] do_imply_config(configs, args.add_imply, imply_flags, args.skip_added) - return + return 0 if args.find: do_find_config(configs) - return + return 0 # We are either building the database or forcing a sync of defconfigs config_db = {} @@ -1596,6 +1595,8 @@ doc/develop/moveconfig.rst for documentation.''' for config in sorted(configs.keys()): outf.write(f' {config}={configs[config]}\n') outf.write('\n') + return 0 + if __name__ == '__main__': sys.exit(main()) From patchwork Thu Aug 10 16:31:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819965 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=fL/nTIDM; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCGT0Wgwz1yYl for ; Fri, 11 Aug 2023 02:35:45 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 688DC86948; Thu, 10 Aug 2023 18:32:42 +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="fL/nTIDM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7C8DD86925; Thu, 10 Aug 2023 18:32:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) (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 5724D86940 for ; Thu, 10 Aug 2023 18:32:36 +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-il1-x12f.google.com with SMTP id e9e14a558f8ab-3493862cfb1so4028145ab.1 for ; Thu, 10 Aug 2023 09:32:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685155; x=1692289955; 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=PlOTuObmQjGjRotdbxiepSUjuZt5WQSgfUlh6H6C0Go=; b=fL/nTIDMUZvkeqIvx8BszoheaphB94ucNTBbic+Pj7fRWTm2lwGXr2FJ03Qg70NTtd iCEtJvvs34IzO7UmR3qZZpFSI2S6IC/x6UwTtsVHpNB+siyfitGt4Vt0oIXRoa5VKD1M uuF6ycsQSjn1IU93VMOrYRJedtrsCNK0YN+rI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685155; x=1692289955; 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=PlOTuObmQjGjRotdbxiepSUjuZt5WQSgfUlh6H6C0Go=; b=fQj+oM9E0Kr27cjMNoYfXBdBq44B4sENBsd/hKY23wRoCpUgFopJwohATn0wCM4tWU dF7/1tDm7ZoXmeRCJAc8I+4OUj0ZL2/NbtRNxzPYXfVicb/aKHRYvaEWC8joeI1P/SQY NaRy5GnYqBko39KxmxSkqlNFNN7tnZBPBDJSkdYLPRacDU2megrsDjZX6RXCRFOhsg5p n3mCsLcixZikEv1lC34n6dLvRCCAWXdBDBImZvklKmmSQeIgL4VyrU0QJZlCWGD97R+H 4xwB8OvAEbgb3kmTeKfxHTod+/w5VLJM86LOAAXJXX4rwSMLKpW825Vkanbs8UIyFxEA RlKw== X-Gm-Message-State: AOJu0Yx1+Pv3jvJNvMUSKWxNbmOXRd8t+wip8+F3D60lCKaahZJpqqqu SZlMNlbJZqGSKnJNJ/He4wYkjr04i+Js7Xnn0XY= X-Google-Smtp-Source: AGHT+IE8xOIWUt9Y1hSe+c6PimxNLSu085rY3s5p5Zf3tnvhbxNVzh2N5ijmuErh/DaD2VFAv69n6g== X-Received: by 2002:a05:6e02:1bcc:b0:348:9fb8:abed with SMTP id x12-20020a056e021bcc00b003489fb8abedmr3759575ilv.27.1691685154879; Thu, 10 Aug 2023 09:32:34 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:34 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 18/28] moveconfig: Only show output when there is a reason Date: Thu, 10 Aug 2023 10:31:50 -0600 Message-ID: <20230810163212.2368374-19-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 There is no point in listing a board if everything went well. It makes it harder to see the failures, particularly on a fast machine. Suppress output unless something actually happened. Drop the 'Syncing by savedefconfig' since this is selected by the -s and is the same for all boards in this mode. Signed-off-by: Simon Glass --- tools/moveconfig.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 816eb151bdf..08ff82a4c02 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -551,7 +551,6 @@ class Slot: if not self.args.force_sync: self.finish(True) return - self.log += 'Syncing by savedefconfig (forced by option)...\n' cmd = list(self.make_cmd) cmd.append('savedefconfig') @@ -581,12 +580,13 @@ class Slot: successfully, or False when it fails. """ # output at least 30 characters to hide the "* defconfigs out of *". - log = self.defconfig.ljust(30) + '\n' + if self.log: + log = self.defconfig.ljust(30) + '\n' - log += '\n'.join([ ' ' + s for s in self.log.split('\n') ]) - # Some threads are running in parallel. - # Print log atomically to not mix up logs from different threads. - print(log, file=(sys.stdout if success else sys.stderr)) + log += '\n'.join([ ' ' + s for s in self.log.split('\n') ]) + # Some threads are running in parallel. + # Print log atomically to not mix up logs from different threads. + print(log, file=(sys.stdout if success else sys.stderr)) if not success: if self.args.exit_on_error: From patchwork Thu Aug 10 16:31:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819966 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=GJy9RlZA; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCGj3h7cz1yYl for ; Fri, 11 Aug 2023 02:35:57 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A88CE86952; Thu, 10 Aug 2023 18:32:42 +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="GJy9RlZA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 460D986948; Thu, 10 Aug 2023 18:32:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (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 2C76486926 for ; Thu, 10 Aug 2023 18:32:37 +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-xd2f.google.com with SMTP id ca18e2360f4ac-790ba9cf42aso36295039f.3 for ; Thu, 10 Aug 2023 09:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685156; x=1692289956; 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=hLGr7/GLkw8gUury7BjmCKFYpFE+5x9fZXiCVyDV5EQ=; b=GJy9RlZAQfXfKWgaaH0G2CI4cFTX3dyzHXw/MXkuft3cmYNJffTkTy0gIP2kBiTKrW TV3AFXDrMzZexIWLm2NnfFVmV5I4lcGIO7OGduSFlgpJbjp6ekyrr/IzZjaEfUSGwNty RTGE7DMQcrMPrF3/aF9LiXpfPeMKFnDkJgZb0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685156; x=1692289956; 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=hLGr7/GLkw8gUury7BjmCKFYpFE+5x9fZXiCVyDV5EQ=; b=FzJDMFPV8HIPtt0bFf7YAMnPu2H1i/lwnnYVOGhvOVtelzQr1yJ2jWjZ8Nhhg/BeDi jcZumS/ocG/cFjehVgUT2hCni/Nwi1Q0dEIvug4KP+zigDsWvjaW4tKD6tZQ+uxHp9sP Wgcz+hA5kRnFOHLz9lhBcoaz3Z/RLkOI1pJffKbNIy79ZsCIw86t1kns4LSziBpT1/j3 MZKkOBOAaLpyhhbijwd4yizz8V53mgzsAJgO04jbczoyBBxZQdNlYQGwzE34l0RKlY3K 1T2I+qXJO7D67XIpQgsHhUbV34PJ4ScgKaK2Hyy5dCMSuZ+VtawL2SjmIM84vtKoh0hL wpTA== X-Gm-Message-State: AOJu0YzZL72d7v/ZwFr1UK7BYnsr3EBPRU5zv5zIDbey9BlhVTsPboQx ijgEvKpxOnP62M/ZPtdJ82UaKM6t6hmyq/gpYA8= X-Google-Smtp-Source: AGHT+IFaPC50n9uYpw5TDCIlvQ4R63xXgv3WN6xVwADr0FexkOn0Ab9AVa83kYWrqKXH9bkKLfGDKg== X-Received: by 2002:a05:6602:5:b0:783:47cd:27b5 with SMTP id b5-20020a056602000500b0078347cd27b5mr3990178ioa.3.1691685155719; Thu, 10 Aug 2023 09:32:35 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:35 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 19/28] moveconfig: Reduce the amount of output Date: Thu, 10 Aug 2023 10:31:51 -0600 Message-ID: <20230810163212.2368374-20-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Output a single line in the case where the defconfig only has one line of output. Show the name without the _defconfig suffix, since that is the same for all boards. Use a list for the log so it is easier to process at the end. Signed-off-by: Simon Glass --- tools/moveconfig.py | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 08ff82a4c02..b97f82cd689 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -410,7 +410,7 @@ class Slot: self.state = STATE_IDLE self.failed_boards = set() self.defconfig = None - self.log = '' + self.log = [] self.current_src_dir = None self.proc = None @@ -446,7 +446,7 @@ class Slot: return False self.defconfig = defconfig - self.log = '' + self.log = [] self.current_src_dir = self.reference_src_dir self.do_defconfig() return True @@ -498,11 +498,12 @@ class Slot: def handle_error(self): """Handle error cases.""" - self.log += color_text(self.args.color, COLOR_LIGHT_RED, - 'Failed to process.\n') + self.log.append(color_text(self.args.color, COLOR_LIGHT_RED, + 'Failed to process')) if self.args.verbose: - self.log += color_text(self.args.color, COLOR_LIGHT_CYAN, - self.proc.stderr.read().decode()) + for line in self.proc.stderr.read().decode().splitlines(): + self.log.append(color_text(self.args.color, COLOR_LIGHT_CYAN, + line)) self.finish(False) def do_defconfig(self): @@ -522,8 +523,8 @@ class Slot: try: tchain = self.toolchains.Select(arch) except ValueError: - self.log += color_text(self.args.color, COLOR_YELLOW, - f"Tool chain for '{arch}' is missing. Do nothing.\n") + self.log.append(color_text(self.args.color, COLOR_YELLOW, + f"Tool chain for '{arch}' is missing: do nothing")) self.finish(False) return env = tchain.MakeEnvironment(False) @@ -565,8 +566,8 @@ class Slot: updated = not filecmp.cmp(orig_defconfig, new_defconfig) if updated: - self.log += color_text(self.args.color, COLOR_LIGHT_BLUE, - 'defconfig was updated.\n') + self.log.append(color_text(self.args.color, COLOR_LIGHT_BLUE, + 'defconfig updated')) if not self.args.dry_run and updated: shutil.move(new_defconfig, orig_defconfig) @@ -581,9 +582,13 @@ class Slot: """ # output at least 30 characters to hide the "* defconfigs out of *". if self.log: - log = self.defconfig.ljust(30) + '\n' + name = self.defconfig[:-len('_defconfig')] - log += '\n'.join([ ' ' + s for s in self.log.split('\n') ]) + # Put the first log line on the first line + log = name.ljust(20) + ' ' + self.log[0] + + if len(self.log) > 1: + log += '\n' + '\n'.join([' ' + s for s in self.log[1:]]) # Some threads are running in parallel. # Print log atomically to not mix up logs from different threads. print(log, file=(sys.stdout if success else sys.stderr)) From patchwork Thu Aug 10 16:31:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819967 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=kxsBWh2O; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCGx5TQ2z1yYl for ; Fri, 11 Aug 2023 02:36:09 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EBCD586961; Thu, 10 Aug 2023 18:32:42 +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="kxsBWh2O"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 36C0186948; Thu, 10 Aug 2023 18:32:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) (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 2A9CD86913 for ; Thu, 10 Aug 2023 18:32:38 +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-xd32.google.com with SMTP id ca18e2360f4ac-790a8c74383so36949839f.3 for ; Thu, 10 Aug 2023 09:32:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685156; x=1692289956; 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=yFUSCoiA6wN5Tq1kk1vRW+3eaLXLH7lfrwOjcfF4QOI=; b=kxsBWh2OHtc81PrVIvyvE5gfVBgNkuSTAjbjbIJM49NmyCiP9bkHCu6qRtdtPEbpjU OF+B/ngQJEZNE6E7m4PD2zCTgvxgden7xzKwimgmDoJRFM1V+WZ00O0apaZhHy4B2Gj2 EG9ZyXSsfce4jcck0KjvGeByYjpZb6QQAZTGM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685156; x=1692289956; 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=yFUSCoiA6wN5Tq1kk1vRW+3eaLXLH7lfrwOjcfF4QOI=; b=azUktg0sMNU9pifqzxTQ54zXRK1eGDfqfp8BGu1NM3isbOUnkOwnCSproMcaGduCgl 3SaeepeFSbEYqT3OS/GoaIWrF6HaLrEARfQyi8OMomQnyuf2FW7KmNvk07qQvVEnVvuw rwvFfsy+5L6oroJrCnvTAXw2ELTi6fXCcvdb/3IKpuK8BazukCyayImO/a+ogOrHuf1N Qd3mMIlmGKfItqCcCdGFxM32beztqhAao0BzZsRpSvH+TzVIzhXMtX0Tp1VVVPh1H0tZ nYpARbO9wjMFpI+p4cDPSHSj7bZGrCvFGiFkYJN+t8Nh/VfgzC1IVgKAH9hY/PmzUoA1 HZiw== X-Gm-Message-State: AOJu0YxUJv6Y7gstZR7r7gFjPA2E+rCs2fMNju2vG6MSyoY6VYE9/p4W 73xaDCteIIlGMj4xBWSNJL3LW/UmZkvGpUb6a8c= X-Google-Smtp-Source: AGHT+IFvZBb0h0KAjOTasMUgwkLITKODxqAIYX897i4YarY4DUZUmAOTdlGfgkKuZhkc7O/4lGdHgQ== X-Received: by 2002:a5e:a80c:0:b0:786:25cf:421f with SMTP id c12-20020a5ea80c000000b0078625cf421fmr4163800ioa.19.1691685156650; Thu, 10 Aug 2023 09:32:36 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:36 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 20/28] moveconfig: Avoid showing progress at the end Date: Thu, 10 Aug 2023 10:31:52 -0600 Message-ID: <20230810163212.2368374-21-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 When the process is finished, moveconfig leaves a line saying that all boards were processed (for better or worse). Drop this, since it is unncessary. Future work will provide a summary at the end instead. Signed-off-by: Simon Glass --- tools/moveconfig.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index b97f82cd689..f4fb3f46b81 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -282,7 +282,8 @@ class Progress: def show(self): """Display the progress.""" - print(f' {self.current} defconfigs out of {self.total}\r', end=' ') + if self.current != self.total: + print(f' {self.current} defconfigs out of {self.total}\r', end=' ') sys.stdout.flush() From patchwork Thu Aug 10 16:31:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819968 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=DiReLvbt; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCH95TSFz1yYl for ; Fri, 11 Aug 2023 02:36:21 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3D0A186962; Thu, 10 Aug 2023 18:32:43 +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="DiReLvbt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 154EC86907; Thu, 10 Aug 2023 18:32:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (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 CF5F08666E for ; Thu, 10 Aug 2023 18:32:38 +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-il1-x12e.google.com with SMTP id e9e14a558f8ab-3498811fcf8so3805675ab.3 for ; Thu, 10 Aug 2023 09:32:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685157; x=1692289957; 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=rSJI/9zKCBcwxpsdtFt9IisdpARy2QNg419hvhKr1uM=; b=DiReLvbttrN4eQMFHG9J8yg7Zm+MYOY5EHcBTn+attTEnAXKRrvyBBEzyIproipB0W svn11YWdoidVOBU3XiCHMhC2+D0c5fifniOR3HaDR+q+Nam2sy+SMYVDO2QK+/wxnFYP FvLo0xyWOL4quTSk3Hek/sTm697j8muWQH7Wk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685157; x=1692289957; 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=rSJI/9zKCBcwxpsdtFt9IisdpARy2QNg419hvhKr1uM=; b=JCYnieX6JSY3FUkYf6GcJq5lmwxaP/pR/6wn7zaNqfFDbJXyMIeJb3VXfFqI2CUbIa YTEYGZxaASUQxxQKPhmnNdhujiijzr9xaIBEBognkTpAJC+J8Qy2qwmgb6rnNZx9GS0B 1FPCe2JLv0nggYvG6PI610Uf1jO0JuAKwLjK0mIcXBa4CUTw58IuVRmhens9xW0JWJX+ mUoFokIyrkcFLAOYald4AXpsaSHcLoxSd0jukrKWLHkDjQRhevT5axyn8+9Xu6Jsl56q K3SHCD15fZX3w9f8D3NTI47/y3EMHJXLU9W90dnwCPCus6EV8JN/khTdKGAFeKmqcPpg zgWA== X-Gm-Message-State: AOJu0Yxrl6mONaM8qGWDmgfKzuLIvC+z1OPfCpdHd59MYOLBrUEnJNht EC0rV/rdxqV2o0te1XaoylZQlgEoBwneTK0p5UM= X-Google-Smtp-Source: AGHT+IHU5QJMBe0cNaHZCk0S1Uem3s5Iw/zbJVP2L3Sc7toXKb8L1198vdgqK1qbUELChbYnl/3QXg== X-Received: by 2002:a05:6e02:1cac:b0:349:650c:7226 with SMTP id x12-20020a056e021cac00b00349650c7226mr4047173ill.25.1691685157403; Thu, 10 Aug 2023 09:32:37 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:37 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 21/28] moveconfig: Use u_boot_pylib for terminal colour Date: Thu, 10 Aug 2023 10:31:53 -0600 Message-ID: <20230810163212.2368374-22-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Use the existing terminal code to handle ANSI colours. Enable colour by default if the output is going to a terminal. Signed-off-by: Simon Glass --- tools/moveconfig.py | 92 +++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 54 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index f4fb3f46b81..30d8489f7e3 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -33,6 +33,7 @@ import asteval from buildman import bsettings from buildman import kconfiglib from buildman import toolchain +from u_boot_pylib import terminal SHOW_GNU_MAKE = 'scripts/show-gnu-make' SLEEP_TIME=0.03 @@ -42,23 +43,6 @@ STATE_DEFCONFIG = 1 STATE_AUTOCONF = 2 STATE_SAVEDEFCONFIG = 3 -COLOR_BLACK = '0;30' -COLOR_RED = '0;31' -COLOR_GREEN = '0;32' -COLOR_BROWN = '0;33' -COLOR_BLUE = '0;34' -COLOR_PURPLE = '0;35' -COLOR_CYAN = '0;36' -COLOR_LIGHT_GRAY = '0;37' -COLOR_DARK_GRAY = '1;30' -COLOR_LIGHT_RED = '1;31' -COLOR_LIGHT_GREEN = '1;32' -COLOR_YELLOW = '1;33' -COLOR_LIGHT_BLUE = '1;34' -COLOR_LIGHT_PURPLE = '1;35' -COLOR_LIGHT_CYAN = '1;36' -COLOR_WHITE = '1;37' - AUTO_CONF_PATH = 'include/config/auto.conf' CONFIG_DATABASE = 'moveconfig.db' @@ -189,15 +173,6 @@ def get_all_defconfigs(): return defconfigs -def color_text(color_enabled, color, string): - """Return colored string.""" - if color_enabled: - # LF should not be surrounded by the escape sequence. - # Otherwise, additional whitespace or line-feed might be printed. - return '\n'.join([ '\033[' + color + 'm' + s + '\033[0m' if s else '' - for s in string.split('\n') ]) - return string - def write_file(fname, data): """Write data to a file @@ -385,8 +360,8 @@ class Slot: for faster processing. """ - def __init__(self, toolchains, args, progress, devnull, - make_cmd, reference_src_dir, db_queue): + def __init__(self, toolchains, args, progress, devnull, make_cmd, + reference_src_dir, db_queue, col): """Create a new process slot. Args: @@ -398,6 +373,7 @@ class Slot: reference_src_dir: Determine the true starting config state from this source tree. db_queue: output queue to write config info for the database + col (terminal.Color): Colour object """ self.toolchains = toolchains self.args = args @@ -407,6 +383,7 @@ class Slot: self.make_cmd = (make_cmd, 'O=' + self.build_dir) self.reference_src_dir = reference_src_dir self.db_queue = db_queue + self.col = col self.parser = KconfigParser(args, self.build_dir) self.state = STATE_IDLE self.failed_boards = set() @@ -499,12 +476,11 @@ class Slot: def handle_error(self): """Handle error cases.""" - self.log.append(color_text(self.args.color, COLOR_LIGHT_RED, - 'Failed to process')) + self.log.append(self.col.build(self.col.RED, 'Failed to process', + bright=True)) if self.args.verbose: for line in self.proc.stderr.read().decode().splitlines(): - self.log.append(color_text(self.args.color, COLOR_LIGHT_CYAN, - line)) + self.log.append(self.col.build(self.col.CYAN, line, True)) self.finish(False) def do_defconfig(self): @@ -524,8 +500,9 @@ class Slot: try: tchain = self.toolchains.Select(arch) except ValueError: - self.log.append(color_text(self.args.color, COLOR_YELLOW, - f"Tool chain for '{arch}' is missing: do nothing")) + self.log.append(self.col.build( + self.col.YELLOW, + f"Tool chain for '{arch}' is missing: do nothing")) self.finish(False) return env = tchain.MakeEnvironment(False) @@ -567,8 +544,8 @@ class Slot: updated = not filecmp.cmp(orig_defconfig, new_defconfig) if updated: - self.log.append(color_text(self.args.color, COLOR_LIGHT_BLUE, - 'defconfig updated')) + self.log.append( + self.col.build(self.col.BLUE, 'defconfig updated', bright=True)) if not self.args.dry_run and updated: shutil.move(new_defconfig, orig_defconfig) @@ -614,24 +591,27 @@ class Slots: """Controller of the array of subprocess slots.""" - def __init__(self, toolchains, args, progress, reference_src_dir, db_queue): + def __init__(self, toolchains, args, progress, reference_src_dir, db_queue, + col): """Create a new slots controller. Args: - toolchains: Toolchains object containing toolchains. - args: Program arguments - progress: A progress indicator. - reference_src_dir: Determine the true starting config state from this - source tree. - db_queue: output queue to write config info for the database + toolchains (Toolchains): Toolchains object containing toolchains + args (Namespace): Program arguments + progress (Progress): A progress indicator. + reference_src_dir (str): Determine the true starting config state + from this source tree (None for none) + db_queue (Queue): output queue to write config info for the database + col (terminal.Color): Colour object """ self.args = args self.slots = [] + self.col = col devnull = subprocess.DEVNULL make_cmd = get_make_cmd() for _ in range(args.jobs): self.slots.append(Slot(toolchains, args, progress, devnull, - make_cmd, reference_src_dir, db_queue)) + make_cmd, reference_src_dir, db_queue, col)) def add(self, defconfig): """Add a new subprocess if a vacant slot is found. @@ -683,8 +663,8 @@ class Slots: msg = 'The following boards were not processed due to error:\n' msg += boards msg += f'(the list has been saved in {output_file})\n' - print(color_text(self.args.color, COLOR_LIGHT_RED, - msg), file=sys.stderr) + print(self.col.build(self.col.RED, msg, bright=True), + file=sys.stderr) write_file(output_file, boards) @@ -723,13 +703,14 @@ class ReferenceSource: return self.src_dir -def move_config(toolchains, args, db_queue): +def move_config(toolchains, args, db_queue, col): """Build database or sync config options to defconfig files. Args: - toolchains (Toolchains): Toolchains to use - args (Namespace): Program arguments - db_queue (Queue): Queue for database updates + toolchains (Toolchains): Toolchains to use + args (Namespace): Program arguments + db_queue (Queue): Queue for database updates + col (terminal.Color): Colour object """ if args.force_sync: print('Syncing defconfigs', end=' ') @@ -749,7 +730,7 @@ def move_config(toolchains, args, db_queue): defconfigs = get_all_defconfigs() progress = Progress(len(defconfigs)) - slots = Slots(toolchains, args, progress, reference_src_dir, db_queue) + slots = Slots(toolchains, args, progress, reference_src_dir, db_queue, col) # Main loop to process defconfig files: # Add a new subprocess into a vacant slot. @@ -1495,8 +1476,8 @@ doc/develop/moveconfig.rst for documentation.''' 'implying others') parser.add_argument('-b', '--build-db', action='store_true', default=False, help='build a CONFIG database') - parser.add_argument('-c', '--color', action='store_true', default=False, - help='display the log in color') + parser.add_argument('-C', '--nocolour', action='store_true', default=False, + help="don't display the log in colour") parser.add_argument('-d', '--defconfigs', type=str, help='a file containing a list of defconfigs to move, ' "one per line (for example 'snow_defconfig') " @@ -1541,6 +1522,9 @@ doc/develop/moveconfig.rst for documentation.''' return 1 unittest.main() + col = terminal.Color(terminal.COLOR_NEVER if args.nocolour + else terminal.COLOR_IF_TERMINAL) + if args.scan_source: do_scan_source(os.getcwd(), args.update) return 0 @@ -1591,7 +1575,7 @@ doc/develop/moveconfig.rst for documentation.''' toolchains = toolchain.Toolchains() toolchains.GetSettings() toolchains.Scan(verbose=False) - move_config(toolchains, args, db_queue) + move_config(toolchains, args, db_queue, col) db_queue.join() if args.build_db: From patchwork Thu Aug 10 16:31:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819969 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=jfcanlTz; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCHQ4WjMz1yYl for ; Fri, 11 Aug 2023 02:36:34 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 818608696D; Thu, 10 Aug 2023 18:32:43 +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="jfcanlTz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8E5DD86933; Thu, 10 Aug 2023 18:32:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (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 847DC86926 for ; Thu, 10 Aug 2023 18:32:39 +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-il1-x131.google.com with SMTP id e9e14a558f8ab-34995e5b4bfso1646395ab.1 for ; Thu, 10 Aug 2023 09:32:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685158; x=1692289958; 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=c68DHGHJdwQkzp3zJB0LxULIeBowcUpDxbpt86cgssU=; b=jfcanlTzIW4ED+zEEmQFc9NHzzMQ2yxGggcNzsQhqTJmuQDLaBjQjhvGDl0QsKvDwp IbERNivAmVWDmvsDDCJCTT3p5fSCqks8dzXp/f0gsfD4n8WmiVjoNU1MYJKCAfZ/CW7M LEBqvBAQ2KfVOYbWjh6zaR6o3RaSbpaK826Aw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685158; x=1692289958; 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=c68DHGHJdwQkzp3zJB0LxULIeBowcUpDxbpt86cgssU=; b=Y/KEpJrRQaFOckeVFMTc07IfZhRVLCelOX27k/1UXdLP/TYCD5i27GVZ8gaLRXT9LA 7+QL9Hl7kKi/lxJW7PwrSS1h6QA9Ofm6Z0blYCnvKoyIHHPwpEc1ysVeRhTVZwSucGM2 EOaBOlPp1SZbdjIr7YgZazPcKt1X6R+TzUjCzRvnmG97pu9yNJc0ddwq52rnRHvLwDC6 HQ+LLPQFR3MVl+lsr/s0YqpIXB3rJwr34eEINP5r/vfKgvvUURN8qrkx+Y15j3InJ/ME 2DzZzFct+62xBhmK8VR43hVFcSB0NPTubvU9NUbL3Dk9ARiHMJmnvnttAd/uzMzPnV8R /s+g== X-Gm-Message-State: AOJu0YzEeiN9b0vo83/w2Yhy7f0mvAVC0t+S6O3PTmJ5S5l5hgTpNXOU 49t4A8wNIl5gCOq7xHstnx4oYWy4GHv+ghJCUCI= X-Google-Smtp-Source: AGHT+IF/0amVtRXImPHQ5D7lqHKrCFynMAloBFcD8imxjqWDbSW0L5Jmnk5rh+h0GekcA30L41WElw== X-Received: by 2002:a05:6e02:b4e:b0:349:851b:3e48 with SMTP id f14-20020a056e020b4e00b00349851b3e48mr4137335ilu.28.1691685158210; Thu, 10 Aug 2023 09:32:38 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:37 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 22/28] moveconfig: Show failures in progress Date: Thu, 10 Aug 2023 10:31:54 -0600 Message-ID: <20230810163212.2368374-23-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Show the number of accumulated failures when processing. Use a shorter format with colour. An unwanted space appears before the defconfig name on every item except the last. Fix that while we are here. Signed-off-by: Simon Glass --- tools/moveconfig.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 30d8489f7e3..f28863ae4fb 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -241,24 +241,36 @@ class Progress: """Progress Indicator""" - def __init__(self, total): + def __init__(self, col, total): """Create a new progress indicator. Args: - total: A number of defconfig files to process. + color_enabled (bool): True for colour output + total (int): A number of defconfig files to process. """ + self.col = col self.current = 0 + self.good = 0 self.total = total - def inc(self): - """Increment the number of processed defconfig files.""" + def inc(self, success): + """Increment the number of processed defconfig files. + Args: + success (bool): True if processing succeeded + """ + self.good += success self.current += 1 def show(self): """Display the progress.""" if self.current != self.total: - print(f' {self.current} defconfigs out of {self.total}\r', end=' ') + line = self.col.build(self.col.GREEN, f'{self.good:5d}') + line += self.col.build(self.col.RED, + f'{self.current - self.good:5d}') + line += self.col.build(self.col.MAGENTA, + f'/{self.total - self.current}') + print(f'{line} \r', end='') sys.stdout.flush() @@ -578,7 +590,7 @@ class Slot: # Record the failed board. self.failed_boards.add(self.defconfig) - self.progress.inc() + self.progress.inc(success) self.progress.show() self.state = STATE_IDLE @@ -729,7 +741,7 @@ def move_config(toolchains, args, db_queue, col): else: defconfigs = get_all_defconfigs() - progress = Progress(len(defconfigs)) + progress = Progress(col, len(defconfigs)) slots = Slots(toolchains, args, progress, reference_src_dir, db_queue, col) # Main loop to process defconfig files: From patchwork Thu Aug 10 16:31:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819970 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Y4Lg56TW; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCHf2wY7z1yYl for ; Fri, 11 Aug 2023 02:36:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C50CF8693C; Thu, 10 Aug 2023 18:32:45 +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="Y4Lg56TW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8A8158694D; Thu, 10 Aug 2023 18:32:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (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 79E8586913 for ; Thu, 10 Aug 2023 18:32:40 +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-xd29.google.com with SMTP id ca18e2360f4ac-7910620f45dso38916439f.1 for ; Thu, 10 Aug 2023 09:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685159; x=1692289959; 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=DgLhIU8AWmU92I4nMwYAloLGaT99t/+CdbRyVa4IblQ=; b=Y4Lg56TWl+VqhrSWYAZ6PKYisRkf0rT72Lj+m1tmuI6/APzK3mxupqAxlj2sTjxFch DKq6avyRoFCFODGiEA69ZjJUARqR3G4nK61xBEJRDcR3sGw7wswXVN1hrW/i1qYh16AY +HXosav5oizs6dz9IkoGtBxNjfdUBdnzTXceM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685159; x=1692289959; 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=DgLhIU8AWmU92I4nMwYAloLGaT99t/+CdbRyVa4IblQ=; b=IkBW2tCKv4/6qXRfcpwBIn7x26OPNWWUuWvwCzFGp/CSUvaDZk2VtSfip6vOXLnQ92 hwZ0mrZnrLaf2+BwPdbnASc9Jee31gFoB/xT+MO1WapcLU667LE3OZSix6XN/cUNX6lb RVWnUNHxDUpBMeSde7pYdUySIFRgAob8vVlRK0PnyfPTrAw72Nzx/dGIoKfwfq8oqrbe SDdgOUO/w/cuqQw1CgpvR0DsmRSeeJXB60ipfOIdgwEuBvUeIooTj9g+C5pLDl+GC9WQ dfgSJ4SruaZdHdEMZ6E2pznofBUZkB46FQt+I2ft394+mYISdfOyhEunwdl0auW1gNpw xPfw== X-Gm-Message-State: AOJu0YzMsTVkSTF3oZeh185wLLWPB/YGyZbGg8VwBXd2o4KY6abIPp6f bBqls6x2HbrXDR3YwnOywdsMfwAltL6tlGOqY4Y= X-Google-Smtp-Source: AGHT+IGwrcq4pqSc9GRH+9+tM7RFKEj+/ofxbG3tI6R3K4FgaAwD7ZcL+82YLARRU+s6TPOc5EabKw== X-Received: by 2002:a6b:c416:0:b0:790:d6aa:5921 with SMTP id y22-20020a6bc416000000b00790d6aa5921mr3527376ioa.6.1691685158974; Thu, 10 Aug 2023 09:32:38 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:38 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 23/28] moveconfig: Show a summary at the end Date: Thu, 10 Aug 2023 10:31:55 -0600 Message-ID: <20230810163212.2368374-24-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Rather than printing all the failed boards, which are now easily visible on the terminal, just show a summary. Sort it by defconfig and drop the '_defconfig' suffix. Signed-off-by: Simon Glass --- tools/moveconfig.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index f28863ae4fb..0cdf902d14e 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -571,8 +571,8 @@ class Slot: successfully, or False when it fails. """ # output at least 30 characters to hide the "* defconfigs out of *". + name = self.defconfig[:-len('_defconfig')] if self.log: - name = self.defconfig[:-len('_defconfig')] # Put the first log line on the first line log = name.ljust(20) + ' ' + self.log[0] @@ -588,7 +588,7 @@ class Slot: sys.exit('Exit on error.') # If --exit-on-error flag is not set, skip this board and continue. # Record the failed board. - self.failed_boards.add(self.defconfig) + self.failed_boards.add(name) self.progress.inc(success) self.progress.show() @@ -618,6 +618,7 @@ class Slots: """ self.args = args self.slots = [] + self.progress = progress self.col = col devnull = subprocess.DEVNULL make_cmd = get_make_cmd() @@ -662,8 +663,8 @@ class Slots: ret = False return ret - def show_failed_boards(self): - """Display all of the failed boards (defconfigs).""" + def show_result(self): + """Show the results of processing""" boards = set() output_file = 'moveconfig.failed' @@ -671,14 +672,16 @@ class Slots: boards |= slot.get_failed_boards() if boards: - boards = '\n'.join(boards) + '\n' - msg = 'The following boards were not processed due to error:\n' - msg += boards - msg += f'(the list has been saved in {output_file})\n' - print(self.col.build(self.col.RED, msg, bright=True), - file=sys.stderr) - + print(self.col.build( + self.col.RED, + f'{len(boards)} failed (see {output_file})', True)) + boards = '\n'.join(sorted(boards)) + '\n' write_file(output_file, boards) + else: + # Add enough spaces to overwrite the progress indicator + print(self.col.build( + self.col.GREEN, + f'{self.progress.total} processed ', bright=True)) class ReferenceSource: @@ -757,8 +760,7 @@ def move_config(toolchains, args, db_queue, col): while not slots.empty(): time.sleep(SLEEP_TIME) - print('') - slots.show_failed_boards() + slots.show_result() def find_kconfig_rules(kconf, config, imply_config): """Check whether a config has a 'select' or 'imply' keyword From patchwork Thu Aug 10 16:31:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819971 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=SKgAlqCP; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCHt0dh8z1yYl for ; Fri, 11 Aug 2023 02:36:58 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 12D9086974; Thu, 10 Aug 2023 18:32:46 +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="SKgAlqCP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1F2D586962; Thu, 10 Aug 2023 18:32:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (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 180068666E for ; Thu, 10 Aug 2023 18:32:41 +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-il1-x12b.google.com with SMTP id e9e14a558f8ab-34994cad252so1706465ab.2 for ; Thu, 10 Aug 2023 09:32:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685159; x=1692289959; 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=bxoIxD/sg2H8focfL5b8icZrLY26QtCr6buHsBn/df0=; b=SKgAlqCPSRzCb7Z+zWhqWcmiFO7HsT/a14182W9OkKqr0/QpPQX742uMtlEERHOxpS eA+TiwyyWmw6nkCHrhDS90l63G/TZNxjICxib79JRt5XHv+siSSNrrh4KdKu0nNL0qEl TyW3eSLcTwf6v2Wc2vyQ/GyDvQX/C/qZLiuXc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685159; x=1692289959; 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=bxoIxD/sg2H8focfL5b8icZrLY26QtCr6buHsBn/df0=; b=g27uPnU8f10jCdezJFlCJ7FD5n1Qu7VVC3PFq7vChVwBYp6CwW0VWxRet5lYDFa9PW G30lbcH/l3Ko/diK9ratEno+ClhuByOy9/Idn6gIMGks0/uc0lt3Xj72XsH+J4tUhSoT HxZQZ8hNFmXuFsfwO0n6AN06m3ToiBJMVyPkguRQlTLlHrotjjrdqGLHePlCTWab5ONz DuNFyQ7RXGAGU/Ek5M9/DvKTp42Le7SXz6CDkrZIX1GBUm6Qcjfbx6+n7QFwZNY4xtAN XFUBaqtDDpCQVkwgYQlPOX6dJpRM8ODPaAE5+jsy+fzMd6S+fSw/BgnUcv6UnrtB0Ami PlOg== X-Gm-Message-State: AOJu0YzXf62k67ygcJTOpmdBkggcNYUhoCeQB68qS3WVwlti3Z2dmCLC mYHohrJaZMoo+ig4s9UrkwJSghVZ4I2BJAasex0= X-Google-Smtp-Source: AGHT+IEnMyfdvzWbl5c4aXuo0wQXK7ukTPTwlt6v6DRI/Uz/o1lt5h2rvQHtEojXOUEHI7QrucfxKA== X-Received: by 2002:a05:6e02:156f:b0:348:e9e4:4902 with SMTP id k15-20020a056e02156f00b00348e9e44902mr4315221ilu.0.1691685159737; Thu, 10 Aug 2023 09:32:39 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:39 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 24/28] moveconfig: Drop the initial output Date: Thu, 10 Aug 2023 10:31:56 -0600 Message-ID: <20230810163212.2368374-25-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Since moveconfig now just does what it is told (build database or sync defconfigs) we don't need to print what it is doing. Drop this info, which is of very little use. Signed-off-by: Simon Glass --- tools/moveconfig.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 0cdf902d14e..4ff5cf9d5b7 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -727,12 +727,6 @@ def move_config(toolchains, args, db_queue, col): db_queue (Queue): Queue for database updates col (terminal.Color): Colour object """ - if args.force_sync: - print('Syncing defconfigs', end=' ') - elif args.build_db: - print(f'Building {CONFIG_DATABASE} database') - print(f'(jobs: {args.jobs})\n') - if args.git_ref: reference_src = ReferenceSource(args.git_ref) reference_src_dir = reference_src.get_dir() From patchwork Thu Aug 10 16:31:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819972 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Zy1nhjjU; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCJ66TdQz1yYl for ; Fri, 11 Aug 2023 02:37:10 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 53CE08697E; Thu, 10 Aug 2023 18:32:46 +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="Zy1nhjjU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 75B0286977; Thu, 10 Aug 2023 18:32:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) (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 4FE8786933 for ; Thu, 10 Aug 2023 18:32:42 +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-pl1-x62b.google.com with SMTP id d9443c01a7336-1bc6535027aso9730635ad.2 for ; Thu, 10 Aug 2023 09:32:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685160; x=1692289960; 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=TsS51ekyddUSKK8hw92RLT3YrpXPSswOXRDLZY0n8Fo=; b=Zy1nhjjUxbb0TFBG//PRzBDsJcjvtKgUF9tCRGUN6p6n32artJ/ccjohkX0ELW6xCv RHj7igpRuz+oLpof7LWXC08bo9RCWXqicLZqV+ImGOiWOSsOv+gUBDirubL7KI7EsiDp 4I7Cxt5ckz+AF4bvQ9S9/2r5S7FqVgB3ITnnc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685160; x=1692289960; 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=TsS51ekyddUSKK8hw92RLT3YrpXPSswOXRDLZY0n8Fo=; b=d0fDP0bAYaRuQEZFC1czoucBxaTsJfsTOwluhbU2AW3n9olhBN5weYWrenDC3FuT5W rECUB4XVEDP24NeT+4U24cJ8HG1jCWgBMNoNMTYgP65DA5iDYt/uyy2x3nyjY6dKHLhr JOFasvd9sB+dPAbSLr8DOAW+fZne+JIHYz3KCS+4Q5FqGa78gExbdJT/SlnSC+3n6Jlz Da0uPUmljvkhvBzLvE4RTAuMiW/U5CYVTz3ctw8vAwGRyQa0Vr3RMz4t6qz8T61lKiUA NIwtOU1oboKGdLwcZe+6YBgiuA1vh5+62zlC2bZ1W8iB1gD9DjRWPexHgXOAaB1K0j2l 2iiA== X-Gm-Message-State: AOJu0YwZXJ311mJloIBdWO2+ohGnYZufqvcsMTKYAObHJXByIzjxENlQ Qc1OsYiLs8lB8Z5Ic1X8jg4iLTDi4Lp2dpqJlKo= X-Google-Smtp-Source: AGHT+IH7nA4msQmcG43sHBJntWxEzBk+pq0fI4zKrgjznTN+xAR8IFs0+AsLScohEht7YSnXwOipzQ== X-Received: by 2002:a17:902:b783:b0:1bb:ed06:72da with SMTP id e3-20020a170902b78300b001bbed0672damr2824972pls.14.1691685160606; Thu, 10 Aug 2023 09:32:40 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:40 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 25/28] moveconfig: Move summaries to the end Date: Thu, 10 Aug 2023 10:31:57 -0600 Message-ID: <20230810163212.2368374-26-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Write the summary for -s and -b at the end, using a unified format. Signed-off-by: Simon Glass --- tools/moveconfig.py | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 4ff5cf9d5b7..c86f65a7c83 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -45,6 +45,7 @@ STATE_SAVEDEFCONFIG = 3 AUTO_CONF_PATH = 'include/config/auto.conf' CONFIG_DATABASE = 'moveconfig.db' +FAILED_LIST = 'moveconfig.failed' CONFIG_LEN = len('CONFIG_') @@ -663,25 +664,17 @@ class Slots: ret = False return ret - def show_result(self): + def write_failed_boards(self): """Show the results of processing""" boards = set() - output_file = 'moveconfig.failed' for slot in self.slots: boards |= slot.get_failed_boards() if boards: - print(self.col.build( - self.col.RED, - f'{len(boards)} failed (see {output_file})', True)) boards = '\n'.join(sorted(boards)) + '\n' - write_file(output_file, boards) - else: - # Add enough spaces to overwrite the progress indicator - print(self.col.build( - self.col.GREEN, - f'{self.progress.total} processed ', bright=True)) + write_file(FAILED_LIST, boards) + class ReferenceSource: @@ -726,6 +719,9 @@ def move_config(toolchains, args, db_queue, col): args (Namespace): Program arguments db_queue (Queue): Queue for database updates col (terminal.Color): Colour object + + Returns: + Progress: Progress indicator """ if args.git_ref: reference_src = ReferenceSource(args.git_ref) @@ -754,7 +750,8 @@ def move_config(toolchains, args, db_queue, col): while not slots.empty(): time.sleep(SLEEP_TIME) - slots.show_result() + slots.write_failed_boards() + return progress def find_kconfig_rules(kconf, config, imply_config): """Check whether a config has a 'select' or 'imply' keyword @@ -1583,9 +1580,11 @@ doc/develop/moveconfig.rst for documentation.''' toolchains = toolchain.Toolchains() toolchains.GetSettings() toolchains.Scan(verbose=False) - move_config(toolchains, args, db_queue, col) + progress = move_config(toolchains, args, db_queue, col) db_queue.join() + failed = progress.total - progress.good + failure = f'{failed} failed, ' if failed else '' if args.build_db: with open(CONFIG_DATABASE, 'w', encoding='utf-8') as outf: for defconfig, configs in config_db.items(): @@ -1593,6 +1592,17 @@ doc/develop/moveconfig.rst for documentation.''' for config in sorted(configs.keys()): outf.write(f' {config}={configs[config]}\n') outf.write('\n') + print(col.build( + col.RED if failed else col.GREEN, + f'{failure}{len(config_db)} boards written to {CONFIG_DATABASE}')) + else: + if failed: + print(col.build(col.RED, f'{failure}see {FAILED_LIST}', True)) + else: + # Add enough spaces to overwrite the progress indicator + print(col.build( + col.GREEN, f'{progress.total} processed ', bright=True)) + return 0 From patchwork Thu Aug 10 16:31:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819973 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=jgwKHlMq; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCJM0DgHz1yYl for ; Fri, 11 Aug 2023 02:37:23 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 937BF86978; Thu, 10 Aug 2023 18:32:46 +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="jgwKHlMq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A70E486942; Thu, 10 Aug 2023 18:32:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) (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 A2B2086922 for ; Thu, 10 Aug 2023 18:32:42 +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-xd32.google.com with SMTP id ca18e2360f4ac-791071b9a5eso35155839f.3 for ; Thu, 10 Aug 2023 09:32:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685161; x=1692289961; 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=RiXXWrYlmueiJj2n03K2IpTS/Ux09ZKxozxiF70vUdU=; b=jgwKHlMqQtua7s2VT3OvdjQWVkhvJSPNMzZ2a6PxzmGi1Vl/d0ymFOpy848XtP7zcK jRyc1YHD1qiBZqIBXpTo/OLoditDtHujzkiCRL0fXjKRCpDZzo0OPk5GH5vkkcjjSlF/ E3elNyruCARHW3+SBaQvyW+12KMfZVHpiTRsY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685161; x=1692289961; 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=RiXXWrYlmueiJj2n03K2IpTS/Ux09ZKxozxiF70vUdU=; b=e47cVUVQ4GMeOZo82tQQIoO+m1UdB8RooFr5n+GNY6tYhj/5UqdokFD5yV66mPaDWy wwQ5Ugoocj5GZdhebDRnNMKS8vcAMdcOnNkiKn4ZXyyuCzkwp0z3wtyjN/UWu2HD1UV7 2lB6kugoMsQP3QFyEh4sUCqO3oVF7mTvYamcamCPqQVGqc6sU6qYCm6W/U/8NsZtwt5r l5gcLqvzW3gmMlGVYEkkT/xhgRuGJE0BHtHh164vcRQTuo4Pt6mN8/yX11BpZKUqd61b UVx2Ylh4aCGe71LJU4lv7lEMkoXkVSZiz0wX9I8MN4hsaq9svOZYe5lsU4MKaj+TCwQv VwfA== X-Gm-Message-State: AOJu0Ywgnh7aHzkoG2jFQbw4dxCBozsPlSXRG0MbNSFekwBQ7g8SSdIZ SWVOHebCHd4S3ApEqhrNKlUhclOC1pIkUtWbniM= X-Google-Smtp-Source: AGHT+IETszDYBoe1pFr7fiP22u2q5XXa2/Tn1EgkvQ80LDYISye22XNkbe21gMPaV+yNFDM153QDNQ== X-Received: by 2002:a5d:9e05:0:b0:790:f866:d71b with SMTP id h5-20020a5d9e05000000b00790f866d71bmr3492189ioh.13.1691685161316; Thu, 10 Aug 2023 09:32:41 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:41 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass Subject: [PATCH 26/28] moveconfig: Rename the tool to qconfig Date: Thu, 10 Aug 2023 10:31:58 -0600 Message-ID: <20230810163212.2368374-27-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 This does not move configs anymore, but queries them, based on a database it can build. Rename the tool to better reflect its purpose. Signed-off-by: Simon Glass --- tools/{moveconfig.py => qconfig.py} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename tools/{moveconfig.py => qconfig.py} (99%) diff --git a/tools/moveconfig.py b/tools/qconfig.py similarity index 99% rename from tools/moveconfig.py rename to tools/qconfig.py index c86f65a7c83..875e467c274 100755 --- a/tools/moveconfig.py +++ b/tools/qconfig.py @@ -5,7 +5,7 @@ # """ -Move config options from headers to defconfig files. +Build and query a Kconfig database for boards. See doc/develop/moveconfig.rst for documentation. """ @@ -900,7 +900,7 @@ def do_imply_config(config_list, add_imply, imply_flags, skip_added, all x86 boards will have that option, avoiding adding CONFIG_CMD_IRQ to each of the x86 defconfig files. - This function uses the moveconfig database to find such options. It + This function uses the qconfig database to find such options. It displays a list of things that could possibly imply those in the list. The algorithm ignores any that start with CONFIG_TARGET since these typically refer to only a few defconfigs (often one). It also does not From patchwork Thu Aug 10 16:31:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819974 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=WObC3rKA; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCJb3hNsz1yYl for ; Fri, 11 Aug 2023 02:37:35 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D58EB86942; Thu, 10 Aug 2023 18:32:47 +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="WObC3rKA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9B6BC86926; Thu, 10 Aug 2023 18:32:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (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 9BDE686970 for ; Thu, 10 Aug 2023 18:32:43 +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-il1-x135.google.com with SMTP id e9e14a558f8ab-3492e8fb906so3917085ab.3 for ; Thu, 10 Aug 2023 09:32:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685162; x=1692289962; 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=iuF1oyIV9jsMpAq03/5zYr477uG8wMzdNvig8chhsoc=; b=WObC3rKAOlX6j+Hv3S8CEPcwd08i8Du0QP3QZtJK/L/GZlHdX0b8qG1xnPRffxJWwP HlYZAQtzKyeE6ouyrTkqVX3wWf127zOrTg2dZo7gnDroeYG7snGSTXqj89/GV6pC+vhU BVvIN1noCvbPfiM8SYanqJXbO+DU78c5mWC1c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685162; x=1692289962; 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=iuF1oyIV9jsMpAq03/5zYr477uG8wMzdNvig8chhsoc=; b=TXk37PwulwdGPOsQtv1lcGiSzNBbsxuj+ub0pJgy5x2h/jdutlJ+fHfiQ5GkAAHSxj FPXbYzwAkWtZcVq4+HquoZrir2yrA3yAtxwkbP27Vsr/e5E93a5cS8YskD+lvgIjm/pk 7XmtHXxLLKtvj7inXum+v0M3/OA2J0vWYqh1m8oYit28MlmsdDA9qWbaw3qWT+1DoHMq syDLeCNZi/3Y+aecR+wUzKyG7a7jYprDM6dsEGzX5jdYGE1rnGXqS79txU0EROyed6S7 /C/fsJZ0u1eImopHk0ewUaQtcKX10pEd+FsqbfKJb9mRXITMxBxTIUtVEU7ZSnTSw7Fy mB9g== X-Gm-Message-State: AOJu0YzN3nvwNsgTL8O1yDikfhqTDUTgfq9a9M1E6YJSobL17ox2Lmch 9rBwzQdCEYrX983YxNbLMnnI9tvsQ7PZ2CBuWyY= X-Google-Smtp-Source: AGHT+IG+cimHti3KpZP3CW5u3GXVALkR0ih8ti0MGQO4Ry1eErlTi1bAeTAg+JZArm/v/51O891ctw== X-Received: by 2002:a05:6e02:1d18:b0:345:fbdc:bb78 with SMTP id i24-20020a056e021d1800b00345fbdcbb78mr3765164ila.29.1691685162305; Thu, 10 Aug 2023 09:32:42 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:41 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass , Maxim Cournoyer , Michael Trimarchi Subject: [PATCH 27/28] qconfig: Rename the database file Date: Thu, 10 Aug 2023 10:31:59 -0600 Message-ID: <20230810163212.2368374-28-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Use qconfig.db as the new name, to reflect the tool's purpose. Signed-off-by: Simon Glass --- .gitignore | 4 ++-- tools/qconfig.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 002f95de4fe..7f64446db3c 100644 --- a/.gitignore +++ b/.gitignore @@ -107,5 +107,5 @@ __pycache__ /pylint.cur /pylint.out/ -# moveconfig database -/moveconfig.db +# qconfig database +/qconfig.db diff --git a/tools/qconfig.py b/tools/qconfig.py index 875e467c274..8177370587d 100755 --- a/tools/qconfig.py +++ b/tools/qconfig.py @@ -44,8 +44,8 @@ STATE_AUTOCONF = 2 STATE_SAVEDEFCONFIG = 3 AUTO_CONF_PATH = 'include/config/auto.conf' -CONFIG_DATABASE = 'moveconfig.db' -FAILED_LIST = 'moveconfig.failed' +CONFIG_DATABASE = 'qconfig.db' +FAILED_LIST = 'qconfig.failed' CONFIG_LEN = len('CONFIG_') From patchwork Thu Aug 10 16:32:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1819975 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=JcwAR1rO; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RMCJq0fh3z1yYl for ; Fri, 11 Aug 2023 02:37:47 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 21C658698D; Thu, 10 Aug 2023 18:32:48 +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="JcwAR1rO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 108D78698B; Thu, 10 Aug 2023 18:32:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (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 93C268694E for ; Thu, 10 Aug 2023 18:32:44 +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-xd2f.google.com with SMTP id ca18e2360f4ac-79194701ce9so10350839f.1 for ; Thu, 10 Aug 2023 09:32:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691685163; x=1692289963; 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=0GEW2JIxrGXWwMaLfdX8CSMiz0j4zJZNTfQwHILSm+M=; b=JcwAR1rOTdozC2izBgFUZxxgKVT/iPy0VQx5o60qEW7qL0Zqsbudb0pCnFSzlSE8u9 8ztTloS9J9Hi8N8FkU/+GWcn+kB+v1Pj2jDj3RDvrsliswawtIcUW8OpHo/D/iFb8Dlw 9yZr/zYDYKUASL9+8xhYp6YQbvL4wIacYfsAM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691685163; x=1692289963; 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=0GEW2JIxrGXWwMaLfdX8CSMiz0j4zJZNTfQwHILSm+M=; b=D92LRNv4Lxd1vFiNfC0yNEiFvMgcAzGqFkZux8q8ZYCRTj7c58ja3Pm13eilWdUSrF PbwUrbemS4H5dqO3HlNae0JjJYpy03MaCFfEi+XVXrGYU1XaqXKGGgz2pbF0O8whjqME ixd5olTEoQ27L/oLHWRvwGVBtBfhMNx9gkNQ7Lv39u+n097RSPKj/FbYSz3+OlNn6yCC Rjb4mlxe2KxT5k/oVZbTnD9Io3cIaVAywbW5cvkFP0LZ5BywzGLgcNhdFnizOqWLIzfr zBmtWcUByxHyQEiVhW7tdc8ol0RpYdHNIcBSP7Gu4z/7Ud87SIGjBYBkepLmrB4gc/Vw Sm4g== X-Gm-Message-State: AOJu0Ywb8dGV/soMESxouV6xGerHakjx9LDebdCOP8ih1r1LJ2BYRjYf Yz0X9QMoQdxNwFvFNd0W42ZacuXIw8HD6Xxbv7M= X-Google-Smtp-Source: AGHT+IHGVa4hMUOeuuwyOwcDoqwitso2QY7cUIj9Hm4OrHuBwEOtl6ATf/pFEQFP8jUtdiOPASbyng== X-Received: by 2002:a05:6602:3348:b0:790:c461:6f34 with SMTP id c8-20020a056602334800b00790c4616f34mr4158525ioz.3.1691685163042; Thu, 10 Aug 2023 09:32:43 -0700 (PDT) Received: from kea.bld.corp.google.com ([2620:15c:183:200:e0a2:950d:33f0:fddc]) by smtp.gmail.com with ESMTPSA id u21-20020a02aa95000000b0042b28813816sm487309jai.14.2023.08.10.09.32.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 09:32:42 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Masahiro Yamada , Simon Glass , Heinrich Schuchardt , Stefan Roese Subject: [PATCH 28/28] qconfig: Update the documentation Date: Thu, 10 Aug 2023 10:32:00 -0600 Message-ID: <20230810163212.2368374-29-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.640.ga95def55d0-goog In-Reply-To: <20230810163212.2368374-1-sjg@chromium.org> References: <20230810163212.2368374-1-sjg@chromium.org> MIME-Version: 1.0 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 Update qconfig's documentation to better reflect its new purpose in life. Signed-off-by: Simon Glass --- doc/develop/index.rst | 2 +- doc/develop/{moveconfig.rst => qconfig.rst} | 148 +++++--------------- 2 files changed, 38 insertions(+), 112 deletions(-) rename doc/develop/{moveconfig.rst => qconfig.rst} (60%) diff --git a/doc/develop/index.rst b/doc/develop/index.rst index 5b230d0321f..8bd08fd17f9 100644 --- a/doc/develop/index.rst +++ b/doc/develop/index.rst @@ -87,7 +87,7 @@ Refactoring checkpatch coccinelle - moveconfig + qconfig Code quality ------------ diff --git a/doc/develop/moveconfig.rst b/doc/develop/qconfig.rst similarity index 60% rename from doc/develop/moveconfig.rst rename to doc/develop/qconfig.rst index ad8596e6c61..22bfe2bd2a7 100644 --- a/doc/develop/moveconfig.rst +++ b/doc/develop/qconfig.rst @@ -1,100 +1,37 @@ .. SPDX-License-Identifier: GPL-2.0+ -moveconfig - Migrating and querying CONFIG options -================================================== +qconfig - Querying CONFIG options +================================= -Since Kconfig was introduced to U-Boot, we have worked on moving -config options from headers to Kconfig (defconfig). +It is not possible to see all the CONFIG options used by a board without +building its `.config` file. This tool allowing this to be done efficiently for +all boards, or a subset, writing the results to a unified database file. -This tool intends to help this tremendous work. +This database can be queried, to find boards which used a certain combination +of options, to aid in discovering Kconfig options which imply others. + +The tool also permits syncing of defconfigs, which corrects the ordering and +drops options which are implied by others. + +Finally, it allow scanning the source code to look for inconsistencies in the +use of Kconfig options. Installing ---------- You may need to install 'python3-asteval' for the 'asteval' module. -Usage ------ - -First, you must edit the Kconfig to add the menu entries for the configs -you are moving. - -Then run this tool giving CONFIG names you want to move. -For example, if you want to move CONFIG_CMD_USB and CONFIG_TEXT_BASE, -simply type as follows:: - - $ tools/moveconfig.py CONFIG_CMD_USB CONFIG_TEXT_BASE - -The tool walks through all the defconfig files and move the given CONFIGs. - -The log is also displayed on the terminal. - -The log is printed for each defconfig as follows:: - - - - - - ... - -`` is the name of the defconfig. - -`` shows what the tool did for that defconfig. -It looks like one of the following: - - - Move 'CONFIG\_... ' - This config option was moved to the defconfig - - - CONFIG\_... is not defined in Kconfig. Do nothing. - The entry for this CONFIG was not found in Kconfig. The option is not - defined in the config header, either. So, this case can be just skipped. - - - CONFIG\_... is not defined in Kconfig (suspicious). Do nothing. - This option is defined in the config header, but its entry was not found - in Kconfig. - There are two common cases: - - - You forgot to create an entry for the CONFIG before running - this tool, or made a typo in a CONFIG passed to this tool. - - The entry was hidden due to unmet 'depends on'. - - The tool does not know if the result is reasonable, so please check it - manually. - - - 'CONFIG\_...' is the same as the define in Kconfig. Do nothing. - The define in the config header matched the one in Kconfig. - We do not need to touch it. - - - Compiler is missing. Do nothing. - The compiler specified for this architecture was not found - in your PATH environment. - (If -e option is passed, the tool exits immediately.) - - - Failed to process. - An error occurred during processing this defconfig. Skipped. - (If -e option is passed, the tool exits immediately on error.) - -Finally, you will be asked, Clean up headers? [y/n]: - -If you say 'y' here, the unnecessary config defines are removed -from the config headers (include/configs/\*.h). -It just uses the regex method, so you should not rely on it. -Just in case, please do 'git diff' to see what happened. - - How does it work? ----------------- -This tool runs configuration and builds include/autoconf.mk for every -defconfig. The config options defined in Kconfig appear in the .config -file (unless they are hidden because of unmet dependency.) +When building a database (`-b`), this tool runs configuration and builds +include/autoconf.mk for every defconfig. The config options defined in Kconfig +appear in the .config file (unless they are hidden because of unmet dependency.) On the other hand, the config options defined by board headers are seen -in include/autoconf.mk. The tool looks for the specified options in both -of them to decide the appropriate action for the options. If the given -config option is found in the .config, but its value does not match the -one from the board header, the config option in the .config is replaced -with the define in the board header. Then, the .config is synced by -"make savedefconfig" and the defconfig is updated with it. +in include/autoconf.mk. + +When resyncing defconfigs (`-s`) the .config is synced by "make savedefconfig" +and the defconfig is updated with it. For faster processing, this tool handles multi-threading. It creates separate build directories where the out-of-tree build is run. The @@ -109,7 +46,7 @@ Toolchains Appropriate toolchain are necessary to generate include/autoconf.mk for all the architectures supported by U-Boot. Most of them are available at the kernel.org site, some are not provided by kernel.org. This tool uses -the same tools as buildman, so see that tool for setup (e.g. --fetch-arch). +the same tools as buildman, so see that tool for setup (e.g. `--fetch-arch`). Tips and trips @@ -117,32 +54,32 @@ Tips and trips To sync only X86 defconfigs:: - ./tools/moveconfig.py -s -d <(grep -l X86 configs/*) + ./tools/qconfig.py -s -d <(grep -l X86 configs/*) or:: - grep -l X86 configs/* | ./tools/moveconfig.py -s -d - + grep -l X86 configs/* | ./tools/qconfig.py -s -d - To process CONFIG_CMD_FPGAD only for a subset of configs based on path match:: ls configs/{hrcon*,iocon*,strider*} | \ - ./tools/moveconfig.py -Cy CONFIG_CMD_FPGAD -d - + ./tools/qconfig.py -Cy CONFIG_CMD_FPGAD -d - Finding boards with particular CONFIG combinations -------------------------------------------------- -You can use `moveconfig.py` to figure out which boards have a CONFIG enabled, or +You can use `qconfig.py` to figure out which boards have a CONFIG enabled, or which do not. To use it, first build a database:: - ./tools/moveconfig.py -b + ./tools/qconfig.py -b Then you can run queries using the `-f` flag followed by a list of CONFIG terms. Each term is CONFIG name, with or without a tilde (~) prefix. The tool searches for boards which match the CONFIG name, or do not match if tilde is used. For example, to find boards which enabled CONFIG_SCSI but not CONFIG_BLK:: - tools/moveconfig.py -f SCSI ~BLK + tools/qconfig.py -f SCSI ~BLK 3 matches pg_wcom_seli8_defconfig highbank_defconfig pg_wcom_expu1_defconfig @@ -158,11 +95,11 @@ each of the x86 defconfig files. This tool can help find such configs. To use it, first build a database:: - ./tools/moveconfig.py -b + ./tools/qconfig.py -b Then try to query it:: - ./tools/moveconfig.py -i CONFIG_I8042_KEYB + ./tools/qconfig.py -i CONFIG_I8042_KEYB CONFIG_I8042_KEYB found in 33/5155 defconfigs 28 : CONFIG_X86 28 : CONFIG_SA_PCIEX_LENGTH @@ -193,12 +130,12 @@ indicates that CONFIG_I8042_KEYB is not needed for the remaining 5 boards. Many of the options listed are not suitable as they are not related. E.g. it would be odd for CONFIG_RAMBASE to imply CONFIG_I8042_KEYB. -Using this search you can reduce the size of moveconfig patches. +Using this search you can reduce the size of qconfig patches. You can automatically add 'imply' statements in the Kconfig with the -a option:: - ./tools/moveconfig.py -s -i CONFIG_SCSI \ + ./tools/qconfig.py -s -i CONFIG_SCSI \ -a CONFIG_ARCH_LS1021A,CONFIG_ARCH_LS1043A This will add 'imply SCSI' to the two CONFIG options mentioned, assuming that @@ -220,7 +157,7 @@ the size of their defconfig files. If you want to add an 'imply' to every imply config in the list, you can use:: - ./tools/moveconfig.py -s -i CONFIG_SCSI -a all + ./tools/qconfig.py -s -i CONFIG_SCSI -a all To control which ones are displayed, use -I where list is a list of options (use '-I help' to see possible options and their meaning). @@ -230,7 +167,7 @@ To skip showing you options that already have an 'imply' attached, use -A. When you have finished adding 'imply' options you can regenerate the defconfig files for affected boards with something like:: - git show --stat | ./tools/moveconfig.py -s -d - + git show --stat | ./tools/qconfig.py -s -d - This will regenerate only those defconfigs changed in the current commit. If you start with (say) 100 defconfigs being changed in the commit, and add @@ -241,13 +178,9 @@ number of defconfigs changed in the commit. Available options ----------------- - -c, --color - Surround each portion of the log with escape sequences to display it - in color on the terminal. - - -C, --commit - Create a git commit with the changes when the operation is complete. A - standard commit message is used which may need to be edited. + --nocolour + Disables colouring of output. This is normally used when writing to a + terminal. -d, --defconfigs Specify a file containing a list of defconfigs to move. The defconfig @@ -275,9 +208,6 @@ Available options because SPL related options (mostly prefixed with CONFIG_SPL\_) are sometimes blocked by CONFIG_SPL_BUILD ifdef conditionals. - -H, --headers-only - Only cleanup the headers; skip the defconfig processing - -j, --jobs Specify the number of threads to run simultaneously. If not specified, the number of threads is the same as the number of CPU cores. @@ -293,10 +223,6 @@ 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, the config whitelist and the README. - To see the complete list of supported options, run:: - tools/moveconfig.py -h + tools/qconfig.py -h