From c4c758cc177b3727f4d89eeed24505f16825a681 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Sun, 13 Nov 2011 02:00:06 +0200 Subject: [PATCH] Provide installs & removes cleanly checkboxes for each binary package --- requestbackport | 23 +++++++++++++---------- ubuntutools/question.py | 1 + 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/requestbackport b/requestbackport index 9e8cf4e..6b3c294 100755 --- a/requestbackport +++ b/requestbackport @@ -73,11 +73,7 @@ def determine_destinations(source, destination): return destinations -def find_rdepends(package, releases): - published_binaries = set() - for bpph in package._lpobject.getPublishedBinaries(): - published_binaries.add(bpph.binary_package_name) - +def find_rdepends(package, releases, published_binaries): intermediate = defaultdict(lambda: defaultdict(list)) # 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): + + published_binaries = set() + for bpph in package_spph._lpobject.getPublishedBinaries(): + published_binaries.add(bpph.binary_package_name) + testing = [] testing += ["You can test-build the backport in your PPA with " "backportpackage:"] @@ -139,10 +140,11 @@ def request_backport(package_spph, source, destinations): % (lp_user, source, dest) for dest in destinations] testing += [""] - testing += ["* Package builds without modification on"] - testing += ["[ ] %s" % dest for dest in destinations] - testing += ["* Package installs and removes cleanly on"] - testing += ["[ ] %s" % dest for dest in destinations] + for dest in destinations: + testing += ['* %s:' % dest] + testing += ["[ ] Package builds without modification"] + testing += ["[ ] %s installs and removes cleanly" % binary + for binary in published_binaries] subst = { 'package': package_spph.getPackageName(), @@ -151,7 +153,8 @@ def request_backport(package_spph, source, destinations): 'source': source, 'destinations': ', '.join(destinations), '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) " "from %(source)s" % subst) diff --git a/ubuntutools/question.py b/ubuntutools/question.py index 2f547a2..522b236 100644 --- a/ubuntutools/question.py +++ b/ubuntutools/question.py @@ -15,6 +15,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + class Question(object): def __init__(self, options, show_help=True): assert len(options) >= 2