diff options
author | Christopher Baines <cbaines8@gmail.com> | 2011-08-02 10:29:11 +0100 |
---|---|---|
committer | Christopher Baines <cbaines8@gmail.com> | 2011-08-02 10:29:11 +0100 |
commit | 11b87a08ee6952c5b66b14842283df3ea26b90ac (patch) | |
tree | d7beb7a7adada8e65f5138275cd0e2988074a053 | |
parent | 17182c0c66630c2fcba938edb5b27668f7495854 (diff) |
Inproved the SIGINT stop in the dpkgpm, not perfect yet but it should work when using Immediate-Configure-All.
-rw-r--r-- | apt-pkg/deb/dpkgpm.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 68d9ca1de..57361ccdc 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -954,6 +954,8 @@ bool pkgDPkgPM::Go(int OutStatusFd) snprintf(status_fd_buf,sizeof(status_fd_buf),"%i", fd[1]); Args[n++] = status_fd_buf; Size += strlen(Args[n-1]); + + unsigned long const Op = I->Op; switch (I->Op) { @@ -1066,9 +1068,10 @@ bool pkgDPkgPM::Go(int OutStatusFd) sighandler_t old_SIGINT = signal(SIGINT,SigINT); // Check here for any SIGINT - if (pkgPackageManager::SigINTStop && - (I->Op == Item::Install || I->Op == Item::Remove || I->Op == Item::Purge)) break; - + if (pkgPackageManager::SigINTStop && (Op == Item::Remove || Op == Item::Purge || Op == Item::Install)) + break; + + // ignore SIGHUP as well (debian #463030) sighandler_t old_SIGHUP = signal(SIGHUP,SIG_IGN); @@ -1290,6 +1293,9 @@ bool pkgDPkgPM::Go(int OutStatusFd) } } CloseLog(); + + if (pkgPackageManager::SigINTStop) + _error->Warning(_("Operation was interrupted before it could finish")); if (RunScripts("DPkg::Post-Invoke") == false) return false; |