Florian Festi wrote:
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.
------------------------------------------------------------------------
_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel
RPMDBPackageSack.installed() make the code look better and make it
easier to understand.
self.rpmdb.installed(po)
Look much better then
self.rpmdb.searchNevra(po.name, po.epoch, po.version, po.release, po.arch)
Removing the installed() method is a API breakage and there is other API users
out there (yumex, pirut, pungi, revisor, PackageKit etc)
and api users (like me) hate this kind of breakage :)
from an API users point of view, he/she want to simple and easy to use
API, and in this case 'installed(po)' is much better than
'self.rpmdb.searchNevra(n,e,v,r,a)', there have also been done a lot of
work to replace n,e,v,r,a tuples with po object, this is a step backwards.
Tim
_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel