proj/gentoo-retirement-scripts:master commit in: /

Michał Górny <[email protected]> Sun, 02 Aug 2026 18:12:49 +0000 (UTC)
Newsgroups gmane.linux.gentoo.cvs
Message-ID <1785694357.67d29cdd6bdc1a6cab646efb75bbc5d045795ec4.mgorny@gentoo>
commit:     67d29cdd6bdc1a6cab646efb75bbc5d045795ec4
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  2 18:12:37 2026 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Aug  2 18:12:37 2026 +0000
URL:        https://gitweb.gentoo.org/proj/gentoo-retirement-scripts.git/commit/?id=67d29cdd

reassign-packages: Warn about maintainers left without a proxy

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 reassign-packages.py | 37 ++++++++++++++++++++++++++-----------
 1 file changed, 26 insertions(+), 11 deletions(-)

diff --git a/reassign-packages.py b/reassign-packages.py
index ecc79ea..3cfa37b 100755
--- a/reassign-packages.py
+++ b/reassign-packages.py
@@ -26,31 +26,35 @@ def main() -> int:
     args = parser.parse_args()
 
     # Store packages which are maintained by the person
-    pkg = set()
+    pkgs = set()
     grabs = set()
+    noproxy = set()
 
     for f in glob.glob(os.path.join(args.path, '*/*/metadata.xml')):
         # Store subpath, parse xml
         subpath = os.path.relpath(f, args.path)
         xml = etree.parse(f)
         r = xml.getroot()
+        pkg = '/'.join(subpath.split('/', 2)[:2])
 
         # Check if the retired person maintains the package
         maints = r.findall('maintainer')
         for m in maints:
             if m.findtext('email') == args.email:
-                pkg.add('/'.join(subpath.split('/', 2)[:2]))
+                pkgs.add(pkg)
                 break
         else:
             continue
 
-        # Check if the package has any proxied maintainers left
+        # Check if the package has any proxied maintainers and devs left
+        other_proxy = False
         other_proxied_maint = False
         for pm in maints:
-            if (pm.findtext('email') != args.email
-                    and pm.get('proxied') == 'yes'):
-                other_proxied_maint = True
-                break
+            if pm.findtext('email') != args.email:
+                if pm.get('proxied') == 'yes':
+                    other_proxied_maint = True
+                if pm.get('proxied') == 'proxy':
+                    other_proxy = True
 
         # Remove proxies if no proxied maintainers are left
         if not other_proxied_maint:
@@ -59,12 +63,16 @@ def main() -> int:
                     r.remove(p)
             maints = r.findall('maintainer')
 
+        # Warn if we're left with no proxies
+        if other_proxied_maint and not other_proxy:
+            noproxy.add(pkg)
+
         # the last maintainer standing? we need maintainer-needed now!
         if len(maints) == 1:
             c = etree.Comment(' maintainer-needed ')
             c.tail = m.tail
             r.replace(m, c)
-            grabs.add('/'.join(subpath.split('/')[:2]))
+            grabs.add(pkg)
         else:
             if m.getprevious() is not None:
                 m.getprevious().tail = m.tail
@@ -76,19 +84,26 @@ def main() -> int:
             xml.write(f, encoding='UTF-8', pretty_print=True)
 
     # Run pkgcheck on modified packages
-    if args.repoman and pkg:
+    if args.repoman and pkgs:
         subprocess.Popen(
             ['pkgcheck', 'scan', '-c', 'PackageMetadataXmlCheck'] +
-            sorted(pkg), cwd=args.path).wait()
+            sorted(pkgs), cwd=args.path).wait()
 
     if grabs:
         print('Packages up for grabs:')
         for g in sorted(grabs):
             print(g)
-    elif pkg:
+    elif pkgs:
         print('No packages up for grabs')
     else:
         print('No packages reassigned')
+
+    if noproxy:
+        print('')
+        print('Packages with no proxy for proxied maintainers:')
+        for pkg in sorted(noproxy):
+            print(pkg)
+
     return 0