From d914d4c1e241f8e511361b9ce98993ca8e1b98af Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Tue, 25 Aug 2009 08:41:26 +0200 Subject: apt/package.py: Export if a package is an essential one (Closes: #543428) --- debian/changelog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 00900dad..bfba50e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,10 @@ python-apt (0.7.13.3) UNRELEASED; urgency=low * apt/cache.py: - add actiongroup() method (backport from 0.7.92) + [ Sebastian Heinlein ] + * apt/package.py: + - Export if a package is an essential one (Closes: #543428) + [ Julian Andres Klode ] * python/depcache.cc: - Make ActionGroups context managers so apt.Cache.actiongroup() has -- cgit v1.2.3 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(-) (limited to 'debian') 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 From 2ca7c7acd3f47dc7da07fd8ad77df8c0c6c84735 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 3 Sep 2009 15:01:01 +0200 Subject: * apt/progress/__init__.py: - catch exceptions in pm.DoInstall() --- apt/progress/__init__.py | 11 +++++++++-- debian/changelog | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py index 3a6b3f91..97090643 100644 --- a/apt/progress/__init__.py +++ b/apt/progress/__init__.py @@ -311,8 +311,15 @@ class InstallProgress(DumbInstallProgress): """Start installing.""" pid = self.fork() if pid == 0: - # child - res = pm.DoInstall(self.writefd) + # pm.DoInstall might raise a exception, + # when this happens, we need to catch + # it, otherwise os._exit() is not run + # and the execution continues in the + # parent code leading to very confusing bugs + try: + res = pm.DoInstall(self.writefd) + except Exception, e: + os._exit(pm.ResultFailed) os._exit(res) self.child_pid = pid res = self.waitChild() diff --git a/debian/changelog b/debian/changelog index ada400bb..3f23a368 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ python-apt (0.7.13.3) UNRELEASED; urgency=low - add actiongroup() method (backport from 0.7.92) - re-work the logic in commit() to fail if installArchives() returns a unexpected result + * apt/progress/__init__.py: + - catch exceptions in pm.DoInstall() [ Sebastian Heinlein ] * apt/package.py: -- cgit v1.2.3