[Yum-devel] [PATCH] remove RPMDBPackageSack.installed()

Florian Festi ffesti at redhat.com
Thu Sep 27 12:23:35 UTC 2007


Hi!

While creating the new test frame work I came across several minor issues. 
One problem is the existence of the RPMDBPackageSack.installed() method. It 
is currently only supported by the RPMDBPackageSack class. This doesn't 
allow to replace the rpmdb with an inmemory PackageSack. Seth already 
rejected the idea of just moving the method to the base class as "installed" 
doesn't make any sense for non RpmDB sacks.

As I really dislike inconsistent APIs I'd like to suggest to just remove the 
usage of that method from the code. There are just 7 places in yum and one 
place in yum-utils where it is used and it is nothing more than a tiny 
convenience wrapper. In fact it can be replaced quite easily by 
.searchNevra() - one of our work horse methods. The attached patches remove 
the usage of the method and add an deprecation warning (feel free to ignore 
that if we want to keep the method).

Florian

PS: The patch also fixes a small issue when running without repositories 
which simplifies setting up the test cases.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-remove-usage-of-rpmdb.installed.patch
Type: text/x-patch
Size: 4561 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20070927/6bb83c9b/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Deprecate-RPMDBPackageSack.installed.patch
Type: text/x-patch
Size: 898 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20070927/6bb83c9b/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix-copy-and-paste-error.patch
Type: text/x-patch
Size: 885 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20070927/6bb83c9b/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-remove-usage-of-RPMDBPackageSack.installed.patch
Type: text/x-patch
Size: 849 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20070927/6bb83c9b/attachment-0003.bin 


More information about the Yum-devel mailing list