- q = dde_get(query_url + "/prio-%s/%s" % (d, p))
- if q:
- db[p][(trans_codename(d.split('-')[1], cfg),d)] = q
+ dist, release = d.split('-')
+ q = dde_get(query_url + "/dist/d:%s/r:%s/p:%s" % (dist, release, p))
+ if not q:
+ continue
+ # accumulate data for multiple over archs
+ item = None
+ for i in q:
+ if item is None:
+ item = i
+ # turn into a list to append others later
+ item['architecture'] = [item['architecture']]
+ else:
+ comp = apt.VersionCompare(i['version'], item['version'])
+ # found another arch for the same version
+ if comp == 0:
+ item['architecture'].append(i['architecture'])
+ # found newer version, dump the old ones
+ elif comp > 0:
+ item = i
+ # turn into a list to append others later
+ item['architecture'] = [item['architecture']]
+ # simply ignore older versions
+ else:
+ pass
+
+ # finally assign the new package data
+ db[p][(trans_codename(d.split('-')[1], cfg),d)] = item