From 24e1161d3c085fdff4957ba2a8c3a84a30ac2245 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Mon, 22 Oct 2012 21:42:58 +0200 Subject: [PATCH] syncpackage, requestsync: Check the Release pocket if we can't find an Ubuntu package in the requested pocket. (LP: #1069867) --- debian/changelog | 2 ++ ubuntutools/requestsync/lp.py | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 455deb2..0e368f5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,8 @@ ubuntu-dev-tools (0.144) UNRELEASED; urgency=low * ubuntutools.question: Catch EOF and SIGINT on all input and bail out. (LP: #1037488) * pull-lp-source: Catch errors parsing JSON we got from DDE (LP: #1059848) + * syncpackage, requestsync: Check the Release pocket if we can't find an + Ubuntu package in the requested pocket. (LP: #1069867) [ Benjamin Drung ] * seeded-in-ubuntu: State in error message that it takes a source package. diff --git a/ubuntutools/requestsync/lp.py b/ubuntutools/requestsync/lp.py index 70f1df1..019efdf 100644 --- a/ubuntutools/requestsync/lp.py +++ b/ubuntutools/requestsync/lp.py @@ -27,10 +27,12 @@ from devscripts.logger import Logger from distro_info import DebianDistroInfo, DistroDataOutdated from httplib2 import Http, HttpLib2Error +from ubuntutools.lp import udtexceptions from ubuntutools.lp.lpapicache import (Launchpad, Distribution, PersonTeam, DistributionSourcePackage) from ubuntutools.question import confirmation_prompt + def get_debian_srcpkg(name, release): debian = Distribution('debian') debian_archive = debian.getArchive() @@ -42,11 +44,18 @@ def get_debian_srcpkg(name, release): return debian_archive.getSourcePackage(name, release) + def get_ubuntu_srcpkg(name, release, pocket='Release'): ubuntu = Distribution('ubuntu') ubuntu_archive = ubuntu.getArchive() - return ubuntu_archive.getSourcePackage(name, release, pocket) + try: + return ubuntu_archive.getSourcePackage(name, release, pocket) + except udtexceptions.PackageNotFoundException: + if pocket != 'Release': + return get_ubuntu_srcpkg(name, release, 'Release') + raise + def need_sponsorship(name, component, release): '''