[pacman-dev] [PATCH] Remove need to explicitly register the local DB

Xavier Chantry chantry.xavier at gmail.com
Sat Jan 29 12:46:37 EST 2011


On Sat, Jan 29, 2011 at 10:09 AM, Xyne <xyne at archlinux.ca> wrote:
>
> Even if it is negligible, it's munging separate logic together. Given that the
> purpose is presumably to save coders a few lines of code, I still think it
> would make more sense to use a wrapper function to do that when getting the
> handle.
>

It's not separate logic. Dan commit log might have been a bit misleading.

alpm_initialize initializes (wow) whatever is needed for the other
functions to work. What we do there is just allocate some structures
like the handle, and now handle->db_local as well. We are talking
about one calloc and one strdup here to setup db_local. Really no big
deal, there is no loading of the db, not even a check that one exists
at all.
And it does make it simpler for libalpm users. And as Dan said its
symetric with alpm_release.


More information about the pacman-dev mailing list