Provide installs & removes cleanly checkboxes for each binary package

This commit is contained in:
Stefano Rivera 2011-11-13 02:00:06 +02:00
parent 45db7b738e
commit c4c758cc17
2 changed files with 14 additions and 10 deletions

View File

@ -73,11 +73,7 @@ def determine_destinations(source, destination):
return destinations return destinations
def find_rdepends(package, releases): def find_rdepends(package, releases, published_binaries):
published_binaries = set()
for bpph in package._lpobject.getPublishedBinaries():
published_binaries.add(bpph.binary_package_name)
intermediate = defaultdict(lambda: defaultdict(list)) intermediate = defaultdict(lambda: defaultdict(list))
# We want to display every pubilshed binary, even if it has no rdepends # We want to display every pubilshed binary, even if it has no rdepends
@ -131,6 +127,11 @@ def locate_package(package, distribution):
def request_backport(package_spph, source, destinations): def request_backport(package_spph, source, destinations):
published_binaries = set()
for bpph in package_spph._lpobject.getPublishedBinaries():
published_binaries.add(bpph.binary_package_name)
testing = [] testing = []
testing += ["You can test-build the backport in your PPA with " testing += ["You can test-build the backport in your PPA with "
"backportpackage:"] "backportpackage:"]
@ -139,10 +140,11 @@ def request_backport(package_spph, source, destinations):
% (lp_user, source, dest) % (lp_user, source, dest)
for dest in destinations] for dest in destinations]
testing += [""] testing += [""]
testing += ["* Package builds without modification on"] for dest in destinations:
testing += ["[ ] %s" % dest for dest in destinations] testing += ['* %s:' % dest]
testing += ["* Package installs and removes cleanly on"] testing += ["[ ] Package builds without modification"]
testing += ["[ ] %s" % dest for dest in destinations] testing += ["[ ] %s installs and removes cleanly" % binary
for binary in published_binaries]
subst = { subst = {
'package': package_spph.getPackageName(), 'package': package_spph.getPackageName(),
@ -151,7 +153,8 @@ def request_backport(package_spph, source, destinations):
'source': source, 'source': source,
'destinations': ', '.join(destinations), 'destinations': ', '.join(destinations),
'testing': '\n'.join(testing), 'testing': '\n'.join(testing),
'rdepends': find_rdepends(package_spph, destinations), 'rdepends': find_rdepends(package_spph, destinations,
published_binaries),
} }
subject = ("Please backport %(package)s %(version)s (%(component)s) " subject = ("Please backport %(package)s %(version)s (%(component)s) "
"from %(source)s" % subst) "from %(source)s" % subst)

View File

@ -15,6 +15,7 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
class Question(object): class Question(object):
def __init__(self, options, show_help=True): def __init__(self, options, show_help=True):
assert len(options) >= 2 assert len(options) >= 2