From 989aecd253e7e2609f58a473db81a19992737f0e Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Sun, 6 Mar 2011 00:48:24 +0200 Subject: [PATCH] Canonicalise suites (use code-names) before passing them to rmadison. --- debian/changelog | 1 + pull-debian-source | 4 ++-- ubuntutools/requestsync/mail.py | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 50098d3..b4796e4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ ubuntu-dev-tools (0.120) UNRELEASED; urgency=low [ Stefano Rivera ] * ubuntutools.archive: Filter rmadison results. (LP: #710579) + - Canonicalise suites (use code-names) before passing them to rmadison. * pull-{lp,debian}-source: Download requested versions, as well as simply the latest version in a release. diff --git a/pull-debian-source b/pull-debian-source index 6240174..578f020 100755 --- a/pull-debian-source +++ b/pull-debian-source @@ -60,8 +60,8 @@ def main(): component = None debian_info = DebianDistroInfo() - if version in debian_info.all or debian_info.codename(version) is not None: - suite = version + if debian_info.codename(version, default=version) in debian_info.all: + suite = debian_info.codename(version, default=version) line = list(rmadison('debian', package, suite, 'source')) if not line: Logger.error('Unable to find %s in Debian suite "%s".', package, diff --git a/ubuntutools/requestsync/mail.py b/ubuntutools/requestsync/mail.py index 30c5f54..923907f 100644 --- a/ubuntutools/requestsync/mail.py +++ b/ubuntutools/requestsync/mail.py @@ -27,6 +27,7 @@ import smtplib import socket from debian.changelog import Version from ubuntutools.archive import rmadison, FakeSPPH +from ubuntutools.distro_info import DebianDistroInfo from ubuntutools.requestsync.common import raw_input_exit_on_ctrlc from ubuntutools.lp.udtexceptions import PackageNotFoundException @@ -39,6 +40,11 @@ __all__ = [ ] def getSrcPkg(distro, name, release): + if distro == 'debian': + # Canonicalise release: + debian_info = DebianDistroInfo() + release = debian_info.codename(release, default=release) + lines = list(rmadison(distro, name, suite=release, arch='source')) if not lines: raise PackageNotFoundException("'%s' doesn't appear to exist "