mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-29 20:01:07 +00:00
Add -d option to requestsync to allow requesting syncs from other Debian distros than unstable.
This commit is contained in:
parent
fcb0d7166a
commit
4a6e0118c1
20
requestsync
20
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)
|
print "%s doesn't appear to exist in %s, specify -n for a package not in Ubuntu." % (sourcepkg, release)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def cur_deb_version(sourcepkg):
|
def cur_deb_version(sourcepkg, distro):
|
||||||
'''Return the current debian version of a package in unstable.'''
|
'''Return the current debian version of a package in a Debian distro.'''
|
||||||
madison = subprocess.Popen(['rmadison', '-u', 'debian', '-a', 'source', \
|
madison = subprocess.Popen(['rmadison', '-u', 'debian', '-a', 'source', \
|
||||||
'-s', 'unstable', sourcepkg], \
|
'-s', distro, sourcepkg], \
|
||||||
stdout=subprocess.PIPE)
|
stdout=subprocess.PIPE)
|
||||||
out = madison.communicate()[0]
|
out = madison.communicate()[0]
|
||||||
assert (madison.returncode == 0)
|
assert (madison.returncode == 0)
|
||||||
@ -81,9 +81,9 @@ def debian_changelog(sourcepkg, component, version):
|
|||||||
|
|
||||||
return ch
|
return ch
|
||||||
|
|
||||||
def debian_component(sourcepkg):
|
def debian_component(sourcepkg, distro):
|
||||||
'''Return the Debian component for the source package.'''
|
'''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)
|
sourcepkg], stdout=subprocess.PIPE)
|
||||||
out = madison.communicate()[0]
|
out = madison.communicate()[0]
|
||||||
assert (madison.returncode == 0)
|
assert (madison.returncode == 0)
|
||||||
@ -358,9 +358,10 @@ if __name__ == '__main__':
|
|||||||
keyid = None
|
keyid = None
|
||||||
use_lp_bugs = False
|
use_lp_bugs = False
|
||||||
need_interaction = False
|
need_interaction = False
|
||||||
|
distro = 'unstable'
|
||||||
|
|
||||||
try:
|
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:
|
except getopt.GetoptError:
|
||||||
usage()
|
usage()
|
||||||
for o, a in opts:
|
for o, a in opts:
|
||||||
@ -368,6 +369,7 @@ if __name__ == '__main__':
|
|||||||
if o == '-n': newsource = True
|
if o == '-n': newsource = True
|
||||||
if o == '-s': sponsorship = True
|
if o == '-s': sponsorship = True
|
||||||
if o == '-k': keyid = a
|
if o == '-k': keyid = a
|
||||||
|
if o == '-d': distro = a
|
||||||
if o == '--lp': use_lp_bugs = True
|
if o == '--lp': use_lp_bugs = True
|
||||||
|
|
||||||
if len(args) not in (2, 3):
|
if len(args) not in (2, 3):
|
||||||
@ -384,8 +386,8 @@ if __name__ == '__main__':
|
|||||||
if not newsource:
|
if not newsource:
|
||||||
(cur_ver, component) = cur_version_component(srcpkg, release)
|
(cur_ver, component) = cur_version_component(srcpkg, release)
|
||||||
|
|
||||||
debiancomponent = debian_component(srcpkg)
|
debiancomponent = debian_component(srcpkg, distro)
|
||||||
deb_version = cur_deb_version(srcpkg)
|
deb_version = cur_deb_version(srcpkg, distro)
|
||||||
|
|
||||||
if deb_version == cur_ver:
|
if deb_version == cur_ver:
|
||||||
print 'The versions in Debian and Ubuntu are the same already (%s). Aborting.' % (deb_version,)
|
print 'The versions in Debian and Ubuntu are the same already (%s). Aborting.' % (deb_version,)
|
||||||
@ -401,7 +403,7 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
subscribe = 'ubuntu-universe-sponsors'
|
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]
|
title = report[:-2]
|
||||||
|
|
||||||
base_ver = cur_ver
|
base_ver = cur_ver
|
||||||
|
Loading…
x
Reference in New Issue
Block a user