diff --git a/debian/changelog b/debian/changelog index 8476876..d01b289 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Sun, 24 Aug 2008 21:43:30 +0100 ubuntu-dev-tools (0.41) intrepid; urgency=low diff --git a/requestsync b/requestsync index 2df7093..66edaa9 100755 --- a/requestsync +++ b/requestsync @@ -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 |--lp] [basever] + print '''Usage: requestsync [-d distro|-h|-n|-k |--lp] [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 sign email with (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