If package A both replaces and conflicts package B, it is added
unconditionally to the replaced_by vector of package B. Add check to
only add it if it's not there to avoid inaccurate warnings of the type:
Multiple replacers for X, using first one
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
/* if a package pkg both replaces and conflicts old_abpkg,
* then add it to the replaced_by vector so that old_abpkg
* will be upgraded to ab_pkg automatically */
- if (pkg_conflicts_abstract(pkg, old_abpkg))
- abstract_pkg_vec_insert(old_abpkg->replaced_by, ab_pkg);
+ if (pkg_conflicts_abstract(pkg, old_abpkg)) {
+ if (!abstract_pkg_vec_contains(old_abpkg->replaced_by, ab_pkg))
+ abstract_pkg_vec_insert(old_abpkg->replaced_by, ab_pkg);
+ }
replaces = tmp;
replaces[count - 1] = old_abpkg;