From 4a6e0118c1e74c249ac9b31770c0193554542009 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 23 Aug 2008 18:14:33 +0200 Subject: [PATCH 1/3] Add -d option to requestsync to allow requesting syncs from other Debian distros than unstable. --- requestsync | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/requestsync b/requestsync index 4cfde41..c58dec5 100755 --- a/requestsync +++ b/requestsync @@ -40,10 +40,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) @@ -81,9 +81,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) @@ -115,11 +115,11 @@ automatically, and you'll get a complete Debian changelog. Specify the correct base version of the package in Ubuntu. Options: - -h print this help - -n new source package (doesn't exist yet in Ubuntu) - -s request sponsoring (through ubuntu-{main,universe}-sponsors) - -k sign email with (only used when submitting per email) - --lp use python-launchpad-bugs instead of email for bug submitting + -h print this help + -n new source package (doesn't exist yet in Ubuntu) + -s request sponsoring (through ubuntu-{main,universe}-sponsors) + -k sign email with (only used when submitting per email) + --lp use python-launchpad-bugs instead of email for bug submitting ''' sys.exit(1) @@ -358,9 +358,10 @@ if __name__ == '__main__': keyid = None use_lp_bugs = False need_interaction = False + distro = 'unstable' try: - opts, args = getopt.gnu_getopt(sys.argv[1:], 'hnsk:', ('lp')) + opts, args = getopt.gnu_getopt(sys.argv[1:], 'hnsd:k:', ('lp')) except getopt.GetoptError: usage() for o, a in opts: @@ -368,6 +369,7 @@ if __name__ == '__main__': if o == '-n': newsource = True if o == '-s': sponsorship = 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): @@ -384,8 +386,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) if deb_version == cur_ver: print 'The versions in Debian and Ubuntu are the same already (%s). Aborting.' % (deb_version,) @@ -401,7 +403,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 From 97b9b9ccc2df4729de731fc4b23f8a58481f767d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 23 Aug 2008 18:28:13 +0200 Subject: [PATCH 2/3] Document -d in requestsync help. --- requestsync | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requestsync b/requestsync index debaba9..1e64ff3 100755 --- a/requestsync +++ b/requestsync @@ -171,13 +171,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) From 93ac014123e8c5e06acd85498f863c022fdc9aba Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 23 Aug 2008 18:29:26 +0200 Subject: [PATCH 3/3] Add changelog entry --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4433ae8..16fb9df 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ubuntu-dev-tools (0.42) UNRELEASED; urgency=low + + * requestsync: Add -d option to allow overriding the Debian distro to sync + from. (LP: #253497) + + -- Jelmer Vernooij Sat, 23 Aug 2008 18:28:45 +0200 + ubuntu-dev-tools (0.41) intrepid; urgency=low [ Loic Minier ]