From 0a5812f16875d553f4377b5150056ccd22b94650 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Mon, 2 Jul 2012 15:05:39 +0200 Subject: [PATCH] submittodebian: Use --include instead of --attach when not using reportbug's internal MUA. --- debian/changelog | 7 +++++-- submittodebian | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3797477..328767c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,10 @@ ubuntu-dev-tools (0.144) quantal; urgency=low - * Use dpkg-buildpackage instead of debuild in submittodebian. It really - doesn't need to run lintian twice. + * submittodebian: + - Use dpkg-buildpackage instead of debuild. It really doesn't need to run + lintian twice. + - Use --include instead of --attach when not using reportbug's internal + MUA. -- Stefano Rivera Mon, 02 Jul 2012 13:20:29 +0200 diff --git a/submittodebian b/submittodebian index 168ce37..e641851 100755 --- a/submittodebian +++ b/submittodebian @@ -153,6 +153,19 @@ def submit_bugreport(body, debdiff, deb_version, changelog): '.*REPLACE THIS WITH ACTUAL INFORMATION.*') env['UDT_EDIT_WRAPPER_FILE_DESCRIPTION'] = 'bug report' + # In external mua mode, attachments are lost (Reportbug bug: #679907) + internal_mua = True + for cfgfile in ('/etc/reportbug.conf', '~/.reportbugrc'): + cfgfile = os.path.expanduser(cfgfile) + if not os.path.exists(cfgfile): + continue + with open(cfgfile, 'r') as f: + for line in f: + line = line.strip() + if line in ('gnus', 'mutt', 'nmh') or line.startswith('mua '): + internal_mua = False + break + cmd = ('reportbug', '--no-check-available', '--no-check-installed', @@ -160,9 +173,9 @@ def submit_bugreport(body, debdiff, deb_version, changelog): '--pseudo-header', 'Usertags: origin-ubuntu %s ubuntu-patch' % devel, '--tag', 'patch', - '--attach', debdiff, '--bts', 'debian', '--include', body, + '--attach' if internal_mua else '--include', debdiff, '--package-version', deb_version, changelog.package) check_call(cmd, env=env)