This stuff still requires fixing, right? I see these functions are now
declared in db.h, but we probably need generic functions here.
So the names are wrong. Maybe we could just rename them with :
s/cache/list or something.
Actually, it seems like we mostly need get_pkglist and free_pkglist.
And same for grouplist.
I don't know why we need to handle add_pkgincache and
These are called just after db_write and db_remove respectively. So
the implementation of these two db functions in the cache backend
could handle the cache themselves.
Hm well, just after writing this, I see there is a problem with the
db_update code :
/* Cache needs to be rebuilt */
I remember there was the same problem with db_unregister /
db_unregister_all. We have to walk through the list and remove its
items one by one. I am still not sure how to do that correctly in C.
But it reminds me of the java Iterator interface where this is
Well, I don't know, but imo it would be better if the rest of libalpm
code didn't have to deal with this cache stuff at all.
pacman-dev mailing list