mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-12 01:11:29 +00:00
submittodebian: Style tweaks
This commit is contained in:
parent
1804158370
commit
4f308cdf62
@ -43,15 +43,18 @@ except ImportError:
|
|||||||
u"which isn't currently installed.")
|
u"which isn't currently installed.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def get_most_recent_debian_version(changelog):
|
def get_most_recent_debian_version(changelog):
|
||||||
for block in changelog:
|
for block in changelog:
|
||||||
version = block.version.full_version
|
version = block.version.full_version
|
||||||
if not re.search('(ubuntu|build)', version):
|
if not re.search('(ubuntu|build)', version):
|
||||||
return version
|
return version
|
||||||
|
|
||||||
|
|
||||||
def get_bug_body(changelog):
|
def get_bug_body(changelog):
|
||||||
entry = next(iter(changelog))
|
entry = next(iter(changelog))
|
||||||
msg = """In Ubuntu, the attached patch was applied to achieve the following:
|
msg = """
|
||||||
|
In Ubuntu, the attached patch was applied to achieve the following:
|
||||||
|
|
||||||
## ---------------- REPLACE THIS WITH ACTUAL INFORMATION ---------------------
|
## ---------------- REPLACE THIS WITH ACTUAL INFORMATION ---------------------
|
||||||
## Please add all necessary information about why the change needed to go in
|
## Please add all necessary information about why the change needed to go in
|
||||||
@ -66,6 +69,7 @@ Thanks for considering the patch.
|
|||||||
""" % ("\n".join([a for a in entry.changes()]))
|
""" % ("\n".join([a for a in entry.changes()]))
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
|
|
||||||
def build_source_package():
|
def build_source_package():
|
||||||
if os.path.isdir('.bzr'):
|
if os.path.isdir('.bzr'):
|
||||||
cmd = ['bzr', 'bd', '-S', '--', '-uc', '-us', '-nc']
|
cmd = ['bzr', 'bd', '-S', '--', '-uc', '-us', '-nc']
|
||||||
@ -73,6 +77,7 @@ def build_source_package():
|
|||||||
cmd = ['debuild', '-S', '-uc', '-us', '-nc']
|
cmd = ['debuild', '-S', '-uc', '-us', '-nc']
|
||||||
check_call(cmd)
|
check_call(cmd)
|
||||||
|
|
||||||
|
|
||||||
def gen_debdiff(tmpdir, changelog):
|
def gen_debdiff(tmpdir, changelog):
|
||||||
pkg = changelog.package
|
pkg = changelog.package
|
||||||
|
|
||||||
@ -88,9 +93,9 @@ def gen_debdiff(tmpdir, changelog):
|
|||||||
print "Extracting bzr diff between %s and %s" % (oldver, newver)
|
print "Extracting bzr diff between %s and %s" % (oldver, newver)
|
||||||
else:
|
else:
|
||||||
if oldver.epoch is not None:
|
if oldver.epoch is not None:
|
||||||
oldver = str(oldver)[str(oldver).index(":")+1:]
|
oldver = str(oldver)[str(oldver).index(":") + 1:]
|
||||||
if newver.epoch is not None:
|
if newver.epoch is not None:
|
||||||
newver = str(newver)[str(newver).index(":")+1:]
|
newver = str(newver)[str(newver).index(":") + 1:]
|
||||||
|
|
||||||
olddsc = '../%s_%s.dsc' % (pkg, oldver)
|
olddsc = '../%s_%s.dsc' % (pkg, oldver)
|
||||||
newdsc = '../%s_%s.dsc' % (pkg, newver)
|
newdsc = '../%s_%s.dsc' % (pkg, newver)
|
||||||
@ -112,7 +117,8 @@ def gen_debdiff(tmpdir, changelog):
|
|||||||
|
|
||||||
return debdiff
|
return debdiff
|
||||||
|
|
||||||
def check_file(fname, critical = True):
|
|
||||||
|
def check_file(fname, critical=True):
|
||||||
if os.path.exists(fname):
|
if os.path.exists(fname):
|
||||||
return fname
|
return fname
|
||||||
else:
|
else:
|
||||||
@ -121,6 +127,7 @@ def check_file(fname, critical = True):
|
|||||||
print u"Couldn't find «%s».\n" % fname
|
print u"Couldn't find «%s».\n" % fname
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def submit_bugreport(body, debdiff, deb_version, changelog):
|
def submit_bugreport(body, debdiff, deb_version, changelog):
|
||||||
try:
|
try:
|
||||||
devel = UbuntuDistroInfo().devel()
|
devel = UbuntuDistroInfo().devel()
|
||||||
@ -147,7 +154,8 @@ def submit_bugreport(body, debdiff, deb_version, changelog):
|
|||||||
'--no-check-available',
|
'--no-check-available',
|
||||||
'--no-check-installed',
|
'--no-check-installed',
|
||||||
'--pseudo-header', 'User: ubuntu-devel@lists.ubuntu.com',
|
'--pseudo-header', 'User: ubuntu-devel@lists.ubuntu.com',
|
||||||
'--pseudo-header', 'Usertags: origin-ubuntu %s ubuntu-patch' % devel,
|
'--pseudo-header', 'Usertags: origin-ubuntu %s ubuntu-patch'
|
||||||
|
% devel,
|
||||||
'--tag', 'patch',
|
'--tag', 'patch',
|
||||||
'--attach', debdiff,
|
'--attach', debdiff,
|
||||||
'--bts', 'debian',
|
'--bts', 'debian',
|
||||||
@ -197,6 +205,7 @@ reportbug --configure for its configuration wizard.
|
|||||||
if YesNoQuestion().ask("Continue submitting this bug", "yes") == "no":
|
if YesNoQuestion().ask("Continue submitting this bug", "yes") == "no":
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
description = 'Submit the Ubuntu changes in a package to Debian. ' + \
|
description = 'Submit the Ubuntu changes in a package to Debian. ' + \
|
||||||
'Run inside an unpacked Ubuntu source package.'
|
'Run inside an unpacked Ubuntu source package.'
|
||||||
@ -209,7 +218,7 @@ def main():
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
check_reportbug_config()
|
check_reportbug_config()
|
||||||
changelog_file = (check_file('debian/changelog', critical = False) or
|
changelog_file = (check_file('debian/changelog', critical=False) or
|
||||||
check_file('../debian/changelog'))
|
check_file('../debian/changelog'))
|
||||||
changelog = Changelog(file(changelog_file).read())
|
changelog = Changelog(file(changelog_file).read())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user