From ce62f1def6565375ce9c56eb1237ccdc0ca138ba Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 21 Mar 2014 16:26:01 +0100 Subject: mark optional (private) symbols as hidden This methods should not be used by anyone expect the library itself as they are helpers for the specific class and therefore perfect candidates for hidding. Git-Dch: Ignore --- apt-pkg/deb/deblistparser.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index 286244cc9..baace79fe 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -102,7 +103,7 @@ class debListParser : public pkgCacheGenerator::ListParser virtual ~debListParser() {}; private: - unsigned char ParseMultiArch(bool const showErrors); + APT_HIDDEN unsigned char ParseMultiArch(bool const showErrors); }; #endif -- cgit v1.2.3 From d151adbf2cc4d23c240c6c4fcfbfda439a98c36f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 22 Mar 2014 21:35:57 +0100 Subject: ensure proper teardown in dpkg error cases We have to properly close our pseudo terminals even in error cases before we call post-invoke scripts. This is done now by breaking from the dpkg calling loop instead of copying the handling, which did it in the wrong order before. This also ensures that our state file is written in error cases to record autobit and co as this was forgotten before. Closes: 738969 --- apt-pkg/deb/dpkgpm.cc | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 9fee7c923..5a5fff13b 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1530,28 +1530,18 @@ bool pkgDPkgPM::GoNoABIBreak(APT::Progress::PackageManager *progress) // here but keep the loop going and just report it as a error // for later bool const stopOnError = _config->FindB("Dpkg::StopOnError",true); - - if(stopOnError) - RunScripts("DPkg::Post-Invoke"); - if (WIFSIGNALED(Status) != 0 && WTERMSIG(Status) == SIGSEGV) + if (WIFSIGNALED(Status) != 0 && WTERMSIG(Status) == SIGSEGV) strprintf(d->dpkg_error, "Sub-process %s received a segmentation fault.",Args[0]); else if (WIFEXITED(Status) != 0) strprintf(d->dpkg_error, "Sub-process %s returned an error code (%u)",Args[0],WEXITSTATUS(Status)); - else + else strprintf(d->dpkg_error, "Sub-process %s exited unexpectedly",Args[0]); + _error->Error("%s", d->dpkg_error.c_str()); - if(d->dpkg_error.size() > 0) - _error->Error("%s", d->dpkg_error.c_str()); - - if(stopOnError) - { - CloseLog(); - StopPtyMagic(); - d->progress->Stop(); - return false; - } - } + if(stopOnError) + break; + } } // dpkg is done at this point d->progress->Stop(); @@ -1582,7 +1572,7 @@ bool pkgDPkgPM::GoNoABIBreak(APT::Progress::PackageManager *progress) } Cache.writeStateFile(NULL); - return true; + return d->dpkg_error.empty(); } void SigINT(int /*sig*/) { -- cgit v1.2.3