diff options
author | Simon Glass <sjg@chromium.org> | 2020-06-07 06:45:48 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-07-09 18:57:22 -0600 |
commit | 156e655372f4221844d3483045dfdeffbb8bd0b1 (patch) | |
tree | 879e0b5f7609583b14edcad556d8236ab2c10f93 /tools/patman/get_maintainer.py | |
parent | 38a9d3b31aec796a23f98ace17ebe6f7baf326fc (diff) |
patman: Pass in maintainer dirs to avoid and import
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 <sjg@chromium.org>
Reported-by: Stefan Bosch <stefan_b@posteo.net>
Diffstat (limited to 'tools/patman/get_maintainer.py')
-rw-r--r-- | tools/patman/get_maintainer.py | 14 |
1 files changed, 7 insertions, 7 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") |