submittodebian: Revert Ubuntu Maintainer mangling, and re-build the source

package before diffing. (LP: #902233)
This commit is contained in:
Stefano Rivera 2012-05-06 19:46:05 +02:00
parent d692d7b79b
commit 055dce8f40
2 changed files with 18 additions and 0 deletions

2
debian/changelog vendored
View File

@ -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 <stefanor@debian.org> Wed, 25 Apr 2012 17:38:58 +0200

View File

@ -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)