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 58942C001B0 for ; Wed, 19 Jul 2023 23:52:31 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 53AA4867DB; Thu, 20 Jul 2023 01:50: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="InPSUbHS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EB0E18679B; Thu, 20 Jul 2023 01:50:15 +0200 (CEST) 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 894AF86795 for ; Thu, 20 Jul 2023 01:50:09 +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-785cbc5bfd2so8753039f.2 for ; Wed, 19 Jul 2023 16:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689810608; x=1690415408; 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=J1IEVnqbCaGTWS1WHrmjEaPykVcfz/BwMZMORrtNyxs=; b=InPSUbHSMHzF8m9jX6W/Tl4GGMfAPsYjFS3N6Dh/IsnTQWCaE+gzoDBFIjFUVE13ne noN781I9PL2IcvFwh9ryRkLorSXynL5gbwQy6AuEZ2jFDN4JxKRS8ORViyCJlfyYrNCr 8vjapfA5O/ZJzKn++mchyHBonpAZwSq9o0z9M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689810608; x=1690415408; 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=J1IEVnqbCaGTWS1WHrmjEaPykVcfz/BwMZMORrtNyxs=; b=XArqnLL/rhwF0LZYd07NCkm/eKKsfJx3t0ba1IoKr7EsjSxfj3t9PQZ9EAmpjGZu3g zb/jXjhEBH7xbFpr+NgMlVdyVQ3Rc1+JYWC9iD1+999/gl3g3vwgFg6FMwpX5ohAMytV bnFD8vSDsYEllWDmLJYkboBgynok8g6MlrzrwbXyG98bOyN7A6hNMeIYCAd6B0Ma46i6 x4gnqcrsPSnPZuknfex9ZdzHnqKmoN50J3RnkbF+xKbmlJwPQqDc4d/qlEI9W/sC08n3 txIf3XKzEjQv9HOFonNPaCXgsVmm+ldQ85C0M436eb8QIrBNHCNao7eAq6cbCB2enovw 6lDw== X-Gm-Message-State: ABy/qLapbQQGpXiXLQaEYdr2jo/yxRe4yuPJcAXNL/g3WdwplvG8J2wB o8BWBdomvguo9JC+AiC79rScobumvlKEECOAJWA= X-Google-Smtp-Source: APBJJlHxyuODvX8YJk3KPLyEB8ivGVpyLxorv95hWwOfCeALsfSw5vrjOZTT76m0zv50znUAro1TDg== X-Received: by 2002:a6b:d919:0:b0:786:285f:a9b2 with SMTP id r25-20020a6bd919000000b00786285fa9b2mr6614237ioc.12.1689810608100; Wed, 19 Jul 2023 16:50:08 -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 ed16-20020a056638291000b0042bb1779c18sm1551779jab.151.2023.07.19.16.50.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 16:50:07 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v4 12/83] buildman: Refactor target handling in Boards.scan() Date: Wed, 19 Jul 2023 17:48:20 -0600 Message-ID: <20230719234953.796101-13-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230719234953.796101-1-sjg@chromium.org> References: <20230719234953.796101-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 --- (no changes since v3) 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 122fe7090bf8..2d393263003b 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.487.g6d72f3e995-goog