From patchwork Sun Jun 7 12:45:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1304685 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: 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=S0Z4RQQ2; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 49fx344wBBz9sQx for ; Sun, 7 Jun 2020 22:46:40 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A1C9180476; Sun, 7 Jun 2020 14:46:16 +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="S0Z4RQQ2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8FCA880462; Sun, 7 Jun 2020 14:46:09 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (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 2E0AF8067C for ; Sun, 7 Jun 2020 14:46:05 +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-x129.google.com with SMTP id i1so12938276ils.11 for ; Sun, 07 Jun 2020 05:46:05 -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=CepnHOmAY1j0u3VOGOrr/i13ctuyv0icB3rxfxkxflY=; b=S0Z4RQQ2DPxETSyhiOSedkR1s79942g7EllgpKiUkE264WN5rtgQ4Dekj+UInUZAA5 IpP1dRr+5B5PNPm0CTRf1BMBmf9bcyyb3LaI0GRLimMd8NBYUTJ2uAojBvuSNo/+eRZD v5TCRRry8S7lCBYk3VXQIkGkNy8bIApMCJsyo= 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=CepnHOmAY1j0u3VOGOrr/i13ctuyv0icB3rxfxkxflY=; b=Iamfo7qpPGxkkChd/qB/6p9OX66FSVDJtA8R72fINy/GT5Bvdh27y9vb8pzZKodtw/ tLIwZxl7H/S9VDzSSLZQea5QrVmqcrfy2kQep/64HGz1EcGP+phIlXHL9BCMjienYJob SsYr9UFq9DPCxS0iw4OqGxpfof46/uel0AOxovO4WoIDPoAwffsM95/1M2M62Se5cW82 /rGIChv/Ch/vjS0IfMHue2XoObcpPsPIkdT44A293neTwPIO5UQKNzZnFMCUM7eNHfpZ YwPRtxG7r7L3P5VSKD5rOPW0WmcjnEoOkAbdL12DcG6a4u3rSx9X91d/CoAUmQg6vAFp mFJg== X-Gm-Message-State: AOAM533Q54572+uUJsUYT45igNmrIKxDRI07FW3nYW8TJDXLqExBOsK8 82pIS0t/x5Thjhe7HRL5/RXzTLxFgfVqRg== X-Google-Smtp-Source: ABdhPJwe9oklkr9/CXQGe43bD/X7n0LBCOClcY3DYAHUjnYmyrCvWCczuJwRuH9eMNML+dlW9G9M+Q== X-Received: by 2002:a92:5f9c:: with SMTP id i28mr18083870ill.25.1591533963804; Sun, 07 Jun 2020 05:46:03 -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 v15sm6354969ila.57.2020.06.07.05.46.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 05:46:03 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Stefan Bosch , Simon Glass Subject: [PATCH v4 4/6] patman: Pass in maintainer dirs to avoid and import Date: Sun, 7 Jun 2020 06:45:48 -0600 Message-Id: <20200607124550.212732-5-sjg@chromium.org> X-Mailer: git-send-email 2.27.0.278.ge193c7cf3a9-goog In-Reply-To: <20200607124550.212732-1-sjg@chromium.org> References: <20200607124550.212732-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.102.2 at phobos.denx.de X-Virus-Status: Clean Adjust the get_maintainer module to accept a list of directories to search for the script. This avoids needing to import gitutil. Signed-off-by: Simon Glass Reported-by: Stefan Bosch Signed-off-by: Simon Glass Reported-by: Stefan Bosch --- (no changes since v1) tools/patman/get_maintainer.py | 14 +++++++------- tools/patman/series.py | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/patman/get_maintainer.py b/tools/patman/get_maintainer.py index 473f0feebf..af4ba15bcd 100644 --- a/tools/patman/get_maintainer.py +++ b/tools/patman/get_maintainer.py @@ -5,17 +5,16 @@ import os from patman import command -from patman import gitutil -def FindGetMaintainer(): +def FindGetMaintainer(try_list): """Look for the get_maintainer.pl script. + Args: + try_list: List of directories to try for the get_maintainer.pl script + Returns: If the script is found we'll return a path to it; else None. """ - try_list = [ - os.path.join(gitutil.GetTopLevel(), 'scripts'), - ] # Look in the list for path in try_list: fname = os.path.join(path, 'get_maintainer.pl') @@ -24,7 +23,7 @@ def FindGetMaintainer(): return None -def GetMaintainer(fname, verbose=False): +def GetMaintainer(dir_list, fname, verbose=False): """Run get_maintainer.pl on a file if we find it. We look for get_maintainer.pl in the 'scripts' directory at the top of @@ -32,12 +31,13 @@ def GetMaintainer(fname, verbose=False): then we fail silently. Args: + dir_list: List of directories to try for the get_maintainer.pl script fname: Path to the patch file to run get_maintainer.pl on. Returns: A list of email addresses to CC to. """ - get_maintainer = FindGetMaintainer() + get_maintainer = FindGetMaintainer(dir_list) if not get_maintainer: if verbose: print("WARNING: Couldn't find get_maintainer.pl") diff --git a/tools/patman/series.py b/tools/patman/series.py index ca7ca556dc..b7eef37d03 100644 --- a/tools/patman/series.py +++ b/tools/patman/series.py @@ -263,7 +263,8 @@ class Series(dict): if type(add_maintainers) == type(cc): cc += add_maintainers elif add_maintainers: - cc += get_maintainer.GetMaintainer(commit.patch) + dir_list = [os.path.join(gitutil.GetTopLevel(), 'scripts')] + cc += get_maintainer.GetMaintainer(dir_list, commit.patch) for x in set(cc) & set(settings.bounces): print(col.Color(col.YELLOW, 'Skipping "%s"' % x)) cc = set(cc) - set(settings.bounces)