Forráskód Böngészése

* apt-pkg/deb/dpkgpm.cc:
- added "Dpkg::StopOnError" variable that controls if apt
will abort on errors from dpkg

Michael Vogt 19 éve
szülő
commit
c70496f94c
3 módosított fájl, 24 hozzáadás és 8 törlés
  1. 16 7
      apt-pkg/deb/dpkgpm.cc
  2. 4 1
      debian/changelog
  3. 4 0
      doc/examples/configure-index

+ 16 - 7
apt-pkg/deb/dpkgpm.cc

@@ -711,14 +711,23 @@ bool pkgDPkgPM::Go(int OutStatusFd)
       // Check for an error code.
       // Check for an error code.
       if (WIFEXITED(Status) == 0 || WEXITSTATUS(Status) != 0)
       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;
       }      
       }      
    }
    }
 
 

+ 4 - 1
debian/changelog

@@ -1,6 +1,9 @@
 apt (0.6.46.4) unstable; urgency=low
 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
 
 
  --
  --
 
 

+ 4 - 0
doc/examples/configure-index

@@ -237,6 +237,10 @@ DPkg
    // Control the size of the command line passed to dpkg.
    // Control the size of the command line passed to dpkg.
    MaxBytes 1024;
    MaxBytes 1024;
    MaxArgs 350;
    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
 /* Options you can set to see some debugging text They correspond to names