[PATCH] Clear the list of packages on environment change (#977715)

Vratislav Podzimek vpodzime at redhat.com
Tue Jun 25 12:45:50 UTC 2013


On change of the environment that should be installed, we need to clear the
list of packages. This is what the GUI Software spoke does and should be done by
the TUI spoke as well.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/ui/tui/spokes/software.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/ui/tui/spokes/software.py b/pyanaconda/ui/tui/spokes/software.py
index f6b2e50..84d0737 100644
--- a/pyanaconda/ui/tui/spokes/software.py
+++ b/pyanaconda/ui/tui/spokes/software.py
@@ -168,7 +168,18 @@ class SoftwareSpoke(NormalTUISpoke):
         if not self.environment:
             return
 
-        self.payload.selectEnvironment(self.environment)
+        if not self._origEnv:
+            # nothing selected before, select the environment
+            self.payload.selectEnvironment(self.environment)
+        elif self._origEnv != self.environment:
+            # environment changed, clear the list of packages and select the new
+            # one
+            self.payload.data.packages.groupList = []
+            self.payload.selectEnvironment(self.environment)
+        else:
+            # no change
+            return
+
         self._origEnv = self.environment
 
     def checkSoftwareSelection(self):
-- 
1.7.11.7



More information about the anaconda-patches mailing list