mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-13 08:01:09 +00:00
pull-debian-source: Handle -p-u and -security suites.
This commit is contained in:
parent
fd49a767bb
commit
280d8c1172
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -10,6 +10,7 @@ ubuntu-dev-tools (0.120) UNRELEASED; urgency=low
|
||||
the latest version in a release.
|
||||
* pull-{lp,debian}-source, pull-debian-debdiff: Catch KeyboardInterrupt.
|
||||
(LP: #713845)
|
||||
* pull-debian-source: Handle -p-u and -security suites.
|
||||
|
||||
[ Julian Taylor ]
|
||||
* add support for cowbuilder and cowbuilder-dist in builder.py
|
||||
|
@ -24,6 +24,27 @@ from ubuntutools.config import UDTConfig
|
||||
from ubuntutools.distro_info import DebianDistroInfo
|
||||
from ubuntutools.logger import Logger
|
||||
|
||||
def is_suite(version):
|
||||
"""If version could be considered to be a Debian suite, return the
|
||||
canonical suite name. Otherwise None
|
||||
"""
|
||||
debian_info = DebianDistroInfo()
|
||||
debian_releases = debian_info.all + ['experimental']
|
||||
|
||||
if '-' in version:
|
||||
release, pocket = version.split('-', 1)
|
||||
release = debian_info.codename(release, default=release)
|
||||
if release in debian_releases:
|
||||
if pocket in ('proposed-updates', 'p-u'):
|
||||
return (release + '-proposed-updates')
|
||||
elif pocket == 'security':
|
||||
return (release + '-security')
|
||||
else:
|
||||
release = debian_info.codename(version, default=version)
|
||||
if release in debian_releases:
|
||||
return release
|
||||
return None
|
||||
|
||||
def main():
|
||||
usage = 'Usage: %prog <package> [release|version]'
|
||||
parser = optparse.OptionParser(usage)
|
||||
@ -59,9 +80,8 @@ def main():
|
||||
version = args[1] if len(args) > 1 else 'unstable'
|
||||
component = None
|
||||
|
||||
debian_info = DebianDistroInfo()
|
||||
if debian_info.codename(version, default=version) in debian_info.all:
|
||||
suite = debian_info.codename(version, default=version)
|
||||
suite = is_suite(version)
|
||||
if suite is not None:
|
||||
line = list(rmadison('debian', package, suite, 'source'))
|
||||
if not line:
|
||||
Logger.error('Unable to find %s in Debian suite "%s".', package,
|
||||
|
@ -520,6 +520,10 @@ def rmadison(url, package, suite=None, arch=None):
|
||||
stderr=subprocess.PIPE, close_fds=True)
|
||||
output = process.communicate()[0]
|
||||
assert process.wait() == 0
|
||||
|
||||
# rmadison uses some shorthand
|
||||
suite = suite.replace('-proposed-updates', '-p-u')
|
||||
|
||||
for line in output.strip().splitlines():
|
||||
pkg, ver, dist, archs = [x.strip() for x in line.split('|')]
|
||||
comp = 'main'
|
||||
|
Loading…
x
Reference in New Issue
Block a user