]> git.decadent.org.uk Git - dak.git/commitdiff
gpg_get_key_addresses: return a list instead of a set
authorAnsgar Burchardt <ansgar@debian.org>
Thu, 28 Jun 2012 10:07:42 +0000 (12:07 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Sun, 1 Jul 2012 11:07:43 +0000 (13:07 +0200)
gpg tries to return the primary uid (or newest uid if there is no explicit
primary) first.  dak should prefer this address, but we need a list to know the
order of addresses gpg returned.

Signed-off-by: Ansgar Burchardt <ansgar@debian.org>
daklib/utils.py

index 6fecfb877a5eb9743643a671da8f81c4e3a7ffe3..b1b7b1d0e3a851cf792d960d86b322bedb5e3295 100755 (executable)
@@ -1387,7 +1387,7 @@ def gpg_get_key_addresses(fingerprint):
     addresses = key_uid_email_cache.get(fingerprint)
     if addresses != None:
         return addresses
-    addresses = set()
+    addresses = list()
     cmd = "gpg --no-default-keyring %s --fingerprint %s" \
                 % (gpg_keyring_args(), fingerprint)
     (result, output) = commands.getstatusoutput(cmd)
@@ -1395,7 +1395,7 @@ def gpg_get_key_addresses(fingerprint):
         for l in output.split('\n'):
             m = re_gpg_uid.match(l)
             if m:
-                addresses.add(m.group(1))
+                addresses.append(m.group(1))
     key_uid_email_cache[fingerprint] = addresses
     return addresses