[Yum-devel] [PATCH/RFC] Prepare for skipbroken/Replace already_seen

Florian Festi ffesti at redhat.com
Wed Nov 28 16:36:36 UTC 2007


Hi!

While playing around with the skipbroken code I run into some problems when 
transaction members are removed and the packages is readded later on. Reason 
for this is that __cmp__ and __hash__ methods are overloaded in the 
TransactionMember class. This means that transaction members containing pkgs 
with the same pkgtup are treated as equal. Because of this the newly added 
transaction members are found in the already_seen(_removed) dicts if the old 
  "equal" transaction members still linger there. A similar problem exists 
for TsInfo.removedmembers.

The current problem could be worked around by resetting already_seen* (as 
done by Jeremy's patch) and TsInfo.removedmembers (still missing) at the 
begin of the depsolving. But as soon as we try to move the skipbroken code 
deeper into the depsolving loop this will no longer be sufficient. Resetting 
the already_seen information also means restarting the depsolving from the 
start and loosing all the work we already did.

The attached patch works around this two problems by moving to a list (set) 
of transaction members that needs to be checked (TsInfo._unresolvedMembers) 
and keeps it up to date. It also removes the no longer needed already_seen* 
dicts and removedmembers attribute and related methods.

The new TsInfo.resetResolved() method feature a hard=False default behavior 
that keeps the already done work if this is better than starting from 
scratch which may be the case after big changes (GUI applications come to mind).

I am a bit unsure how this implementation would cope with reinstalls (adding 
install and remove transaction members for the same package) but IIRC these 
are not supported in yum anyway and it is currently not possible to do such 
things even from the yum shell. I also guess that some other code pieces 
would need work to support reinstalls.

So my main questions are:

  * Does this look sane?

  * Are any of the removed pieces part of the "official" yum API and need to 
stay?


Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-tsInfo.getUnresolvedMembers-and-use-if-for-dep.patch
Type: text/x-patch
Size: 6033 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20071128/abd62934/attachment.bin 


More information about the Yum-devel mailing list