mirror of
				https://git.launchpad.net/ubuntu-dev-tools
				synced 2025-11-03 23:44:19 +00:00 
			
		
		
		
	Merge trunk
This commit is contained in:
		
						commit
						fce947e0f4
					
				
							
								
								
									
										4
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							@ -18,6 +18,10 @@ ubuntu-dev-tools (0.137) UNRELEASED; urgency=low
 | 
				
			|||||||
  * mk-sbuild, pbuilder-dist, ubuntu-build: Add armhf.
 | 
					  * mk-sbuild, pbuilder-dist, ubuntu-build: Add armhf.
 | 
				
			||||||
  * pull-debian-source, pull-lp-source: Resolve the source package (via DDE),
 | 
					  * pull-debian-source, pull-lp-source: Resolve the source package (via DDE),
 | 
				
			||||||
    if a binary package was requested (LP: #617349)
 | 
					    if a binary package was requested (LP: #617349)
 | 
				
			||||||
 | 
					  * submittodebian:
 | 
				
			||||||
 | 
					    - Do the report boiler-plate checking in a script that wraps an editor, so
 | 
				
			||||||
 | 
					      that we only edit the report once, after checking for duplicates.
 | 
				
			||||||
 | 
					    - rm the tmpdir with a little more force (shutil.rmtree) (LP: #899399)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  [ Andreas Moog ]
 | 
					  [ Andreas Moog ]
 | 
				
			||||||
  * sponsor-patch: Check permission to unsubscribe sponsors-team (LP: #896884)
 | 
					  * sponsor-patch: Check permission to unsubscribe sponsors-team (LP: #896884)
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										1
									
								
								debian/copyright
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								debian/copyright
									
									
									
									
										vendored
									
									
								
							@ -151,6 +151,7 @@ Files: doc/pull-debian-debdiff.1
 | 
				
			|||||||
       doc/sponsor-patch.1
 | 
					       doc/sponsor-patch.1
 | 
				
			||||||
       doc/ubuntu-dev-tools.5
 | 
					       doc/ubuntu-dev-tools.5
 | 
				
			||||||
       doc/update-maintainer.1
 | 
					       doc/update-maintainer.1
 | 
				
			||||||
 | 
					       enforced-editing-wrapper
 | 
				
			||||||
       pull-debian-debdiff
 | 
					       pull-debian-debdiff
 | 
				
			||||||
       pull-debian-source
 | 
					       pull-debian-source
 | 
				
			||||||
       requestbackport
 | 
					       requestbackport
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										62
									
								
								enforced-editing-wrapper
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										62
									
								
								enforced-editing-wrapper
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,62 @@
 | 
				
			|||||||
 | 
					#!/usr/bin/python
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Copyright (C) 2011, Stefano Rivera <stefanor@ubuntu.com>
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Permission to use, copy, modify, and/or distribute this software for any
 | 
				
			||||||
 | 
					# purpose with or without fee is hereby granted, provided that the above
 | 
				
			||||||
 | 
					# copyright notice and this permission notice appear in all copies.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 | 
				
			||||||
 | 
					# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 | 
				
			||||||
 | 
					# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 | 
				
			||||||
 | 
					# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 | 
				
			||||||
 | 
					# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 | 
				
			||||||
 | 
					# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 | 
				
			||||||
 | 
					# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Wraps sensisible-editor in checks for remaining boilerplate.
 | 
				
			||||||
 | 
					# Configured through environment variables:
 | 
				
			||||||
 | 
					# UDT_EDIT_WRAPPER_EDITOR: The user's usual $EDITOR
 | 
				
			||||||
 | 
					# UDT_EDIT_WRAPPER_VISUAL: The user's usual $VISUAL
 | 
				
			||||||
 | 
					# UDT_EDIT_WRAPPER_TEMPLATE_RE: An extra boilerplate-detecting regex.
 | 
				
			||||||
 | 
					# UDT_EDIT_WRAPPER_FILE_DESCRIPTION: The type of file being edited.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import optparse
 | 
				
			||||||
 | 
					import os
 | 
				
			||||||
 | 
					import re
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ubuntutools.question import EditFile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def main():
 | 
				
			||||||
 | 
					    parser = optparse.OptionParser('%prog [options] filename')
 | 
				
			||||||
 | 
					    options, args = parser.parse_args()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if len(args) != 1:
 | 
				
			||||||
 | 
					        parser.error('A filename must be specified')
 | 
				
			||||||
 | 
					    body = args[0]
 | 
				
			||||||
 | 
					    if not os.path.isfile(body):
 | 
				
			||||||
 | 
					        parser.error('File %s does not exist' % body)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if 'UDT_EDIT_WRAPPER_EDITOR' in os.environ:
 | 
				
			||||||
 | 
					        os.environ['EDITOR'] = os.environ['UDT_EDIT_WRAPPER_EDITOR']
 | 
				
			||||||
 | 
					    else:
 | 
				
			||||||
 | 
					        del os.environ['EDITOR']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if 'UDT_EDIT_WRAPPER_VISUAL' in os.environ:
 | 
				
			||||||
 | 
					        os.environ['VISUAL'] = os.environ['UDT_EDIT_WRAPPER_VISUAL']
 | 
				
			||||||
 | 
					    else:
 | 
				
			||||||
 | 
					        del os.environ['VISUAL']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    placeholders = []
 | 
				
			||||||
 | 
					    if 'UDT_EDIT_WRAPPER_TEMPLATE_RE' in os.environ:
 | 
				
			||||||
 | 
					        placeholders.append(re.compile(
 | 
				
			||||||
 | 
					            os.environ['UDT_EDIT_WRAPPER_TEMPLATE_RE']))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    description = os.environ.get('UDT_EDIT_WRAPPER_FILE_DESCRIPTION', 'file')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    EditFile(body, description, placeholders).edit()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if __name__ == '__main__':
 | 
				
			||||||
 | 
					    main()
 | 
				
			||||||
							
								
								
									
										1
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								setup.py
									
									
									
									
									
								
							@ -58,6 +58,7 @@ if __name__ == '__main__':
 | 
				
			|||||||
                       glob.glob("bash_completion/*")),
 | 
					                       glob.glob("bash_completion/*")),
 | 
				
			||||||
                      ('share/man/man1', glob.glob("doc/*.1")),
 | 
					                      ('share/man/man1', glob.glob("doc/*.1")),
 | 
				
			||||||
                      ('share/man/man5', glob.glob("doc/*.5")),
 | 
					                      ('share/man/man5', glob.glob("doc/*.5")),
 | 
				
			||||||
 | 
					                      ('share/ubuntu-dev-tools', ['enforced-editing-wrapper']),
 | 
				
			||||||
                     ],
 | 
					                     ],
 | 
				
			||||||
          test_suite='ubuntutools.test.discover',
 | 
					          test_suite='ubuntutools.test.discover',
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
				
			|||||||
@ -24,6 +24,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
import re
 | 
					import re
 | 
				
			||||||
 | 
					import shutil
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
from tempfile import mkdtemp
 | 
					from tempfile import mkdtemp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -118,11 +119,35 @@ def check_file(fname, critical = True):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
def submit_bugreport(body, debdiff, deb_version, changelog):
 | 
					def submit_bugreport(body, debdiff, deb_version, changelog):
 | 
				
			||||||
    devel = UbuntuDistroInfo().devel()
 | 
					    devel = UbuntuDistroInfo().devel()
 | 
				
			||||||
    cmd = ('reportbug', '-P', 'User: ubuntu-devel@lists.ubuntu.com',
 | 
					
 | 
				
			||||||
           '-P', 'Usertags: origin-ubuntu %s ubuntu-patch' % devel,
 | 
					    if os.path.dirname(sys.argv[0]).startswith('/usr/bin'):
 | 
				
			||||||
           '-T', 'patch', '-A', debdiff, '-B', 'debian', '-i', body,
 | 
					        editor_path = '/usr/share/ubuntu-dev-tools'
 | 
				
			||||||
           '-V', deb_version, changelog.package)
 | 
					    else:
 | 
				
			||||||
    check_call(cmd)
 | 
					        editor_path = os.path.dirname(sys.argv[0])
 | 
				
			||||||
 | 
					    env = dict(os.environ.items())
 | 
				
			||||||
 | 
					    if 'EDITOR' in env:
 | 
				
			||||||
 | 
					        env['UDT_EDIT_WRAPPER_EDITOR'] = env['EDITOR']
 | 
				
			||||||
 | 
					    if 'VISUAL' in env:
 | 
				
			||||||
 | 
					        env['UDT_EDIT_WRAPPER_VISUAL'] = env['VISUAL']
 | 
				
			||||||
 | 
					    env['EDITOR'] = os.path.join(editor_path, 'enforced-editing-wrapper')
 | 
				
			||||||
 | 
					    env['VISUAL'] = os.path.join(editor_path, 'enforced-editing-wrapper')
 | 
				
			||||||
 | 
					    env['UDT_EDIT_WRAPPER_TEMPLATE_RE'] = (
 | 
				
			||||||
 | 
					            '.*REPLACE THIS WITH ACTUAL INFORMATION.*')
 | 
				
			||||||
 | 
					    env['UDT_EDIT_WRAPPER_FILE_DESCRIPTION'] = 'bug report'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    cmd = ('reportbug',
 | 
				
			||||||
 | 
					           '--no-check-available',
 | 
				
			||||||
 | 
					           '--no-check-installed',
 | 
				
			||||||
 | 
					           '--pseudo-header', 'User: ubuntu-devel@lists.ubuntu.com',
 | 
				
			||||||
 | 
					           '--pseudo-header', 'Usertags: origin-ubuntu %s ubuntu-patch' % devel,
 | 
				
			||||||
 | 
					           '--tag', 'patch',
 | 
				
			||||||
 | 
					           '--attach', debdiff,
 | 
				
			||||||
 | 
					           '--bts', 'debian',
 | 
				
			||||||
 | 
					           '--include', body,
 | 
				
			||||||
 | 
					           '--package-version', deb_version,
 | 
				
			||||||
 | 
					           changelog.package)
 | 
				
			||||||
 | 
					    check_call(cmd, env=env)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def check_reportbug_config():
 | 
					def check_reportbug_config():
 | 
				
			||||||
    fn = os.path.expanduser('~/.reportbugrc')
 | 
					    fn = os.path.expanduser('~/.reportbugrc')
 | 
				
			||||||
@ -182,14 +207,11 @@ def main():
 | 
				
			|||||||
    debdiff = gen_debdiff(tmpdir, changelog)
 | 
					    debdiff = gen_debdiff(tmpdir, changelog)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    EditFile(debdiff, 'debdiff').edit(optional=True)
 | 
					    EditFile(debdiff, 'debdiff').edit(optional=True)
 | 
				
			||||||
    EditFile(body, 'bug report', [
 | 
					 | 
				
			||||||
            re.compile('.*REPLACE THIS WITH ACTUAL INFORMATION.*')
 | 
					 | 
				
			||||||
        ]).edit()
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    submit_bugreport(body, debdiff, deb_version, changelog)
 | 
					    submit_bugreport(body, debdiff, deb_version, changelog)
 | 
				
			||||||
    os.unlink(body)
 | 
					    os.unlink(body)
 | 
				
			||||||
    os.unlink(debdiff)
 | 
					    os.unlink(debdiff)
 | 
				
			||||||
    os.rmdir(tmpdir)
 | 
					    shutil.rmtree(tmpdir)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if __name__ == '__main__':
 | 
					if __name__ == '__main__':
 | 
				
			||||||
    main()
 | 
					    main()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user