1 # Copyright (c) 2012 The Chromium OS Authors.
3 # See file CREDITS for list of people who contributed to this
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation; either version 2 of
9 # the License, or (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 def FindGetMaintainer():
27 """Look for the get_maintainer.pl script.
30 If the script is found we'll return a path to it; else None.
33 os.path.join(gitutil.GetTopLevel(), 'scripts'),
37 fname = os.path.join(path, 'get_maintainer.pl')
38 if os.path.isfile(fname):
43 def GetMaintainer(fname, verbose=False):
44 """Run get_maintainer.pl on a file if we find it.
46 We look for get_maintainer.pl in the 'scripts' directory at the top of
47 git. If we find it we'll run it. If we don't find get_maintainer.pl
48 then we fail silently.
51 fname: Path to the patch file to run get_maintainer.pl on.
54 A list of email addresses to CC to.
56 get_maintainer = FindGetMaintainer()
57 if not get_maintainer:
59 print "WARNING: Couldn't find get_maintainer.pl"
62 stdout = command.Output(get_maintainer, '--norolestats', fname)
63 return stdout.splitlines()