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 <rebe...@bsdio.com>
Cc: Liming Gao <gaolim...@byosoft.com.cn>
Cc: Bob Feng <bob.c.f...@intel.com>
Cc: Yuwei Chen <yuwei.c...@intel.com>
Cc: Leif Lindholm <quic_llind...@quicinc.com>
Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com>
---
 BaseTools/Scripts/GetMaintainer.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Scripts/GetMaintainer.py 
b/BaseTools/Scripts/GetMaintainer.py
index a887962dd1bd..b33546b10f21 100644
--- a/BaseTools/Scripts/GetMaintainer.py
+++ b/BaseTools/Scripts/GetMaintainer.py
@@ -191,15 +191,16 @@ if __name__ == '__main__':
     else:
         FILES = get_modified_files(REPO, ARGS)
 
-    ADDRESSES = []
-
+    # Accumulate a sorted list of addresses
+    ADDRESSES = set([])
     for file in FILES:
         print(file)
         maintainers, reviewers, lists = get_maintainers(file, SECTIONS)
-        if maintainers or reviewers or lists:
-            ADDRESSES += (maintainers + reviewers + lists)
+        ADDRESSES |= set(maintainers + reviewers + 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)
-- 
2.40.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111045): https://edk2.groups.io/g/devel/message/111045
Mute This Topic: https://groups.io/mt/102510793/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to