mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-13 08:01:09 +00:00
Allow requestsync/syncpackage to work with either codename or alias
This commit is contained in:
parent
c4e998e165
commit
f0d22226a9
@ -56,15 +56,18 @@ def _get_srcpkg(distro, name, release):
|
|||||||
# Canonicalise release:
|
# Canonicalise release:
|
||||||
debian_info = DebianDistroInfo()
|
debian_info = DebianDistroInfo()
|
||||||
try:
|
try:
|
||||||
release = debian_info.codename(release, default=release)
|
codename = debian_info.codename(release, default=release)
|
||||||
except DistroDataOutdated as e:
|
except DistroDataOutdated as e:
|
||||||
Logger.warn(e)
|
Logger.warn(e)
|
||||||
|
|
||||||
lines = list(rmadison(distro, name, suite=release, arch='source'))
|
lines = list(rmadison(distro, name, suite=codename, arch='source'))
|
||||||
if not lines:
|
if not lines:
|
||||||
raise PackageNotFoundException("'%s' doesn't appear to exist "
|
lines = list(rmadison(distro, name, suite=release, arch='source'))
|
||||||
"in %s '%s'"
|
if not lines:
|
||||||
% (name, distro.capitalize(), release))
|
raise PackageNotFoundException("'%s' doesn't appear to exist "
|
||||||
|
"in %s '%s'"
|
||||||
|
% (name, distro.capitalize(),
|
||||||
|
release))
|
||||||
pkg = max(lines, key=lambda x: Version(x['version']))
|
pkg = max(lines, key=lambda x: Version(x['version']))
|
||||||
|
|
||||||
return FakeSPPH(pkg['source'], pkg['version'], pkg['component'], distro)
|
return FakeSPPH(pkg['source'], pkg['version'], pkg['component'], distro)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user