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 C3D43C001DF for ; Sun, 16 Jul 2023 00:40:13 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D4C8686642; Sun, 16 Jul 2023 02:38:18 +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="GXRDY6HT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BF59E86384; Sun, 16 Jul 2023 02:37:41 +0200 (CEST) Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (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 5E7A48623A for ; Sun, 16 Jul 2023 02:37: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-xd2b.google.com with SMTP id ca18e2360f4ac-78363cc070aso162417439f.1 for ; Sat, 15 Jul 2023 17:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689467854; x=1692059854; 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=lvx/iYmIIhCDc0xayGwMsfnSp9KqXwJ7eGMbBov6N2k=; b=GXRDY6HT7IRkKm4L3htUwmWa+Yz5Jt11Cqr0n2ONpaqzR37LzWpQmX34Q382aUuKzC YDs9Ra7M/h3PFIvlCFemwVmQlJZyvMPJTmoi6xMwW20MF/pRAYR0h3/AoZDjvx8EfOZ8 rLqxHhMaXRdpCOuxMPKhqiUGxtCBuuZQ8i2Ac= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689467854; x=1692059854; 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=lvx/iYmIIhCDc0xayGwMsfnSp9KqXwJ7eGMbBov6N2k=; b=CqOknM9dfn2sCM8/pa/GdbuxlyKuaGxLI66+MeXOOPcI6Fmzmcv4s3fDoV/oQMigW1 U+khOQNEJkkSCk+mNPB0AR4Hq0CWJchEzuDh3k5C/IiPwlNXpgYGWeljB+mF0Q2TV24E 91ggszk8RPRI3pNSf3NDqS7S809X9vsg3qDP5ezEOTkEBcLLeZb7ZEcTHQkccbjm2PW2 EWeZOQb5WJiNPNpH7TTPqLRosSOjRE8haMiNHoU7imB1e6ik1HZwIooXnrFoJCiayAYV dxez2DdJ4ABxpE40+ZegGYMVAufeTzwGwZGrYujR+1NVchgcmf39Je1mvvF/JDchVWY2 KWwA== X-Gm-Message-State: ABy/qLa3ExEuKuvf72CF5EAwfFwS0N1ocYIg0ZHEOCX972pLIcJS6XWN 0ZCTOk1UU74qHAQ9CV81OsZqJCSOHioAw1xJMYw= X-Google-Smtp-Source: APBJJlGmqThKePT7g2A+aR/8VkUDBSryzyilSkiVB3MM07vNDXPRRF5FfHujmRokkxBox+JN2Mz1Pg== X-Received: by 2002:a6b:a19:0:b0:787:4f3c:730d with SMTP id z25-20020a6b0a19000000b007874f3c730dmr8232748ioi.18.1689467853962; Sat, 15 Jul 2023 17:37:33 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jul 2023 17:37:33 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v3 15/81] buildman: Correct operation of MAINTAINERS N: Date: Sat, 15 Jul 2023 18:35:43 -0600 Message-ID: <20230716003718.231903-16-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 This doesn't work as intended. Instead it scans every defconfig file in the source tree. Fix it and add a test. Signed-off-by: Simon Glass --- Changes in v3: - Add new patch to correct operation of MAINTAINERS N: tools/buildman/boards.py | 15 ++++++++++----- tools/buildman/func_test.py | 17 +++++++++++++---- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index 209fb28eccbc..8aea6cf2dea6 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -411,12 +411,17 @@ class MaintainersDatabase: walk_path = os.walk(os.path.join(srcdir, 'configs')) for dirpath, _, fnames in walk_path: for cfg in fnames: - path = os.path.join(dirpath, cfg) + path = os.path.join(dirpath, cfg)[len(srcdir) + 1:] front, match, rear = path.partition('configs/') - if not front and match: - front, match, rear = rear.rpartition('_defconfig') - if match and not rear: - targets.append(front) + if front or not match: + continue + front, match, rear = rear.rpartition('_defconfig') + + # Use this entry if it matches the defconfig file + # without the _defconfig suffix. For example + # 'am335x.*' matches am335x_guardian_defconfig + if match and not rear and re.fullmatch(rest, front): + targets.append(front) elif line == '\n': add_targets(linenum) targets = [] diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index 812b3d8a6777..1994e42d15c8 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -933,8 +933,8 @@ Active aarch64 armv8 - armltd total_compute board2 # Move the contents of the second file into this one, removing the # second file, to check multiple records in a single file. - data = orig_data + tools.read_file(other, binary=False) - tools.write_file(main, data, binary=False) + both_data = orig_data + tools.read_file(other, binary=False) + tools.write_file(main, both_data, binary=False) os.remove(other) params_list, warnings = self._boards.build_board_list(config_dir, src) self.assertEquals(2, len(params_list)) @@ -942,7 +942,7 @@ Active aarch64 armv8 - armltd total_compute board2 # Add another record, this should be ignored with a warning extra = '\n\nAnother\nM: Fred\nF: configs/board9_defconfig\nS: other\n' - tools.write_file(main, data + extra, binary=False) + tools.write_file(main, both_data + extra, binary=False) params_list, warnings = self._boards.build_board_list(config_dir, src) self.assertEquals(2, len(params_list)) self.assertEquals( @@ -950,7 +950,7 @@ Active aarch64 armv8 - armltd total_compute board2 warnings) # Add another TARGET to the Kconfig - tools.write_file(main, data, binary=False) + tools.write_file(main, both_data, binary=False) orig_kc_data = tools.read_file(kc_file) extra = (b''' if TARGET_BOARD2 @@ -975,3 +975,12 @@ endif self.assertEquals( ['WARNING: board2_defconfig: No TARGET_BOARD2 enabled'], warnings) + tools.write_file(kc_file, orig_kc_data) + + # Replace the last F: line of board 2 with an N: line + data = ''.join(both_data.splitlines(keepends=True)[:-1]) + tools.write_file(main, data + 'N: boa.*2\n', binary=False) + params_list, warnings = self._boards.build_board_list(config_dir, src) + self.assertEquals(2, len(params_list)) + self.assertFalse(warnings) + -- 2.41.0.455.g037347b96a-goog