summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2011-07-31 16:26:39 +0100
committerChristopher Baines <cbaines8@gmail.com>2011-07-31 16:26:39 +0100
commit1cecd4376cebdd0225ee91707b7630bc35959474 (patch)
tree9e3fa16360e2ba00ad3f780f2b6ec76ee5ab6d65 /apt-pkg/deb
parent590f1923121815b36ef889033c1c416a23cbe9a2 (diff)
Only allow interupts when using, Immediate-Configure-All.
TODO for dpkgpm: Useful messages about the interupt, what was done to what packages and what was not done to what packages. Only fail when the system is in a clean state, at the moment it will fail either a configure or install run.
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/dpkgpm.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 3dbbd7c97..479126658 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -889,7 +889,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
OpenLog();
// this loop is runs once per operation
- for (vector<Item>::const_iterator I = List.begin(); I != List.end() && !pkgPackageManager::SigINTStop;)
+ for (vector<Item>::const_iterator I = List.begin(); I != List.end();)
{
// Do all actions with the same Op in one run
vector<Item>::const_iterator J = I;
@@ -921,7 +921,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
// the argument list is split in a way that A depends on B
// and they are in the same "--configure A B" run
// - with the split they may now be configured in different
- // runs
+ // runs, using Immediate-Configure-All can help prevent this.
if (J - I > (signed)MaxArgs)
J = I + MaxArgs;
@@ -1064,6 +1064,9 @@ bool pkgDPkgPM::Go(int OutStatusFd)
it doesn't die but we do! So we must also ignore it */
sighandler_t old_SIGQUIT = signal(SIGQUIT,SIG_IGN);
sighandler_t old_SIGINT = signal(SIGINT,SigINT);
+
+ // Check here for any SIGINT
+ if (pkgPackageManager::SigINTStop) break;
// ignore SIGHUP as well (debian #463030)
sighandler_t old_SIGHUP = signal(SIGHUP,SIG_IGN);
@@ -1102,7 +1105,6 @@ bool pkgDPkgPM::Go(int OutStatusFd)
sigprocmask(SIG_SETMASK, &original_sigmask, 0);
}
}
-
// Fork dpkg
pid_t Child;
_config->Set("APT::Keep-Fds::",fd[1]);