diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2009-09-02 20:45:52 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2009-09-02 20:45:52 +0200 |
| commit | 0aa3f4f3ce25a499a332c23f9493e629f30013dc (patch) | |
| tree | cccdcf113276520b8577d046192ddbac32823fec /apt/cache.py | |
| parent | 266037aa42b7c511d9c428767ee53300ec23faf1 (diff) | |
| download | python-apt-0aa3f4f3ce25a499a332c23f9493e629f30013dc.tar.gz | |
re-work the logic in commit() to fail if installArchives() returns
a unexpected result
Diffstat (limited to 'apt/cache.py')
| -rw-r--r-- | apt/cache.py | 6 |
1 files changed, 5 insertions, 1 deletions
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) |
