Comment 1 for bug 453543

Revision history for this message
BJ Dierkes (derks) wrote :

http://yum.baseurl.org/ticket/296

---
The following is the Yum feature request added upstream
---

An issue exists with compare_providers if the packages that provide a dependency do not have the same name. For example:

root@el5-x86_64 ~]# rpm -qa | grep php
php53-5.3.0-5.ius
php53-common-5.3.0-5.ius
php53-cli-5.3.0-5.ius

root@el5-x86_64 ~]# yum install cacti

In this situation, the following is true based on the repos available:

    * cacti requires php-mysql, php-snmp
    * php53-mysql provides php-mysql, php53-snmp provides php-snmp
    * php-mysql provides php-mysql, php-snmp provides php-snmp (stock rhel packages)

That said, Yum resolves the dependency with stock php-mysql, and php-snmp even though php53 is installed and php53-mysql/php53-snmp are available. This happens because compare_providers does not compare versions if the package name is different, and php-mysql/php-snmp are the shortest package names so they win out.

I propose an additional check to add to compare providers to accommodate the comparison of different package names that provide the same dependency, based on whether that provider's sourcerpm is already installed. Meaning, if the providers source rpm is already installed and provides the dependency then it should be awarded points.

This might sound expensive, but the only expensive part is generating the self.installedSourceRPMS list (which is only once). The per pkg operation is simply a 'if po.sourcerpm in self.installedSourceRPMS' check.

Patch against latest git checkout attached.