Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_backend_component(self, pkginfo):
try:
backend_component = self.backend_table[pkginfo]
return backend_component
except KeyError:
if pkginfo.pkg_hash.startswith("a"):
backend_component = _apt.search_for_pkginfo_apt_pkg(pkginfo)
else:
if self.have_flatpak:
backend_component = _flatpak.search_for_pkginfo_as_component(pkginfo)
self.backend_table[pkginfo] = backend_component
# It's possible at some point we'll refresh appstream at runtime, if so we'll
# want to clear cached data so it can be re-fetched anew. For now there's
# no need. The only possible case is on-demand adding of a remote (from
# launching a .flatpakref file), and in this case, we won't have had anything
# cached for it to clear anyhow.
# pkginfo.clear_cached_info()
return backend_component