syncpackage, requestsync: Check the Release pocket if we can't find an

Ubuntu package in the requested pocket. (LP: #1069867)
This commit is contained in:
Stefano Rivera 2012-10-22 21:42:58 +02:00
parent 0adca3f7a1
commit 24e1161d3c
2 changed files with 12 additions and 1 deletions

2
debian/changelog vendored
View File

@ -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.

View File

@ -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):
'''