* apt-pkg/deb/dpkgpm.cc:
authorMichael Vogt <michael.vogt@ubuntu.com>
Mon, 27 Nov 2006 11:07:06 +0000 (12:07 +0100)
committerMichael Vogt <michael.vogt@ubuntu.com>
Mon, 27 Nov 2006 11:07:06 +0000 (12:07 +0100)
  - added "Dpkg::StopOnError" variable that controls if apt
      will abort on errors from dpkg

apt-pkg/deb/dpkgpm.cc
debian/changelog
doc/examples/configure-index

index c7a6b92..3204fc1 100644 (file)
@@ -711,14 +711,23 @@ bool pkgDPkgPM::Go(int OutStatusFd)
       // Check for an error code.
       if (WIFEXITED(Status) == 0 || WEXITSTATUS(Status) != 0)
       {
-        RunScripts("DPkg::Post-Invoke");
-        if (WIFSIGNALED(Status) != 0 && WTERMSIG(Status) == SIGSEGV)
-           return _error->Error("Sub-process %s received a segmentation fault.",Args[0]);
-
-        if (WIFEXITED(Status) != 0)
-           return _error->Error("Sub-process %s returned an error code (%u)",Args[0],WEXITSTATUS(Status));
+        // if it was set to "keep-dpkg-runing" then we won't return
+        // here but keep the loop going and just report it as a error
+        // for later
+        bool stopOnError = _config->FindB("Dpkg::StopOnError",true);
         
-        return _error->Error("Sub-process %s exited unexpectedly",Args[0]);
+        if(stopOnError)
+           RunScripts("DPkg::Post-Invoke");
+
+        if (WIFSIGNALED(Status) != 0 && WTERMSIG(Status) == SIGSEGV) 
+           _error->Error("Sub-process %s received a segmentation fault.",Args[0]);
+        else if (WIFEXITED(Status) != 0)
+           _error->Error("Sub-process %s returned an error code (%u)",Args[0],WEXITSTATUS(Status));
+        else 
+           _error->Error("Sub-process %s exited unexpectedly",Args[0]);
+
+        if(stopOnError)
+           return false;
       }      
    }
 
index 24e10dc..8da0d64 100644 (file)
@@ -1,6 +1,9 @@
 apt (0.6.46.4) unstable; urgency=low
 
-  * add apt-secure.8 to "See also" section
+  * added apt-secure.8 to "See also" section
+  * apt-pkg/deb/dpkgpm.cc:
+    - added "Dpkg::StopOnError" variable that controls if apt
+      will abort on errors from dpkg
 
  --
 
index 0f0abc3..73e20aa 100644 (file)
@@ -237,6 +237,10 @@ DPkg
    // Control the size of the command line passed to dpkg.
    MaxBytes 1024;
    MaxArgs 350;
+
+   // controls if apt will apport on the first dpkg error or if it 
+   // tries to install as many packages as possible
+   StopOnError "true";
 }
 
 /* Options you can set to see some debugging text They correspond to names