[Kimchi-devel] [PATCH] bug fix: Instantiate the apt-get manager when update the apt-get packages list

Aline Manera alinefm at linux.vnet.ibm.com
Mon Mar 24 19:27:03 UTC 2014


From: Aline Manera <alinefm at br.ibm.com>

It is needed to always get the correct information from apt-get.
Otherwise, even after updating packages the same packages will be listed
to be updated as they are kept in the apt-get instance.

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

diff --git a/src/kimchi/swupdate.py b/src/kimchi/swupdate.py
index 356ec52..625b091 100644
--- a/src/kimchi/swupdate.py
+++ b/src/kimchi/swupdate.py
@@ -179,16 +179,16 @@ class AptUpdate(object):
     """
     def __init__(self):
         self._pkgs = {}
-        self._apt_cache = getattr(__import__('apt'), 'Cache')()
         self.update_cmd = ['apt-get', 'upgrade', '-y']
 
     def _refreshUpdateList(self):
         """
         Update the list of packages to be updated in the system.
         """
-        self._apt_cache.update()
-        self._apt_cache.upgrade()
-        self._pkgs = self._apt_cache.get_changes()
+        apt_cache = getattr(__import__('apt'), 'Cache')()
+        apt_cache.update()
+        apt_cache.upgrade()
+        self._pkgs = apt_cache.get_changes()
 
     def getPackagesList(self):
         """
-- 
1.7.10.4




More information about the Kimchi-devel mailing list