From c70496f94c8a16072b0b7a7906dec4b1aa4f306e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 27 Nov 2006 12:07:06 +0100 Subject: * apt-pkg/deb/dpkgpm.cc: - added "Dpkg::StopOnError" variable that controls if apt will abort on errors from dpkg --- apt-pkg/deb/dpkgpm.cc | 23 ++++++++++++++++------- debian/changelog | 5 ++++- doc/examples/configure-index | 4 ++++ 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index c7a6b921f..3204fc1bb 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -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; } } diff --git a/debian/changelog b/debian/changelog index 24e10dcd5..8da0d6471 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 -- diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 0f0abc30c..73e20aa43 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -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 -- cgit v1.2.3