From patchwork Mon Oct 26 01:04:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1387399 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CKH0H1Cb2z9sT6 for ; Mon, 26 Oct 2020 12:13:35 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=hDcZnrvf; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CKH0G6yPDzDqF6 for ; Mon, 26 Oct 2020 12:13:34 +1100 (AEDT) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::d2f; helo=mail-io1-xd2f.google.com; envelope-from=sjg@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=hDcZnrvf; dkim-atps=neutral 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_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CKGpk5WpLzDqMX for ; Mon, 26 Oct 2020 12:05:18 +1100 (AEDT) Received: by mail-io1-xd2f.google.com with SMTP id p15so8366773ioh.0 for ; Sun, 25 Oct 2020 18:05:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EwPDx6U0RfJ+oC3KEc9NLLEI7tbzTqPu4vFxu1zzr1Y=; b=hDcZnrvfbKNkM0z7SvgluM059dDsP/a3EcRGZ/8r2pkgU5RIXPjJzh+kvxKEBrTbS+ w9SYQNJy7k/s8qR1L34HUN0eNfvOQS6O7yvhpu5+R3g8Q9VpKl3ndW3OvPMZRmUzxQVZ 9tuKVg0BL/BJAtW1l8lwJM0xPDK/NxjA0xSb4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EwPDx6U0RfJ+oC3KEc9NLLEI7tbzTqPu4vFxu1zzr1Y=; b=U/DLES7HNoKvtpiTsqKIJIQ30lX/gsLCCnKPI/O8TcmLi2YFONpATKPo/5fp/MI/nW +qt6SUJIkJDxmrwKcMeH4Ee7ofF/ldiTjwyxRzEJObTGjzXJyI9+CenKbXfkDv/54Sob seY5Ag8XsbGh49X+GCHkM8NkKwTjIIj0HQ44wg9C64MyoLwSrYfW68uwvS5Ev1D1jmOm 8Fwqq/XjSFyIZdS6SFShWL2/lMO+gXwe32KM+9BY93/4wIz8E3j7CQfaSTFn+XBHtP4j P95smTbee9fjqAodbJ5d3u7erfsOnpBKnLUeqXIr/00xRdw4ngeWWfTMbt/7jgnec2xB +YkQ== X-Gm-Message-State: AOAM530YHWrjlzDBpLL1MbSkRs0FTTCqW9wF6Sh1Slv7CpOEydetaRpG QYy25II9iDGX1ewFDfKXBNVx5tNdV9oELvQX X-Google-Smtp-Source: ABdhPJwOSJjWyKPuDx/NTOHNsH0NSS1+T6ZCtC8Yn75a5pf0HI9lZqCN+VExfRCV/To9xZhxwpOUmQ== X-Received: by 2002:a02:c885:: with SMTP id m5mr8977489jao.72.1603674315522; Sun, 25 Oct 2020 18:05:15 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id a6sm5231162ili.11.2020.10.25.18.05.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 18:05:15 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Subject: [PATCH v2 16/30] patman: Convert 'Series-xxx' tag errors into warnings Date: Sun, 25 Oct 2020 19:04:28 -0600 Message-Id: <20201026010442.1606893-17-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc2.309.g374f81d7ae-goog In-Reply-To: <20201026010442.1606893-1-sjg@chromium.org> References: <20201026010442.1606893-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Rini , Simon Glass , patchwork@lists.ozlabs.org Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" If the Series-xxx tag is not recognised patman currently reports a fatal error. This is inconvenient if a new feature is later added to patman that an earlier version does not support. Report a warning instead, to allow the user to take action if needed, but still allow operation to proceed. Signed-off-by: Simon Glass --- (no changes since v1) tools/patman/patchstream.py | 4 +++- tools/patman/series.py | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index 880d7ddc7f2..24040d43d62 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -114,7 +114,9 @@ class PatchStream: self.in_section = name self.skip_blank = False if self.is_log: - self.series.AddTag(self.commit, line, name, value) + warn = self.series.AddTag(self.commit, line, name, value) + if warn: + self.commit.warn.append(warn) def _add_to_commit(self, name): """Add a new Commit-xxx tag. diff --git a/tools/patman/series.py b/tools/patman/series.py index 393a44241bd..4457719f2ef 100644 --- a/tools/patman/series.py +++ b/tools/patman/series.py @@ -59,6 +59,9 @@ class Series(dict): line: Source line containing tag (useful for debug/error messages) name: Tag name (part after 'Series-') value: Tag value (part after 'Series-xxx: ') + + Returns: + String warning if something went wrong, else None """ # If we already have it, then add to our list name = name.replace('-', '_') @@ -78,9 +81,10 @@ class Series(dict): else: self[name] = value else: - raise ValueError("In %s: line '%s': Unknown 'Series-%s': valid " + return ("In %s: line '%s': Unknown 'Series-%s': valid " "options are %s" % (commit.hash, line, name, ', '.join(valid_series))) + return None def AddCommit(self, commit): """Add a commit into our list of commits