mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-09 07:51:28 +00:00
Iterate over all destination releases
This commit is contained in:
parent
6155633e85
commit
d125c47081
@ -23,7 +23,7 @@ from distro_info import UbuntuDistroInfo
|
|||||||
from ubuntutools.lp.lpapicache import Launchpad, Distribution
|
from ubuntutools.lp.lpapicache import Launchpad, Distribution
|
||||||
from ubuntutools.lp.udtexceptions import PackageNotFoundException
|
from ubuntutools.lp.udtexceptions import PackageNotFoundException
|
||||||
from ubuntutools.config import UDTConfig
|
from ubuntutools.config import UDTConfig
|
||||||
from ubuntutools.rdepends import query_rdepends
|
from ubuntutools.rdepends import query_rdepends, RDependsException
|
||||||
from ubuntutools.requestsync.common import edit_report
|
from ubuntutools.requestsync.common import edit_report
|
||||||
from ubuntutools.question import YesNoQuestion
|
from ubuntutools.question import YesNoQuestion
|
||||||
|
|
||||||
@ -111,28 +111,35 @@ def main():
|
|||||||
request_backport(package, options.source, destinations)
|
request_backport(package, options.source, destinations)
|
||||||
|
|
||||||
|
|
||||||
def find_rdepends(package, release, releases):
|
def find_rdepends(package, releases):
|
||||||
published_binaries = set()
|
published_binaries = set()
|
||||||
for bpph in package._lpobject.getPublishedBinaries():
|
for bpph in package._lpobject.getPublishedBinaries():
|
||||||
published_binaries.add(bpph.binary_package_name)
|
published_binaries.add(bpph.binary_package_name)
|
||||||
|
|
||||||
intermediate = collections.defaultdict(list)
|
intermediate = dict((binpkg, collections.defaultdict(list))
|
||||||
|
for binpkg in published_binaries)
|
||||||
for arch in ('any', 'source'):
|
for arch in ('any', 'source'):
|
||||||
raw_rdeps = query_rdepends('src:' + package.getPackageName(),
|
for release in releases:
|
||||||
release, 'any')
|
try:
|
||||||
for relationship, rdeps in raw_rdeps.iteritems():
|
raw_rdeps = query_rdepends('src:' + package.getPackageName(),
|
||||||
for rdep in rdeps:
|
release, arch)
|
||||||
if rdep['Package'] in published_binaries:
|
except RDependsException:
|
||||||
continue
|
# Not published? TODO: Check
|
||||||
intermediate[rdep['Dependency']].append((rdep['Package'],
|
continue
|
||||||
relationship))
|
for relationship, rdeps in raw_rdeps.iteritems():
|
||||||
|
for rdep in rdeps:
|
||||||
|
if rdep['Package'] in published_binaries:
|
||||||
|
continue
|
||||||
|
intermediate[rdep['Dependency']][rdep['Package']] \
|
||||||
|
.append((release, relationship))
|
||||||
|
|
||||||
output = []
|
output = []
|
||||||
for binpkg, rdeps in intermediate.iteritems():
|
for binpkg, rdeps in intermediate.iteritems():
|
||||||
output += ['', binpkg, '=' * len(binpkg)]
|
output += ['', binpkg, '=' * len(binpkg)]
|
||||||
for pkg, relationship in rdeps:
|
for pkg, appearences in rdeps.iteritems():
|
||||||
output += ['* %s (%s)' % (pkg, relationship)]
|
output += ['* %s' % pkg]
|
||||||
output += [' [ ] %s' % release for release in releases]
|
for release, relationship in appearences:
|
||||||
|
output += [' [ ] %s (%s)' % (release, relationship)]
|
||||||
|
|
||||||
return '\n'.join(output)
|
return '\n'.join(output)
|
||||||
|
|
||||||
@ -149,7 +156,7 @@ def request_backport(package, source, destinations):
|
|||||||
'package': package_spph.getPackageName(),
|
'package': package_spph.getPackageName(),
|
||||||
'version': package_spph.getVersion(),
|
'version': package_spph.getVersion(),
|
||||||
'component': package_spph.getComponent(),
|
'component': package_spph.getComponent(),
|
||||||
'rdepends': find_rdepends(package_spph, source, destinations),
|
'rdepends': find_rdepends(package_spph, destinations),
|
||||||
'source': source,
|
'source': source,
|
||||||
'destinations': ', '.join(destinations),
|
'destinations': ', '.join(destinations),
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user