Return the uid,name,isdm for a given gpg fingerprint
@type fpr: string
@param fpr: a 40 byte GPG fingerprint
@return: (uid, name, isdm)
"""
cursor=DBConn().cursor()
cursor.execute("SELECT u.uid, u.name, k.debian_maintainer FROM fingerprint f JOIN keyrings k ON (f.keyring=k.id), uid u WHERE f.uid = u.id AND f.fingerprint = '%s'"%(fpr))
qs=cursor.fetchone()
ifqs:
returnqs
else:
return(None,None,False)
uid=None
uid_name=""
# This is a stupid default, but see the comments below
reject("%s is not authorised to sponsor uploads"%(uid))
cursor=DBConn().cursor()
ifnotsponsoredandnotmay_nmu:
source_ids=[]
cursor.execute("SELECT s.id, s.version FROM source s JOIN src_associations sa ON (s.id = sa.source) WHERE s.source = %(source)s AND s.dm_upload_allowed = 'yes'",changes)
reject("Source package %s does not have 'DM-Upload-Allowed: yes' in its most recent version"%changes["source"])
else:
cursor.execute("SELECT m.name FROM maintainer m WHERE m.id IN (SELECT su.maintainer FROM src_uploaders su JOIN source s ON (s.id = su.source) WHERE su.source = %s)"%(highest_sid))
cursor.execute("SELECT DISTINCT s.source FROM source s JOIN binaries b ON (s.id = b.source) JOIN bin_associations ba On (b.id = ba.bin) WHERE b.package = %(package)s AND ba.suite = %(suite)s",{'package':b,'suite':suite_id})
whileTrue:
s=cursor.fetchone()
ifnots:
break
ifs[0]!=changes["source"]:
forsinq.all():
ifs.source!=changes["source"]:
reject("%s may not hijack %s from source package %s in suite %s"%(uid,b,s,suite))