mirror of https://github.com/acidanthera/audk.git
BaseTools/Scripts/GetMaintainer: Handle reviewer only case
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4593 If a package only has reviewers and no maintainers, then also return the <default> maintainers. In order to detect this case, get_maintainers() is updated to return maintainers, reviews, and lists separately instead of a single merged list. This also allows this module to be used by other scripts that need to distinguish between maintainers, reviewers, and lists. Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
This commit is contained in:
parent
05f3c3f3d0
commit
706811819d
|
@ -76,6 +76,7 @@ def get_section_maintainers(path, section):
|
||||||
"""Returns a list with email addresses to any M: and R: entries
|
"""Returns a list with email addresses to any M: and R: entries
|
||||||
matching the provided path in the provided section."""
|
matching the provided path in the provided section."""
|
||||||
maintainers = []
|
maintainers = []
|
||||||
|
reviewers = []
|
||||||
lists = []
|
lists = []
|
||||||
nowarn_status = ['Supported', 'Maintained']
|
nowarn_status = ['Supported', 'Maintained']
|
||||||
|
|
||||||
|
@ -83,12 +84,18 @@ def get_section_maintainers(path, section):
|
||||||
for status in section['status']:
|
for status in section['status']:
|
||||||
if status not in nowarn_status:
|
if status not in nowarn_status:
|
||||||
print('WARNING: Maintained status for "%s" is \'%s\'!' % (path, status))
|
print('WARNING: Maintained status for "%s" is \'%s\'!' % (path, status))
|
||||||
for address in section['maintainer'], section['reviewer']:
|
for address in section['maintainer']:
|
||||||
# Convert to list if necessary
|
# Convert to list if necessary
|
||||||
if isinstance(address, list):
|
if isinstance(address, list):
|
||||||
maintainers += address
|
maintainers += address
|
||||||
else:
|
else:
|
||||||
maintainers += [address]
|
maintainers += [address]
|
||||||
|
for address in section['reviewer']:
|
||||||
|
# Convert to list if necessary
|
||||||
|
if isinstance(address, list):
|
||||||
|
reviewers += address
|
||||||
|
else:
|
||||||
|
reviewers += [address]
|
||||||
for address in section['list']:
|
for address in section['list']:
|
||||||
# Convert to list if necessary
|
# Convert to list if necessary
|
||||||
if isinstance(address, list):
|
if isinstance(address, list):
|
||||||
|
@ -96,16 +103,18 @@ def get_section_maintainers(path, section):
|
||||||
else:
|
else:
|
||||||
lists += [address]
|
lists += [address]
|
||||||
|
|
||||||
return {'maintainers': maintainers, 'lists': lists}
|
return {'maintainers': maintainers, 'reviewers': reviewers, 'lists': lists}
|
||||||
|
|
||||||
def get_maintainers(path, sections, level=0):
|
def get_maintainers(path, sections, level=0):
|
||||||
"""For 'path', iterates over all sections, returning maintainers
|
"""For 'path', iterates over all sections, returning maintainers
|
||||||
for matching ones."""
|
for matching ones."""
|
||||||
maintainers = []
|
maintainers = []
|
||||||
|
reviewers = []
|
||||||
lists = []
|
lists = []
|
||||||
for section in sections:
|
for section in sections:
|
||||||
recipients = get_section_maintainers(path, section)
|
recipients = get_section_maintainers(path, section)
|
||||||
maintainers += recipients['maintainers']
|
maintainers += recipients['maintainers']
|
||||||
|
reviewers += recipients['reviewers']
|
||||||
lists += recipients['lists']
|
lists += recipients['lists']
|
||||||
|
|
||||||
if not maintainers:
|
if not maintainers:
|
||||||
|
@ -115,13 +124,14 @@ def get_maintainers(path, sections, level=0):
|
||||||
if level == 0:
|
if level == 0:
|
||||||
recipients = get_maintainers('<default>', sections, level=level + 1)
|
recipients = get_maintainers('<default>', sections, level=level + 1)
|
||||||
maintainers += recipients['maintainers']
|
maintainers += recipients['maintainers']
|
||||||
|
reviewers += recipients['reviewers']
|
||||||
lists += recipients['lists']
|
lists += recipients['lists']
|
||||||
else:
|
else:
|
||||||
print("No <default> maintainers set for project.")
|
print("No <default> maintainers set for project.")
|
||||||
if not maintainers:
|
if not maintainers:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return {'maintainers': maintainers, 'lists': lists}
|
return {'maintainers': maintainers, 'reviewers': reviewers, 'lists': lists}
|
||||||
|
|
||||||
def parse_maintainers_line(line):
|
def parse_maintainers_line(line):
|
||||||
"""Parse one line of Maintainers.txt, returning any match group and its key."""
|
"""Parse one line of Maintainers.txt, returning any match group and its key."""
|
||||||
|
@ -187,7 +197,7 @@ if __name__ == '__main__':
|
||||||
for file in FILES:
|
for file in FILES:
|
||||||
print(file)
|
print(file)
|
||||||
recipients = get_maintainers(file, SECTIONS)
|
recipients = get_maintainers(file, SECTIONS)
|
||||||
ADDRESSES += recipients['maintainers'] + recipients['lists']
|
ADDRESSES += recipients['maintainers'] + recipients['reviewers'] + recipients['lists']
|
||||||
|
|
||||||
for address in list(OrderedDict.fromkeys(ADDRESSES)):
|
for address in list(OrderedDict.fromkeys(ADDRESSES)):
|
||||||
if '<' in address and '>' in address:
|
if '<' in address and '>' in address:
|
||||||
|
|
Loading…
Reference in New Issue