oamg / convert2rhel

A tool to automate converting Oracle/CentOS/Scientific/Rocky/Alma Linux to Red Hat Enterprise Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

get_problematic_pkgs() adds packages that it shouldn't

abadger opened this issue · comments

The regular expression for Requires in get_problematic_pkgs() can parse yum output incorrectly and end up adding package names that either don't exist or are different than the package which was actually specified. For instance, python2_hawkey >= 0.7.0 is parsed into python2 I'm unsure how big a problem this is in practice (In the python2-hawkey case, I believe it will just result in downgrading the python2 package unnecessarily, which will add time to the run but won't be an error) but we should look into fixing it.

We can probably call either the yum or rpm apis to do so; at the command line, rpm -q --whatprovides <REQUIRES> will give us the package name of any Requires in a package that is installed. yum whatprovides <REQUIRES> if we need to search the repositories for the provide, not just the installed packages.

Once fixed, we should update the unittest to test that the output of get_problematic_pkgs() is exactly what we expect rather than merely checking that the values we expect to be there are (but not checking whether extra values are present).