Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   CentOS (http://www.linux-archive.org/centos/)
-   -   Reset conditionals of transaction info too. (#505189) (http://www.linux-archive.org/centos/335254-reset-conditionals-transaction-info-too-505189-a.html)

Radek Vykydal 03-03-2010 03:29 PM

Reset conditionals of transaction info too. (#505189)
 
It is necessary when going back to task selection screen
in UI and changing repository.
---
yuminstall.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/yuminstall.py b/yuminstall.py
index 2ada820..62112d4 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1293,6 +1293,7 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
"""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

--
1.6.0.6

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

Chris Lumens 03-04-2010 05:01 PM

Reset conditionals of transaction info too. (#505189)
 
> It is necessary when going back to task selection screen
> in UI and changing repository.

Can you be a little more descriptive in why this solves the problem?

- Chris

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

Radek Vykydal 03-05-2010 08:26 AM

Reset conditionals of transaction info too. (#505189)
 
Chris Lumens wrote:

It is necessary when going back to task selection screen
in UI and changing repository.



Can you be a little more descriptive in why this solves the problem?

- Chris

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



In the BZ case we go back to tasksel step, change 'Installation Repo' in
UI (which is done by removing old one and adding new actually),
and then we proceed forward to basepkgsel step:

def doBasePackageSelect(anaconda):
if anaconda.ksdata:
anaconda.backend.resetPackageSelections()
kickstart.selectPackages(anaconda)
elif anaconda.displayMode != 't':
anaconda.backend.resetPackageSelections()
anaconda.instClass.setPackageSelection(anaconda)
anaconda.instClass.setGroupSelection(anaconda)

I am reseting ayum.conditionals in resetPackageSelections:

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

because if I don't, following setGroupSelection call (which is calling
YumBase.selectGroup for each desired group) is using stale conditionals
dict created when this step was performed for the replaced
repo instance of 'Installation Repo', so the dict containins
YumAvailablePackageSqlite objects pointing to (attribute repoid)
removed repo.

It seems to me that yum api is not very suitable for granularity
of UI interaction we use in anaconda, but I might be overlooking
something.

Radek

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

Chris Lumens 03-05-2010 06:49 PM

Reset conditionals of transaction info too. (#505189)
 
> because if I don't, following setGroupSelection call (which is calling
> YumBase.selectGroup for each desired group) is using stale conditionals
> dict created when this step was performed for the replaced
> repo instance of 'Installation Repo', so the dict containins
> YumAvailablePackageSqlite objects pointing to (attribute repoid)
> removed repo.

Great, thanks for the explanation. Makes sense to me now. Putting some
of it into the commit message as well will be helpful for the future.

> It seems to me that yum api is not very suitable for granularity
> of UI interaction we use in anaconda, but I might be overlooking
> something.

Yeah, it certainly can be difficult.

- Chris

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


All times are GMT. The time now is 06:52 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.