From 0aa3f4f3ce25a499a332c23f9493e629f30013dc Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 2 Sep 2009 20:45:52 +0200 Subject: re-work the logic in commit() to fail if installArchives() returns a unexpected result --- apt/cache.py | 6 +++++- debian/changelog | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apt/cache.py b/apt/cache.py index 828b167b..bb944041 100644 --- a/apt/cache.py +++ b/apt/cache.py @@ -314,8 +314,12 @@ class Cache(object): res = self.installArchives(pm, installProgress) if res == pm.ResultCompleted: break - if res == pm.ResultFailed: + elif res == pm.ResultFailed: raise SystemError("installArchives() failed") + elif res == pm.ResultIncomplete: + pass + else: + raise SystemError("internal-error: unknown result code from InstallArchives: %s" % res) # reload the fetcher for media swaping fetcher.Shutdown() return (res == pm.ResultCompleted) diff --git a/debian/changelog b/debian/changelog index bfba50e0..ada400bb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ python-apt (0.7.13.3) UNRELEASED; urgency=low [ Michael Vogt ] * apt/cache.py: - add actiongroup() method (backport from 0.7.92) + - re-work the logic in commit() to fail if installArchives() returns + a unexpected result [ Sebastian Heinlein ] * apt/package.py: -- cgit v1.2.3