]> git.decadent.org.uk Git - dak.git/commitdiff
daklib/utils.py (gpg_get_key_addresses): prefer @debian.org addresses
authorAnsgar Burchardt <ansgar@debian.org>
Mon, 13 Aug 2012 09:33:03 +0000 (11:33 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Mon, 13 Aug 2012 09:33:03 +0000 (11:33 +0200)
daklib/utils.py

index 31c22cbb63ca222b32ef709fd0dcee0481ca4165..be3c65161e8fee8c203f6954715ec50fa9445d3f 100644 (file)
@@ -1396,7 +1396,14 @@ def gpg_get_key_addresses(fingerprint):
     if result == 0:
         for l in output.split('\n'):
             m = re_gpg_uid.match(l)
-            if m:
+            if not m:
+                continue
+            address = m.group(1)
+            if address.endswith('@debian.org'):
+                # prefer @debian.org addresses
+                # TODO: maybe not hardcode the domain
+                addresses.insert(0, address)
+            else:
                 addresses.append(m.group(1))
     key_uid_email_cache[fingerprint] = addresses
     return addresses