Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 32BB5C0015E for ; Sun, 16 Jul 2023 00:39:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3DBF086620; Sun, 16 Jul 2023 02:38:08 +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="YWo00pUp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 034CF86351; Sun, 16 Jul 2023 02:37:40 +0200 (CEST) Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (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 562C7862DA for ; Sun, 16 Jul 2023 02:37: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-x130.google.com with SMTP id e9e14a558f8ab-34574eb05f4so13895265ab.0 for ; Sat, 15 Jul 2023 17:37:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689467852; x=1692059852; 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=7euRVRMN4qbM3Lu8wgRBNyy6mEY6vrWFwh7CKPoMSqA=; b=YWo00pUpPmCkKhZLnZp98YdHeSAjR/0mbxG/DJRrxVSBNhaLyi1fYi5kPDjE0rl1CQ TdpGni1EZ24NU7M5DZWB0RpbIS+WpYUF4feJf7TPHOE5TkbFT3eKfpto+oXLhAgL5kqO c/QjzekontfT59dhNiRTZvGI1SfusJfnrKdoI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689467852; x=1692059852; 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=7euRVRMN4qbM3Lu8wgRBNyy6mEY6vrWFwh7CKPoMSqA=; b=dZIViG3gEfr/t30mNOAISAdOSYWNCBEr2tu7XZIO/TX1hor5/lzfs/FYAcHH/Ojy9q H0qVCXVtUcLhhuXZdEDQwUq9RuhJH7dDx32oLe4AegZNj7XDe4fX5miRKhaHnkaAhHii UpiIaHlvAkeuAmIv24GzAiJAOZClfJ6IR7hfwItIQ4QWj26IbhlNHswvwqGNhfotRiEu hpSWyxq57ksttp8JFDWcRzThWDDRBpTs+q3mq+PI07SiZxARmYhe0yRDfIppQLnTVWn6 xox/jfUs0bzlZ1IEVunmKpdq7RnkUeUFjy+YMMOOOQr/Ao+KmvtSRIWpdJ3WD3cG4I3e Rnyg== X-Gm-Message-State: ABy/qLZj58oczonI2CT4Pv/ro8GDfQFwKO9BbiU+x40P1j7XjkZUiC2Z qzQZAILqnX1R8/yYhmIA3vRWVEtQRXeoJg8VM6Y= X-Google-Smtp-Source: APBJJlFWACY9N4eE2q1LzjVb4jJR9FgTKNgcww8fVwMiVQM7vQqy5p+nhkygAYOTbkmW0mfdwnwTEQ== X-Received: by 2002:a6b:fe02:0:b0:777:b4af:32a3 with SMTP id x2-20020a6bfe02000000b00777b4af32a3mr8370854ioh.14.1689467851920; Sat, 15 Jul 2023 17:37:31 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id t3-20020a05663801e300b0042b52dc77e3sm3510512jaq.158.2023.07.15.17.37.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jul 2023 17:37:31 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v3 12/81] buildman: Refactor target handling in Boards.scan() Date: Sat, 15 Jul 2023 18:35:40 -0600 Message-ID: <20230716003718.231903-13-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.455.g037347b96a-goog In-Reply-To: <20230716003718.231903-1-sjg@chromium.org> References: <20230716003718.231903-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Move the assert to the top of the function and provide an explicit variables for the target name and base name. Signed-off-by: Simon Glass --- Changes in v3: - Add new patch to refactor target handling in Boards.scan() tools/buildman/boards.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index a606ce27aef7..794e6fcf63bf 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -231,6 +231,10 @@ class KconfigScanner: 'config': , } """ + leaf = os.path.basename(defconfig) + expect_target, match, rear = leaf.partition('_defconfig') + assert match and not rear, f'{leaf} : invalid defconfig' + self._conf.load_config(defconfig) self._tmpfile = None @@ -245,9 +249,7 @@ class KconfigScanner: else: params[key] = '-' - defconfig = os.path.basename(defconfig) - params['target'], match, rear = defconfig.partition('_defconfig') - assert match and not rear, f'{defconfig} : invalid defconfig' + params['target'] = expect_target # fix-up for aarch64 if params['arch'] == 'arm' and params['cpu'] == 'armv8': -- 2.41.0.455.g037347b96a-goog