Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
historydb: Prevent insertion of duplicate group packages
When a package is included in a comps group multiple times, dnf5 attempts to insert that package multiple times into the `comps_group_package table` of the transaction history database. However, the table enforces a unique constraint on the (group_id, name_id) tuple. This results in terminating dnf5 process. This patch modifies the CompsGroupPackageDbUtils::comps_group_packages_insert() method to track which packages have already been inserted and skip duplicates. Here is an example of such group with duplicated packages from rpmfusion repository (see the `libavcodec-freeworld` package): <group> <id>multimedia</id> <name>Multimedia</name> <description>Audio/video framework common to desktops</description> <default>false</default> <uservisible>false</uservisible> <packagelist> <packagereq>gstreamer1-plugins-bad-freeworld</packagereq> <packagereq>gstreamer1-plugins-ugly</packagereq> <packagereq type="conditional" requires="chromium">libavcodec-freeworld</packagereq> <packagereq type="conditional" requires="firefox">libavcodec-freeworld</packagereq> <packagereq type="conditional" requires="libavcodec-free">libavcodec-freeworld</packagereq> <packagereq type="conditional" requires="libheif">libheif-freeworld</packagereq> <packagereq type="conditional" requires="pipewire">pipewire-codec-aptx</packagereq> <packagereq type="conditional" requires="qt5-qtwebengine">qt5-qtwebengine-freeworld</packagereq> <packagereq type="conditional" requires="vlc-libs">vlc-plugins-freeworld</packagereq> </packagelist> </group> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2263762
- Loading branch information