diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Client/Tools/APT.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/Client/Tools/APT.py b/src/lib/Client/Tools/APT.py index 2148a3207..074b9f1ca 100644 --- a/src/lib/Client/Tools/APT.py +++ b/src/lib/Client/Tools/APT.py @@ -132,8 +132,15 @@ class APT(Bcfg2.Client.Tools.Tool): self.logger.info('Removing packages:') self.logger.info(pkgnames) for pkg in pkgnames.split(" "): - self.pkg_cache[pkg].markDelete(purge=True) - self.pkg_cache.commit() + try: + self.pkg_cache[pkg].markDelete(purge=True) + except: + self.pkg_cache[pkg].markDelete() + try: + self.pkg_cache.commit() + except SystemExit: + # thank you python-apt 0.6 + pass self.pkg_cache = apt.cache.Cache() self.modified += packages self.extra = self.FindExtra() |