[Kimchi-devel] [PATCH V2 1/2] bug fix: instantiate the Yum manager when update the yum packages list

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Thu Mar 20 23:43:48 UTC 2014


From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>

an instance just refresh packagekit once.

for example:
$ sudo PYTHONPATH=src python -c '
> from yum import YumBase
> YumBase().doPackageLists("updates")
> _yb = YumBase()
> _yb.doPackageLists("updates")
> _yb.doPackageLists("updates")
> '
Loaded plugins: langpacks, refresh-packagekit
Loaded plugins: langpacks, refresh-packagekit

you can seen the second _yb.doPackageLists will not refresh packagekit.

The apt manager may also has the same problem.
But not test it on ubuntu, will send a patch later after I have check.

Signed-off-by: Aline Manera <alinefm at br.ibm.com>
Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
---
 src/kimchi/swupdate.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/kimchi/swupdate.py b/src/kimchi/swupdate.py
index 45f7920..3238e44 100644
--- a/src/kimchi/swupdate.py
+++ b/src/kimchi/swupdate.py
@@ -137,13 +137,13 @@ class YumUpdate(object):
     """
     def __init__(self):
         self._pkgs = {}
-        self._yb = getattr(__import__('yum'), 'YumBase')()
         self.update_cmd = ["yum", "-y", "update"]
 
     def _refreshUpdateList(self):
         """
         Update the list of packages to be updated in the system.
         """
+        self._yb = getattr(__import__('yum'), 'YumBase')()
         self._pkgs = self._yb.doPackageLists('updates')
 
     def getPackagesList(self):
-- 
1.8.5.3




More information about the Kimchi-devel mailing list