It would be nice if the update process checked the current transaction
set and only considered packages that are not already candidates for
removal. I've attached a patch (yum-update.patch) that seems to work for my test case.
I added this to the "update everything part" (without any packages
passed in as arguments) only. If packages are explicitly specified to
update, the behavior is the other way around: If those packages are
already in the transaction set marked with any of the TS_REMOVE_STATES,
the corresponding transaction set members are removed first.
The second patch (yum-consider-tsinfo.patch) is an approach to consider members of the current transaction set on install and remove.
I'd be glad if you could review the patches and tell me if that's the
correct way to do it.