diff --git a/debian/changelog b/debian/changelog index 4cf1892..0940448 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,8 @@ ubuntu-dev-tools (0.142) UNRELEASED; urgency=low (LP: #888736) * backportpackage: Allow unsigned backports (LP: #992739) * update-maintainer: Add a function to restore the original maintainer. + * submittodebian: Revert Ubuntu Maintainer mangling, and re-build the source + package before diffing. (LP: #902233) -- Stefano Rivera Wed, 25 Apr 2012 17:38:58 +0200 diff --git a/submittodebian b/submittodebian index d1fe8d5..7b21499 100755 --- a/submittodebian +++ b/submittodebian @@ -34,6 +34,7 @@ from distro_info import UbuntuDistroInfo, DistroDataOutdated from ubuntutools.config import ubu_email from ubuntutools.question import YesNoQuestion, EditFile from ubuntutools.subprocess import call, check_call, Popen, PIPE +from ubuntutools.update_maintainer import update_maintainer, restore_maintainer try: from debian.changelog import Changelog @@ -70,6 +71,13 @@ Thanks for considering the patch. """ % ("\n".join([a for a in entry.changes()])) return msg +def build_source_package(): + if os.path.isdir('.bzr'): + cmd = ['bzr', 'bd', '-S', '--', '-uc', '-us', '-nc'] + else: + cmd = ['debuild', '-S', '-uc', '-us', '-nc'] + check_call(cmd) + def gen_debdiff(tmpdir, changelog): pkg = changelog.package @@ -213,8 +221,16 @@ def main(): fp.write(bug_body) fp.close() + restore_maintainer('debian') + build_source_package() + update_maintainer('debian') + debdiff = gen_debdiff(tmpdir, changelog) + # Build again as the user probably doesn't expect the Maintainer to be + # reverted in the most recent build + build_source_package() + EditFile(debdiff, 'debdiff').edit(optional=True) submit_bugreport(body, debdiff, deb_version, changelog)