Description of problem: Debugging a yum depsolving problem I noticed I wasn't getting results back when I checked to see if an installed package obsoleted a package that was being proposed to be installed. I started testing various tests and found that nothing is ever returned as matching obsoletes by name or complete. Example code: import rpm ts = rpm.TransactionSet() mi = ts.dbMatch(1090, 'mod_gzip') for hdr in mi: print hdr['name'] on the system I have it should return 'httpd', at the least. I also tested it using rpm.RPMTAG_OBSOLETES, rpm.RPMTAG_OBSOLETENAME to no avail. Finally, I noticed some odd output in rpm -qa --obsoletes for example: (none)(none)(none)baobab in any case - I'm pretty sure ts.dbMatch() used to work against obsoletes, but it doesn't seem to work anymore.
rpm.RPMTAG_OBSOLETENAME is the "official" tag name. Other aliases can and do wander off. If /var/lib/rpm/Obsoletename doesn't exist, then you need to add to the tag indices that are built and do --rebuilddb. You also have to ensure that the index is populated, empty indices are not 0b in length. But using 1090 should iterate the /var/lib/rpm/Obsoletename index no matter what names/aliases are attached, and rpm -q --qf '%(name}\n' --obsoletes mod_gzip should be equivalent to the python code that you have supplied, which gives you a double check on your expectations. Have fun!
There's no index on obsoletes so match iterator can't be used to look for them, that's always been the case AFAIK. Adding indexes is easy, but it requires --rebuilddb to become usable so doing it in updates is a bit nasty.
interesting. Well this makes things kinda painful b/c walking each package is not going to be quick enough.
According to rawhide report, rpm 4.7.1 is included and that fixes the problem