[PATCH 5/9] Threading yum only requires us to drop package sacks.

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

 



Doing a YumBase.close() leads to problems when you try to resume
use of that instance. Resetting the package sacks does not appear
to present any such problems.
---
 pyanaconda/packaging/yumpayload.py |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index b36410d..0d02c2a 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -150,7 +150,6 @@ class YumPayload(PackagePayload):
 
         with _yum_lock:
             if self._yum:
-                self._yum.close()
                 del self._yum
 
             self._yum = yum.YumBase()
@@ -264,7 +263,15 @@ reposdir=%s
                   % ",".join([r.id for r in self._yum.repos.listEnabled()]))
 
     def release(self):
-        self._yum.close()
+        from yum.packageSack import MetaSack
+        log.debug("deleting package sacks")
+        if hasattr(self._yum, "_pkgSack"):
+            self._yum._pkgSack = None
+
+        self._yum.repos.pkgSack = MetaSack()
+
+        for repo in self._yum.repos.repos.values():
+            repo._sack = None
 
     ###
     ### METHODS FOR WORKING WITH REPOSITORIES
@@ -789,6 +796,7 @@ reposdir=%s
         log.info("checking software selection")
 
         with _yum_lock:
+            self.release()
             self._yum._undoDepInstalls()
 
         self._applyYumSelections()
-- 
1.7.7.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