summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-11-27 12:07:06 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2006-11-27 12:07:06 +0100
commitc70496f94c8a16072b0b7a7906dec4b1aa4f306e (patch)
tree1ddfab318b1fcdd698541d442a39fbb98797e2c2
parent65d71b381cc326bdf5310d8a2ea5b3f0d0307f63 (diff)
* apt-pkg/deb/dpkgpm.cc:
- added "Dpkg::StopOnError" variable that controls if apt will abort on errors from dpkg
-rw-r--r--apt-pkg/deb/dpkgpm.cc23
-rw-r--r--debian/changelog5
-rw-r--r--doc/examples/configure-index4
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