FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 08-10-2010, 05:06 PM
Radek Vykydal
 
Default Fix unchecking repo after going back from group selection (#622376)

When we reset transaction info after going back to UI tasksel step
and unchecking some repo used in previous pass, we must not
touch objects referring to the removed repo.

_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.

---
pyanaconda/yuminstall.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/yuminstall.py b/pyanaconda/yuminstall.py
index 876a843..f2c30b9 100644
--- a/pyanaconda/yuminstall.py
+++ b/pyanaconda/yuminstall.py
@@ -1328,6 +1328,9 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon

def resetPackageSelections(self):
"""Reset the package selection to an empty state."""
+ # This is needed for the case when one unchecks a repo
+ # checked in previous pass of this step
+ self.ayum.tsInfo._inSack.clearIndexes()
for txmbr in self.ayum.tsInfo:
self.ayum.tsInfo.remove(txmbr.pkgtup)
self.ayum.tsInfo.conditionals.clear()
--
1.7.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-11-2010, 01:42 PM
Chris Lumens
 
Default Fix unchecking repo after going back from group selection (#622376)

> _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.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-11-2010, 01:54 PM
seth vidal
 
Default Fix unchecking repo after going back from group selection (#622376)

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?

-sv


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-11-2010, 02:49 PM
Radek Vykydal
 
Default 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

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-11-2010, 03:22 PM
seth vidal
 
Default Fix unchecking repo after going back from group selection (#622376)

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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-12-2010, 02:34 PM
Radek Vykydal
 
Default Fix unchecking repo after going back from group selection (#622376)

On 08/11/2010 05:22 PM, seth vidal wrote:

On Wed, 2010-08-11 at 16:49 +0200, Radek Vykydal wrote:


On 08/11/2010 03:54 PM, seth vidal wrote:
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()




Thanks for hints, I'll look at them.

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-24-2010, 02:43 PM
Radek Vykydal
 
Default Fix unchecking repo after going back from group selection (#622376)

On 08/11/2010 05:22 PM, seth vidal wrote:

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()




These don't do what we need - to keep
ayum.repos (and their sacks) that had been set up
before 1) and modified in 6), and start only group/package
selection from scratch - which requires resetting
ayum.tsInfo if I get it right.

What you are suggesting seems to me as starting
with a new YumBase object - that is going far too back
for us.

Although it is not an option in this case, does ayum.close()
or all the closing do anything (e.g. cleanup, releasing resources)
to make reusing self.ayum preferable to just creating
a new YumBase object? Or is something preserved in the
ayum object? From what I read in the code it is not, but
I might have overlooked something.

Perhaps yum interface just is not suitable for doing things
like those in 1) - 7)?

Radek

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-24-2010, 04:04 PM
seth vidal
 
Default Fix unchecking repo after going back from group selection (#622376)

On Tue, 2010-08-24 at 16:43 +0200, Radek Vykydal wrote:
> >>
> >> 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
> >>
> >
> > self.ayum.closeRpmDB()
> > self.ayum._repos.close()
> > self.ayum.comps = None
> >
> > or:
> >
> > self.ayum.close()
> >
> >
>
> These don't do what we need - to keep
> ayum.repos (and their sacks) that had been set up
> before 1) and modified in 6), and start only group/package
> selection from scratch - which requires resetting
> ayum.tsInfo if I get it right.
>
> What you are suggesting seems to me as starting
> with a new YumBase object - that is going far too back
> for us.

It's not significantly farther. If you've already setup those repos then
you'll only be adding them in and they'll be current and in the local
disk cache.



> Perhaps yum interface just is not suitable for doing things
> like those in 1) - 7)?

The set of pkgs available is intertwined with the groups available and
how they are displayed, it's wrapped up together purposefully so I'm not
sure how you extricate one from the other.

-sv


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

Thread Tools




All times are GMT. The time now is 07:05 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org