]> git.saurik.com Git - apt.git/commitdiff
Inproved the SIGINT stop in the dpkgpm, not perfect yet but it should work when using...
authorChristopher Baines <cbaines8@gmail.com>
Tue, 2 Aug 2011 09:29:11 +0000 (10:29 +0100)
committerChristopher Baines <cbaines8@gmail.com>
Tue, 2 Aug 2011 09:29:11 +0000 (10:29 +0100)
apt-pkg/deb/dpkgpm.cc

index 68d9ca1de25aed935f07982fcb9bc8ff113aaee0..57361ccdc3e2d93f8e797488a91f64037463cbf4 100644 (file)
@@ -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;