From: Ansgar Burchardt Date: Thu, 28 Jun 2012 10:07:42 +0000 (+0200) Subject: gpg_get_key_addresses: return a list instead of a set X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=088d1006733a0297bcc54c83eadabd027de245bd;p=dak.git gpg_get_key_addresses: return a list instead of a set 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 --- diff --git a/daklib/utils.py b/daklib/utils.py index 6fecfb87..b1b7b1d0 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -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