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

From: Aline Manera <alinefm@br.ibm.com> V1 - V2: - Follow Zhen Zhou suggestion I tested it on Ubuntu. Aline Manera (1): bug fix: Instantiate the apt-get manager when update the apt-get packages list src/kimchi/swupdate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 1.7.10.4

From: Aline Manera <alinefm@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@linux.vnet.ibm.com> Signed-off-by: Aline Manera <alinefm@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

Reviewed-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> Thanks for your test. I know it is not easy to test. On 03/25/2014 03:27 AM, Aline Manera wrote:
From: Aline Manera <alinefm@br.ibm.com>
V1 - V2: - Follow Zhen Zhou suggestion
I tested it on Ubuntu.
Aline Manera (1): bug fix: Instantiate the apt-get manager when update the apt-get packages list
src/kimchi/swupdate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
-- Thanks and best regards! Sheldon Feng(冯少合)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center
participants (2)
-
Aline Manera
-
Sheldon