[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH master] Fix unchecking repo after going back from group selection (#622376)



On 08/11/2010 03:54 PM, seth vidal wrote:
On Wed, 2010-08-11 at 09:42 -0400, Chris Lumens wrote:
_inSack seems to be a special PackageSack added to yum's TransactionData
for optimalization lately. I don't like touching it from anaconda,
but I can't find another way. I think the case is not so common
to be worth deeper changes in yuminstall. There might be option
of doing SackSetup after unchecking of a repo, but it seems less
safe to me.
I know skvidal sometimes lurks on this list and will respond to things.
Perhaps he can come up with a better way.  You're right, this is kinda
gross and not really something I want us to have to touch either.  Seems
like entirely too much secret yum knowledge to me.

Rereading the original justification for the patch I'm a bit confused.

You've done some pkg selection, then the user hits the back button to
add/remove repos. Now you want to prune pkgs out of the transaction set
that are from that repo? B/c it seems to me that you would want to reset
the whole transaction, wouldn't you?


Yes, I want to reset the whole transaction - remove all pkgs.
Package selection will start from scratch after the reset.

This is the case:

1) have repos A and B enabled
2) default packages for repos/installclass are added
3) user adds/removes packages
4) transaction is created
5) (e.g.) user learns about some conflicts
6) goes back in UI (to 1))
6) disables repo B in UI -> it is removed
7) before going forward to 2), transaction needs to be reset
   with the patched function

def resetPackageSelections(self):
        """Reset the package selection to an empty state."""
        for txmbr in self.ayum.tsInfo:
            self.ayum.tsInfo.remove(txmbr.pkgtup)
        self.ayum.tsInfo.conditionals.clear()
        for grp in self.ayum.comps.groups:
            grp.selected = False


The problem that the patch adresses is that removing the txmbrs
in the first loop will traceback on txmbrs that refer to repo
removed in 6).

Is there a better way to reset the tsInfo (TransactionData)? It is quite a
hacky function (clearing conditionals is a similar case added some time ago).
Or should we remove the packages before removing the repo in 6)
(perhaps with disable method added to yum for anaconda lately?)

Radek


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]