* Merged changes to requestsync by Jelmer Vernooij.

This commit is contained in:
Jonathan Patrick Davies 2008-08-25 11:06:36 +01:00
commit 159df6ac27
2 changed files with 18 additions and 10 deletions

5
debian/changelog vendored
View File

@ -1,7 +1,12 @@
ubuntu-dev-tools (0.42ubuntu1) intrepid; urgency=low
[Jonathan Patrick Davies]
* requestsync: Exit when connecting to Launchpad fails.
[ Jelmer Vernooij ]
* requestsync: Add -d option to allow overriding the Debian distro to sync
from. (LP: #253497)
-- Jonathan Patrick Davies <jpds@ubuntu.com> Sun, 24 Aug 2008 21:43:30 +0100
ubuntu-dev-tools (0.41) intrepid; urgency=low

View File

@ -104,10 +104,10 @@ def cur_version_component(sourcepkg, release):
print "%s doesn't appear to exist in %s, specify -n for a package not in Ubuntu." % (sourcepkg, release)
sys.exit(1)
def cur_deb_version(sourcepkg):
'''Return the current debian version of a package in unstable.'''
def cur_deb_version(sourcepkg, distro):
'''Return the current debian version of a package in a Debian distro.'''
madison = subprocess.Popen(['rmadison', '-u', 'debian', '-a', 'source', \
'-s', 'unstable', sourcepkg], \
'-s', distro, sourcepkg], \
stdout=subprocess.PIPE)
out = madison.communicate()[0]
assert (madison.returncode == 0)
@ -145,9 +145,9 @@ def debian_changelog(sourcepkg, component, version):
return ch
def debian_component(sourcepkg):
def debian_component(sourcepkg, distro):
'''Return the Debian component for the source package.'''
madison = subprocess.Popen(['rmadison', '-u', 'debian', '-a', 'source', '-s', 'unstable', \
madison = subprocess.Popen(['rmadison', '-u', 'debian', '-a', 'source', '-s', distro, \
sourcepkg], stdout=subprocess.PIPE)
out = madison.communicate()[0]
assert (madison.returncode == 0)
@ -172,13 +172,14 @@ def raw_input_exit_on_ctrlc(*args, **kwargs):
sys.exit(1)
def usage():
print '''Usage: requestsync [-h|-n|-k <keyid>|--lp] <source package> <target release> [basever]
print '''Usage: requestsync [-d distro|-h|-n|-k <keyid>|--lp] <source package> <target release> [basever]
In some cases, the base version (fork point from Debian) cannot be determined
automatically, and you'll get a complete Debian changelog. Specify the correct
base version of the package in Ubuntu.
Options:
-d distro override Debian distribution to sync from [unstable]
-h print this help
-n new source package (doesn't exist yet in Ubuntu)
-k <keyid> sign email with <keyid> (only used when submitting per email)
@ -409,15 +410,17 @@ if __name__ == '__main__':
keyid = None
use_lp_bugs = False
need_interaction = False
distro = 'unstable'
try:
opts, args = getopt.gnu_getopt(sys.argv[1:], 'hnk:', ('lp'))
opts, args = getopt.gnu_getopt(sys.argv[1:], 'hnd:k:', ('lp'))
except getopt.GetoptError:
usage()
for o, a in opts:
if o == '-h': usage()
if o == '-n': newsource = True
if o == '-k': keyid = a
if o == '-d': distro = a
if o == '--lp': use_lp_bugs = True
if len(args) not in (2, 3):
@ -435,8 +438,8 @@ if __name__ == '__main__':
if not newsource:
(cur_ver, component) = cur_version_component(srcpkg, release)
debiancomponent = debian_component(srcpkg)
deb_version = cur_deb_version(srcpkg)
debiancomponent = debian_component(srcpkg, distro)
deb_version = cur_deb_version(srcpkg, distro)
sponsorship = checkNeedsSponsorship(component)
@ -454,7 +457,7 @@ if __name__ == '__main__':
else:
subscribe = 'ubuntu-universe-sponsors'
report = 'Please sync %s %s (%s) from Debian unstable (%s).\n\n' % (srcpkg, deb_version, component, debiancomponent)
report = 'Please sync %s %s (%s) from Debian %s (%s).\n\n' % (srcpkg, deb_version, component, distro, debiancomponent)
title = report[:-2]
base_ver = cur_ver