Ticket #296 (closed enhancement: fixed)

Opened 2 years ago

Last modified 3 months ago

Add points if po.sourcerpm is already installed (compare_providers)

Reported by: derks Assigned to: skvidal
Priority: minor Milestone:
Component: yum Version: Stable: 3.2.x
Keywords: compare_providers depsolve Cc:

Description

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.

Attachments

yum-3.2.x-sourcerpm_installed_check.patch (1.7 kB) - added by derks on 10/16/09 04:09:20.
Add points if po.sourcerpm is already installed (compare_providers)

Change History

10/16/09 04:09:20 changed by derks

  • attachment yum-3.2.x-sourcerpm_installed_check.patch added.

Add points if po.sourcerpm is already installed (compare_providers)

10/19/09 16:14:59 changed by derks

This issue is resolved by the following commits:

commit fdc6f9e39eaa99d3535032b30b7fc5357d5751fc Author: James Antill <james@and.org> Date: Sat Oct 17 23:52:28 2009 -0400

Is base package name installed, added as a compare_providers test

Should fix the problem that ticket/296 has

Also add debug output for reqpo common repoid comparison.

Also bump the nudge from 2 to 8, so it should nudge past shortest name.

commit 1ba0b3947f71c57a1106fd448d7ec1445f1a54be Author: James Antill <james@and.org> Date: Sat Oct 17 23:40:22 2009 -0400

Add .base_package_name, which parses .sourcerpm or uses .name

This is added to RpmBase?, so we can do it for installed pkgs too, we

could move it even higher as it only actually needs .name to work.

Also get rid of an extra .isSrpm() call.

01/08/10 15:50:46 changed by james

  • status changed from new to closed.
  • resolution set to fixed.

Yep, should be fixed now :).