mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-18 04:11:29 +00:00
If interaction is required (for an explanation to drop the Ubuntu changes), edit the report in the sensible-editor. Allow editing in general. Minor cleanup/consistency fixups.
This commit is contained in:
parent
25aef8b726
commit
72600ec914
11
debian/changelog
vendored
11
debian/changelog
vendored
@ -1,9 +1,18 @@
|
|||||||
ubuntu-dev-tools (0.26) UNRELEASED; urgency=low
|
ubuntu-dev-tools (0.26) UNRELEASED; urgency=low
|
||||||
|
|
||||||
|
[ Stephan Hermann ]
|
||||||
* pbuild-dist: fixed a bug with the *sudo call.
|
* pbuild-dist: fixed a bug with the *sudo call.
|
||||||
changed from $SUDOREPLACE "pbuilder" to $SUDOREPLACE -- pbuilder ...
|
changed from $SUDOREPLACE "pbuilder" to $SUDOREPLACE -- pbuilder ...
|
||||||
|
|
||||||
-- Stephan Hermann <sh@sourcecode.de> Wed, 23 Jan 2008 20:21:42 +0100
|
[ Daniel Hahler ]
|
||||||
|
* requestsync:
|
||||||
|
* If interaction is required (for an explanation to drop the Ubuntu
|
||||||
|
changes), edit the report in the sensible-editor.
|
||||||
|
When interaction is not required, ask the user if she wants to edit.
|
||||||
|
(LP: #190351)
|
||||||
|
* Exit, if versions in Ubuntu and Debian are the same already.
|
||||||
|
|
||||||
|
-- Daniel Hahler <ubuntu@thequod.de> Sat, 09 Feb 2008 02:23:44 +0100
|
||||||
|
|
||||||
ubuntu-dev-tools (0.25) hardy; urgency=low
|
ubuntu-dev-tools (0.25) hardy; urgency=low
|
||||||
|
|
||||||
|
78
requestsync
78
requestsync
@ -83,6 +83,14 @@ def debian_component(sourcepkg):
|
|||||||
component = raw_comp[1].strip()
|
component = raw_comp[1].strip()
|
||||||
return component
|
return component
|
||||||
|
|
||||||
|
def wait_for_enter_or_exit():
|
||||||
|
"""Helper function to wait for ENTER and catch Control-C for abortion."""
|
||||||
|
try:
|
||||||
|
raw_input()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print 'Abort requested. No sync request filed.'
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
print '''Usage: requestsync [-h|-n|-s|-k <keyid>|--lp] <source package> <target release> [basever]
|
print '''Usage: requestsync [-h|-n|-s|-k <keyid>|--lp] <source package> <target release> [basever]
|
||||||
|
|
||||||
@ -138,12 +146,8 @@ def mail_bug(source_package, subscribe, status, bugtitle, bugtext, keyid = None)
|
|||||||
|
|
||||||
print mail
|
print mail
|
||||||
|
|
||||||
print 'Press enter to file this bug, Control-C to abort.'
|
print 'Press ENTER to file this bug, Control-C to abort.'
|
||||||
try:
|
wait_for_enter_or_exit()
|
||||||
raw_input()
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
print 'Abort requested. No sync request filed.'
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
# get server address
|
# get server address
|
||||||
mailserver = os.getenv('DEBSMTP')
|
mailserver = os.getenv('DEBSMTP')
|
||||||
@ -211,12 +215,8 @@ def post_bug(source_package, subscibe, status, bugtitle, bugtext):
|
|||||||
|
|
||||||
print 'Summary:\n%s\n\nDescription:\n%s' % (bugtitle, bugtext)
|
print 'Summary:\n%s\n\nDescription:\n%s' % (bugtitle, bugtext)
|
||||||
|
|
||||||
print 'Press enter to file this bug, Control-C to abort.'
|
print 'Press ENTER to file this bug, Control-C to abort.'
|
||||||
try:
|
wait_for_enter_or_exit()
|
||||||
raw_input()
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
print 'Abort requested. No sync request filed.'
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
# Create bug
|
# Create bug
|
||||||
Bug = launchpadbugs.connector.ConnectBug()
|
Bug = launchpadbugs.connector.ConnectBug()
|
||||||
@ -241,6 +241,8 @@ if __name__ == '__main__':
|
|||||||
sponsorship = False
|
sponsorship = False
|
||||||
keyid = None
|
keyid = None
|
||||||
use_lp_bugs = False
|
use_lp_bugs = False
|
||||||
|
need_interaction = False
|
||||||
|
edit_report = False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
opts, args = getopt.gnu_getopt(sys.argv[1:], 'hnsk:', ('lp'))
|
opts, args = getopt.gnu_getopt(sys.argv[1:], 'hnsk:', ('lp'))
|
||||||
@ -281,24 +283,21 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
subscribe = 'ubuntu-universe-sponsors'
|
subscribe = 'ubuntu-universe-sponsors'
|
||||||
|
|
||||||
report = '''Please sync %s %s (%s) from Debian unstable (%s).
|
report = 'Please sync %s %s (%s) from Debian unstable (%s).\n\n' % (srcpkg, deb_version, component, debiancomponent)
|
||||||
''' % (srcpkg, deb_version, component, debiancomponent)
|
|
||||||
title = report[:-2]
|
title = report[:-2]
|
||||||
|
|
||||||
base_ver = cur_ver
|
base_ver = cur_ver
|
||||||
uidx = base_ver.find('ubuntu')
|
uidx = base_ver.find('ubuntu')
|
||||||
if uidx > 0:
|
if uidx > 0:
|
||||||
base_ver = base_ver[:uidx]
|
base_ver = base_ver[:uidx]
|
||||||
|
need_interaction = True
|
||||||
|
|
||||||
print 'Explanation of the Ubuntu delta and why it can be dropped:'
|
print 'There have been changes made in Ubuntu.'
|
||||||
explanation = '\nExplanation of the Ubuntu delta and why it can be dropped:\n'
|
print 'Please edit the report and give an explanation.'
|
||||||
while (explanation[-2:] != '\n\n'):
|
print 'Press ENTER to start your editor. Press Control-C to abort now. Not saving the report file will abort the request, too.'
|
||||||
try:
|
wait_for_enter_or_exit()
|
||||||
explanation += raw_input() + '\n'
|
report += '\nExplanation of the Ubuntu delta and why it can be dropped:\n\n' + \
|
||||||
except KeyboardInterrupt:
|
'ENTER_EXPLANATION_HERE\n\n'
|
||||||
print 'Abort requested. No sync request filed.'
|
|
||||||
sys.exit(1)
|
|
||||||
report += explanation
|
|
||||||
|
|
||||||
uidx = base_ver.find('build')
|
uidx = base_ver.find('build')
|
||||||
if uidx > 0:
|
if uidx > 0:
|
||||||
@ -310,6 +309,39 @@ if __name__ == '__main__':
|
|||||||
report += 'Changelog since current %s version %s:\n\n' % (release, cur_ver)
|
report += 'Changelog since current %s version %s:\n\n' % (release, cur_ver)
|
||||||
report += debian_changelog(srcpkg, debiancomponent, base_ver) + '\n'
|
report += debian_changelog(srcpkg, debiancomponent, base_ver) + '\n'
|
||||||
|
|
||||||
|
# Do we want to edit the report?
|
||||||
|
if need_interaction:
|
||||||
|
edit_report = True
|
||||||
|
else:
|
||||||
|
val = raw_input('Do you want to edit the report [y/N]? ')
|
||||||
|
if val.lower() in ('y', 'yes'):
|
||||||
|
edit_report = True
|
||||||
|
|
||||||
|
if edit_report:
|
||||||
|
# Create tempfile and remember mtime
|
||||||
|
import tempfile
|
||||||
|
report_file = tempfile.NamedTemporaryFile( prefix='requestsync_' )
|
||||||
|
report_file.file.write(report)
|
||||||
|
report_file.file.flush()
|
||||||
|
mtime_before = os.stat( report_file.name ).st_mtime
|
||||||
|
|
||||||
|
# Launch editor
|
||||||
|
try:
|
||||||
|
editor = subprocess.check_call( ['sensible-editor', report_file.name] )
|
||||||
|
except CalledProcessError, e:
|
||||||
|
print >>sys.stderr, 'sensible-editor returned with %s: %s\nAborting.' % (editor.returncode, e)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
# Check if the tempfile has been changed
|
||||||
|
report_file_info = os.stat( report_file.name )
|
||||||
|
if mtime_before == os.stat( report_file.name ).st_mtime:
|
||||||
|
print >>sys.stderr, 'The temporary file %s has not been changed. Aborting. [Press ENTER]' % (report_file.name,)
|
||||||
|
raw_input()
|
||||||
|
sys.exit(1)
|
||||||
|
report_file.file.seek(0)
|
||||||
|
report = report_file.file.read()
|
||||||
|
report_file.file.close()
|
||||||
|
|
||||||
# mail or post the sync request
|
# mail or post the sync request
|
||||||
srcpkg = not newsource and srcpkg or None
|
srcpkg = not newsource and srcpkg or None
|
||||||
if use_lp_bugs:
|
if use_lp_bugs:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user