diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-11-27 12:07:06 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-11-27 12:07:06 +0100 |
commit | c70496f94c8a16072b0b7a7906dec4b1aa4f306e (patch) | |
tree | 1ddfab318b1fcdd698541d442a39fbb98797e2c2 /apt-pkg/deb | |
parent | 65d71b381cc326bdf5310d8a2ea5b3f0d0307f63 (diff) |
* apt-pkg/deb/dpkgpm.cc:
- added "Dpkg::StopOnError" variable that controls if apt
will abort on errors from dpkg
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r-- | apt-pkg/deb/dpkgpm.cc | 23 |
1 files changed, 16 insertions, 7 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; } } |