diff options
author | Daniel Hartwig <mandyke@gmail.com> | 2012-03-17 22:42:54 +0800 |
---|---|---|
committer | Daniel Hartwig <mandyke@gmail.com> | 2012-03-17 22:42:54 +0800 |
commit | 84abd9df0a75011d281b191f580d5cbec1e6b8ce (patch) | |
tree | 69efa7696fc1327918d4e9e84650ba8721bfa9eb /src/generic | |
parent | 9ce271c010a632d1f662a30ab50dcc915c204e3b (diff) | |
download | aptitude-84abd9df0a75011d281b191f580d5cbec1e6b8ce.tar.gz |
Revert "Respect DPkg::Options when calling dpkg to recover failed installs"
This reverts commit fd28ea8c2af0786d3a426d06ea3527aa48de96ac.
That was a bit too hackish and subject to security issues. Much
more work is needed to address the issue, and probably should
be implemented within APT.
Diffstat (limited to 'src/generic')
-rw-r--r-- | src/generic/apt/download_install_manager.cc | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/generic/apt/download_install_manager.cc b/src/generic/apt/download_install_manager.cc index fb1c3410..e3ab4c37 100644 --- a/src/generic/apt/download_install_manager.cc +++ b/src/generic/apt/download_install_manager.cc @@ -32,8 +32,6 @@ #include <sigc++/bind.h> -#include <sstream> - #include <pthread.h> #include <signal.h> @@ -163,24 +161,18 @@ pkgPackageManager::OrderResult download_install_manager::run_dpkg(int status_fd) pthread_sigmask(SIG_UNBLOCK, &allsignals, &oldsignals); pkgPackageManager::OrderResult pmres = pm->DoInstallPostFork(status_fd); - // HACK: try to fix a failed install. Attemp to mimick how APT - // invokes dpkg here by using DPKG_NO_TSTP=1 (see #367052) and - // passing DPkg::Options (LP: #257279). It would be better if APT - // was capable of doing this (is it?), then we wouldn't have to be - // so pedantic about the behaviour. - if(pmres == pkgPackageManager::Failed) + switch(pmres) { + case pkgPackageManager::Failed: _error->DumpErrors(); cerr << _("A package failed to install. Trying to recover:") << endl; - std::ostringstream command("DPKG_NO_TSTP=1 dpkg --configure -a"); - std::vector<std::string> opts = aptcfg->FindVector("DPkg::Options"); - for(size_t i = 0; i < opts.size(); ++i) - { - if(opts[i].empty()) - continue; - command << ' ' << opts[i]; - } - if(system(command.str().c_str()) != 0) { /* ignore */ } + if(system("DPKG_NO_TSTP=1 dpkg --configure -a") != 0) { /* ignore */ } + break; + case pkgPackageManager::Completed: + break; + + case pkgPackageManager::Incomplete: + break; } pthread_sigmask(SIG_SETMASK, &oldsignals, NULL); |