[PATCH] Reset comps/groups info after editing repo in UI (#555585)

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

 



The change is concerning tasksel step. As we are resetting selected groups in
following step (basepkgsel), we are safe to just reset the comps/groups with
YumBase.doGroupsSetup (if UI repo editing requires it) instead of only adding
groups of new repo - which was actually merging it with groups of old repo
- the bug. Note that editing repo means removing it and adding a new one.
---
 iw/task_gui.py |   26 +++++++++++---------------
 1 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/iw/task_gui.py b/iw/task_gui.py
index 0a18da8..862788e 100644
--- a/iw/task_gui.py
+++ b/iw/task_gui.py
@@ -46,21 +46,6 @@ def setupRepo(anaconda, repo):
         anaconda.backend.doRepoSetup(anaconda, thisrepo=repo.id, fatalerrors=False)
         anaconda.backend.doSackSetup(anaconda, thisrepo=repo.id, fatalerrors=False)
         log.info("added (UI) repository %s with source URL %s, id:%s" % (repo.name, repo.mirrorlist or repo.baseurl, repo.id))
-        # FIXME: need a per-repo way of doing this; largely cut and paste
-        # from yum right now
-        if not repo.groups_added:
-            try:
-                groupfile = repo.getGroups()
-                # open it up as a file object so iterparse can cope
-                # with our gz file
-                if groupfile is not None and groupfile.endswith('.gz'):
-                    groupfile = gzip.open(groupfile)
-                anaconda.backend.ayum._comps.add(groupfile)
-            except Exception, e:
-                log.debug("unable to add group information for repository %s" %(repo.name))
-            else:
-                repo.groups_added = True
-                log.info("added group information for repository %s" %(repo.name))
     except (IOError, yum.Errors.RepoError) as e:
         anaconda.intf.messageWindow(_("Error"),
               _("Unable to read package metadata from repository.  "
@@ -385,6 +370,17 @@ class RepoEditor:
                     log.warning("error removing cachedir for %s: %s" %(self.repo, e))
                     pass
 
+            if (newRepoObj.enablegroups or 
+                (removeOld and self.repo.enablegroups)):
+                # update groups information
+                try:
+                    self.anaconda.backend.ayum.doGroupSetup()
+                except Exception as e:
+                    log.debug("unable to reset group information after UI repo edit: %s"
+                              % e)
+                else:
+                    log.info("group information reset after UI repo edit")
+
             self.repo = newRepoObj
             break
 
-- 
1.6.0.6

_______________________________________________
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