mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-12 23:51:08 +00:00
fix(requestbackport): Remove useless loop from locate_package
Commit 0f3d2fed2a4ed67b90b5d49aab25ca2bda5d9d37 removed the difference between the two loop iterations in `locate_package`. So drop the useless second iteration. Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
This commit is contained in:
parent
909d945af4
commit
a160def2ab
@ -164,20 +164,19 @@ def find_rdepends(releases, published_binaries):
|
|||||||
|
|
||||||
def locate_package(package, distribution):
|
def locate_package(package, distribution):
|
||||||
archive = Distribution("ubuntu").getArchive()
|
archive = Distribution("ubuntu").getArchive()
|
||||||
for pass_ in ("source", "binary"):
|
try:
|
||||||
|
package_spph = archive.getSourcePackage(package, distribution)
|
||||||
|
return package_spph
|
||||||
|
except PackageNotFoundException as e:
|
||||||
try:
|
try:
|
||||||
package_spph = archive.getSourcePackage(package, distribution)
|
apt_pkg = apt.Cache()[package]
|
||||||
return package_spph
|
except KeyError:
|
||||||
except PackageNotFoundException as e:
|
Logger.error(str(e))
|
||||||
try:
|
sys.exit(1)
|
||||||
apt_pkg = apt.Cache()[package]
|
package = apt_pkg.candidate.source_name
|
||||||
except KeyError:
|
Logger.info(
|
||||||
Logger.error(str(e))
|
"Binary package specified, considering its source package instead: %s", package
|
||||||
sys.exit(1)
|
)
|
||||||
package = apt_pkg.candidate.source_name
|
|
||||||
Logger.info(
|
|
||||||
"Binary package specified, considering its source package instead: %s", package
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def request_backport(package_spph, source, destinations):
|
def request_backport(package_spph, source, destinations):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user