[Yum-devel] yum devel series and help needed
tambet at ximian.com
Thu May 25 11:32:22 UTC 2006
On Thu, 2006-05-25 at 12:17 +0100, Menno Smits wrote:
> One thing I'd like to see with this class is that the rpmdb is only
> opened when absolutely required. Yum currently opens the rpmdb early on
> and keeps it open as packages are downloaded. Because of the way rpm
> does signal handling, this breaks the CTRL-C handling during downloads.
> It would be nice if the rpmdb was only opened when required, perhaps
> every method call if that wasn't too expensive or problematic. Failing
> that we might need a mechanism to explicitly close the rpmdb and have it
> automatically opened on the next method call.
That's pretty much exactly what happens with this rpmsack. Creating a
rpmts doesn't open the db, creating a rpm match iterator does. Closing
the match iterator closes the rpm db (if there's no more references to
it). So in every method in rpmsack, a match iterator is created (if
needed, of course) and when the method returns, the match iterator falls
out of scope and should get closed.
More information about the Yum-devel