mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-12 15:41:09 +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):
|
||||
archive = Distribution("ubuntu").getArchive()
|
||||
for pass_ in ("source", "binary"):
|
||||
try:
|
||||
package_spph = archive.getSourcePackage(package, distribution)
|
||||
return package_spph
|
||||
except PackageNotFoundException as e:
|
||||
try:
|
||||
package_spph = archive.getSourcePackage(package, distribution)
|
||||
return package_spph
|
||||
except PackageNotFoundException as e:
|
||||
try:
|
||||
apt_pkg = apt.Cache()[package]
|
||||
except KeyError:
|
||||
Logger.error(str(e))
|
||||
sys.exit(1)
|
||||
package = apt_pkg.candidate.source_name
|
||||
Logger.info(
|
||||
"Binary package specified, considering its source package instead: %s", package
|
||||
)
|
||||
apt_pkg = apt.Cache()[package]
|
||||
except KeyError:
|
||||
Logger.error(str(e))
|
||||
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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user