Skip to content

Commit

Permalink
BaseTools/Scripts/GetMaintainer: Sort output addresses
Browse files Browse the repository at this point in the history
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4593

Sort the list of output addresses alphabetically so this
script produces the same output even if the order of patches
in a patch series is modified such that that order of files
processed by this script changes.

Use set() logic instead of OrderedDict to accumulate the
list of unique addresses that are sorted alphabetically.

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>
  • Loading branch information
mdkinney authored and mergify[bot] committed Nov 11, 2023
1 parent 7068118 commit 33deaa3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions BaseTools/Scripts/GetMaintainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,16 @@ def get_modified_files(repo, args):
else:
FILES = get_modified_files(REPO, ARGS)

ADDRESSES = []

# Accumulate a sorted list of addresses
ADDRESSES = set([])
for file in FILES:
print(file)
recipients = get_maintainers(file, SECTIONS)
ADDRESSES += recipients['maintainers'] + recipients['reviewers'] + recipients['lists']
ADDRESSES |= set(recipients['maintainers'] + recipients['reviewers'] + recipients['lists'])
ADDRESSES = list(ADDRESSES)
ADDRESSES.sort()

for address in list(OrderedDict.fromkeys(ADDRESSES)):
for address in ADDRESSES:
if '<' in address and '>' in address:
address = address.split('>', 1)[0] + '>'
print(' %s' % address)

0 comments on commit 33deaa3

Please sign in to comment.