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 89324C001B0 for ; Wed, 19 Jul 2023 23:53:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4C6B9867F6; Thu, 20 Jul 2023 01:50:57 +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="Xti+ULCu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D31DF8679B; Thu, 20 Jul 2023 01:50:17 +0200 (CEST) Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 C6D84867B7 for ; Thu, 20 Jul 2023 01:50:11 +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-xd31.google.com with SMTP id ca18e2360f4ac-78654448524so8324539f.2 for ; Wed, 19 Jul 2023 16:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689810610; x=1690415410; 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=YUQoBBrejT3+ACTbQCwmPzPDCXYD0YwUPi7YwBsuYLc=; b=Xti+ULCubg9bekOJUFoWacxrfay0PxzmV87J4MFjUcrw92KSlvZ2rxm26Lj+Lu3IoK zY0T8+jkKTI21p0ljoK3V1Q+SXoJAi3V6+3YODEY21LljZY+9PAjQA6flYJVRRR7CgdT bgSA151CEvExX3hK3/6sU/v+SyPulSI2pogTw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689810610; x=1690415410; 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=YUQoBBrejT3+ACTbQCwmPzPDCXYD0YwUPi7YwBsuYLc=; b=EnwTftM9WxLEtkk2ypeB8T4TOb96HoTARDyvLpLSqMTw1uu3igy3ufgF1HAF/raM07 XPl4uo5zoHRqKjVY59RIsdNPVCcmeqnl5FtCVLjqp314ppaIiE1cbTFy1xhIc+fFadIv jSCPckgLAQyN6cWm2kHkkTk3EnNvhlMggyUWl1UHiu94tiO21sXGCPJI1+3D2fiq4i1J 0vcFgI+Mb45kjotTC0AR1vIR8do2QsXoJ3u4DZQip+fjeZ98WVEMiVjR7n5EGpge3i0p xhGvr0iCuZVUWII9iu7908nX9AY97LQpvl2PVQdMXjFTuTF9Pksm63ohLPBuAecTpuK/ C1/g== X-Gm-Message-State: ABy/qLazNJcqt8NW1Jmtk7tbwoGUEcPIxB5nXxZhaVDI6XvnVZEQeR2S +FDsSrMTvkjv+1fxw1OZbaXVmI3mZWD8owGnNqA= X-Google-Smtp-Source: APBJJlHqzqfryKhIMOwxWHb/hzcBZjwmtet7rPmQJeTGT/aFBxFFIMiNRBGJTphDiutav4qrz+lsxw== X-Received: by 2002:a5d:8c81:0:b0:783:5f71:5410 with SMTP id g1-20020a5d8c81000000b007835f715410mr6998237ion.15.1689810610376; Wed, 19 Jul 2023 16:50:10 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 16:50:10 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v4 15/83] buildman: Correct operation of MAINTAINERS N: Date: Wed, 19 Jul 2023 17:48:23 -0600 Message-ID: <20230719234953.796101-16-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 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 v4: - Use search() instead of fullmatch() to allow partial matches 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 dabf694e0d0c..bf396574e227 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.search(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 71f3029f1530..164dd7c620a2 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: oa.*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.487.g6d72f3e995-goog