[Yum-devel] [PATCH/RFC] Fix for new test cases

Florian Festi ffesti at redhat.com
Wed Feb 13 12:57:35 UTC 2008


Ooops, I still owe Seth an answer here...

seth vidal wrote:
> On Tue, 2008-02-12 at 14:32 +0100, Florian Festi wrote:
>> BTW: I am still unhappy with the result of .update() and friends. It is 
>> still quite complicated the find out what they actually did. Reason for this 
>> is the IMHO insane API of TransactionInfo that returns just arbitrary 
>> transaction member objects in its .add* methods.
> 
> Why is returning the txmbrs insane? update/install/remove all return the
> list of items that they added to the transaction set. The members
> themselves provide the why and the what.

Returning the txmbr is not insane. Insane is that it is not granted that the 
txmbrs returned really got added.

TransactionInfo.addUpdate (for example) creates a TransactionMember object, 
passes it to .add() and then returns it. But .add() might just ignore the 
txmbr if there already is one with the same pkg and state. As a result the 
caller of .addUpdate() (YumBase.update() in this case) ends up with a list 
of txmbrs that are not only not newly added but also not even in the 
transaction(info).

This makes it quite difficult to find out what was actually done within the 
.update() method and if the problems got resolved.

Florian



More information about the Yum-devel mailing list