From 47abdefae917efbcdc5cbf54faeb751df67c1df3 Mon Sep 17 00:00:00 2001 From: Luca Falavigna Date: Fri, 18 Dec 2009 21:33:37 +0100 Subject: [PATCH] submittodebian: if patch is relatively small (shorter than fifty lines), display it inline instead of attaching to the report. --- debian/changelog | 7 ++++++- submittodebian | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 38b33e9..5e534f8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,14 @@ ubuntu-dev-tools (0.86) UNRELEASED; urgency=low + [ Emmet Hikory ] * mk-sbuild-lv: Add richer support for ports architectures in Ubuntu * mk-sbuild-lv: Really use -security for SOURCES_SECURITY_SUITE in Ubuntu - -- Emmet Hikory Tue, 15 Dec 2009 09:57:20 +0900 + [ Kumar Appaiah ] + * submittodebian: if patch is relatively small (shorter than fifty + lines), display it inline instead of attaching to the report. + + -- Kumar Appaiah Fri, 18 Dec 2009 21:30:30 +0100 ubuntu-dev-tools (0.85) lucid; urgency=low diff --git a/submittodebian b/submittodebian index 6e59f51..6063cf5 100755 --- a/submittodebian +++ b/submittodebian @@ -93,7 +93,15 @@ def edit_debdiff(debdiff): run_cmd(cmd) def submit_bugreport(body, debdiff, changelog): - cmd = 'reportbug -P "User: ubuntu-devel@lists.ubuntu.com" -P "Usertags: origin-ubuntu lucid ubuntu-patch" -T patch -A %s -B debian -i %s -V %s %s' % (debdiff, body, deb_version, changelog.package) + # Count the number of lines in the patch + debdiff_file = open(debdiff, 'r') + n_lines = len(debdiff_file.readlines()) + debdiff_file.close() + + # If the patch is smaller than 51 lines, we include it inline, attach it otherwise. + inclusion_method = '--include' if n_lines < 51 else '-A' + + cmd = 'reportbug -P "User: ubuntu-devel@lists.ubuntu.com" -P "Usertags: origin-ubuntu lucid ubuntu-patch" -T patch %s %s -B debian -i %s -V %s %s' % (inclusion_method, debdiff, body, deb_version, changelog.package) run_cmd(cmd) def run_cmd(cmd):