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

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

 



On Wed, 2010-08-11 at 16:49 +0200, Radek Vykydal wrote:
> 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?)


I think these should do it:

self.ayum.closeRpmDB()
self.ayum._repos.close()
self.ayum.comps = None

or:

self.ayum.close()

-sv


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux