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 88192C001B0 for ; Wed, 19 Jul 2023 23:53:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 35C31867EC; Thu, 20 Jul 2023 01:51:03 +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="fzG2IEqM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E0404867B7; Thu, 20 Jul 2023 01:50:18 +0200 (CEST) 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 0021D86702 for ; Thu, 20 Jul 2023 01:50:13 +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-3489cd4e3d3so1571195ab.3 for ; Wed, 19 Jul 2023 16:50:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689810612; x=1690415412; 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=6sS28F0SEdInzB3SXwGACVHvL507KfZj9O/kZ65oKTg=; b=fzG2IEqM+3y5r+Z6dh4uEpUMwJTtrauNgbnAtSz4lsG6ilyzBrKlEkGN8SviAhbLPr CvQt3ys9LYlbKW5XwNuS7II2Wryyjd/Pvthswq1umsww1xswYCSEYmzQJt7fsSvRQw7o ATV1tzsEXczqt70lJzE+hE0wVRiRa/YCs6Ba0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689810612; x=1690415412; 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=6sS28F0SEdInzB3SXwGACVHvL507KfZj9O/kZ65oKTg=; b=duIhzYu+abwUX7CBmgq85769FJYseQ4BjMhOiO8cotBuLtHTepxjlUMTdcxX179L5f 0YiaiKP7q88/uzJM5YGPQ8SM/udMbXSQcGiaUFFkmFEVzpoTe8X45mBXFbgxeUsGU8Ty FM/jUuTyK77M/DoDRqcKMVrPGwU6whkmuIgBbCHr+zb88Yfv1w5tA47k0W1ZsMbK6vpk AcJveS8CxRfoh1EmgvIr4uCpX8SUNsKVxK8smVbPKlBAbFB2Ya8Yd6dXx2MRtktfph38 7V6rQtrpbIeNdQSLbOqxMjLOoXUQz5eP0sLDqc+HJ7ptjd+QmY1M44rcnzcG+rl5XwOQ RNWQ== X-Gm-Message-State: ABy/qLaiinEhX5XEunWESzpX8XiYnobVd1mznDJoLymp9BUr/kkgKo8Y smNefG+2VarKJ9hgaOsGa1KCiO0RdpPc1oEjHKw= X-Google-Smtp-Source: APBJJlF5do1uaPB2JrISehUeMhNEuxl202W9h3PIjV+ythV+vmlTSCK9pETTH0xgzFzfj6xg0Hn6lw== X-Received: by 2002:a05:6e02:deb:b0:343:c8b1:b7f0 with SMTP id m11-20020a056e020deb00b00343c8b1b7f0mr530704ilj.23.1689810612511; Wed, 19 Jul 2023 16:50:12 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 16:50:12 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v4 18/83] buildman: Correct logic for missing maintainers Date: Wed, 19 Jul 2023 17:48:26 -0600 Message-ID: <20230719234953.796101-19-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 An orphaned board should produce a warning, as should a missing name for the maintainer (when '-' is provided). Add these cases. Signed-off-by: Simon Glass --- Changes in v4: - Add new patch to correct logic for missing maintainers tools/buildman/boards.py | 14 +++++++++----- tools/buildman/func_test.py | 20 ++++++++++++++++++-- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/tools/buildman/boards.py b/tools/buildman/boards.py index 269cafa6adc7..e608f7990d85 100644 --- a/tools/buildman/boards.py +++ b/tools/buildman/boards.py @@ -341,11 +341,15 @@ class MaintainersDatabase: str: Maintainers of the board. If the board has two or more maintainers, they are separated with colons. """ - if not target in self.database: - self.warnings.append(f"WARNING: no maintainers for '{target}'") - return '' - - return ':'.join(self.database[target][1]) + entry = self.database.get(target) + if entry: + status, maint_list = entry + if not status.startswith('Orphan'): + if len(maint_list) > 1 or (maint_list and maint_list[0] != '-'): + return ':'.join(maint_list) + + self.warnings.append(f"WARNING: no maintainers for '{target}'") + return '' def parse_file(self, srcdir, fname): """Parse a MAINTAINERS file. diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index c962083a43fb..bb9eea335d16 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -923,13 +923,29 @@ Active aarch64 armv8 - armltd total_compute board2 'WARNING: orphaned defconfig in boards/board0/MAINTAINERS ending at line 4', ], warnings) - # Remove the maintainer line (M:) from a file (this should be fine) + # Mark a board as orphaned - this should give a warning + lines = ['S: Orphaned' if line.startswith('S') else line + for line in orig_data.splitlines(keepends=True)] + tools.write_file(main, ''.join(lines), binary=False) + params_list, warnings = self._boards.build_board_list(config_dir, src) + self.assertEquals(2, len(params_list)) + self.assertEquals(["WARNING: no maintainers for 'board0'"], warnings) + + # Change the maintainer to '-' - this should give a warning + lines = ['M: -' if line.startswith('M') else line + for line in orig_data.splitlines(keepends=True)] + tools.write_file(main, ''.join(lines), binary=False) + params_list, warnings = self._boards.build_board_list(config_dir, src) + self.assertEquals(2, len(params_list)) + self.assertEquals(["WARNING: -: unknown status for 'board0'"], warnings) + + # Remove the maintainer line (M:) from a file lines = [line for line in orig_data.splitlines(keepends=True) if not line.startswith('M:')] tools.write_file(main, ''.join(lines), binary=False) params_list, warnings = self._boards.build_board_list(config_dir, src) self.assertEquals(2, len(params_list)) - self.assertFalse(warnings) + self.assertEquals(["WARNING: no maintainers for 'board0'"], warnings) # Move the contents of the second file into this one, removing the # second file, to check multiple records in a single file. -- 2.41.0.487.g6d72f3e995-goog