Fix case where package name is appstream id for another app
PackageKitBackend::search relied on resourcesByPackageNames treating its input as an appstream id in case it couldn't find a package with an app of that name. This usually works, because the appstream ids usually don't get treated as actual package names.
However, when a package name is the same as an appstream id for another app, PackageKitBackend::search gets in its result two entries for the same app: once for when it passes the actual appstream id for the app and another for when it passes an appstream id that happens to match a package name for the former app. This causes the assertion in stream->setresources
to fail.
This happens in the Fedora repos for "extremetuxracer": the package "extremetuxracer" corresponds to appstream "etr.desktop" and appstream "extremetuxracer" corresponds to packages "extremetuxracer-common" and "extremetuxracer-papercuts-fonts".
This bug only happens if both apps are part of components
, but components
includes all of the components in the pool if using a release version of appstream.
This patch fixes the bug by adding a distinction between package names and appstream ids in m_packages.packages.