Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo User (http://www.linux-archive.org/gentoo-user/)
-   -   Threading yum only requires us to drop package sacks. (http://www.linux-archive.org/gentoo-user/664896-threading-yum-only-requires-us-drop-package-sacks.html)

David Lehman 05-09-2012 08:43 PM

Threading yum only requires us to drop package sacks.
 
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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 04:28 PM.

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