1 # Copyright (c) 2012 The Chromium OS Authors.
3 # SPDX-License-Identifier: GPL-2.0+
10 def FindGetMaintainer():
11 """Look for the get_maintainer.pl script.
14 If the script is found we'll return a path to it; else None.
17 os.path.join(gitutil.GetTopLevel(), 'scripts'),
21 fname = os.path.join(path, 'get_maintainer.pl')
22 if os.path.isfile(fname):
27 def GetMaintainer(fname, verbose=False):
28 """Run get_maintainer.pl on a file if we find it.
30 We look for get_maintainer.pl in the 'scripts' directory at the top of
31 git. If we find it we'll run it. If we don't find get_maintainer.pl
32 then we fail silently.
35 fname: Path to the patch file to run get_maintainer.pl on.
38 A list of email addresses to CC to.
40 get_maintainer = FindGetMaintainer()
41 if not get_maintainer:
43 print "WARNING: Couldn't find get_maintainer.pl"
46 stdout = command.Output(get_maintainer, '--norolestats', fname)
47 return stdout.splitlines()