summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/edsp.cc16
-rw-r--r--apt-pkg/init.cc1
-rw-r--r--apt-pkg/packagemanager.cc27
3 files changed, 27 insertions, 17 deletions
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc
index 805a37bb3..49873f243 100644
--- a/apt-pkg/edsp.cc
+++ b/apt-pkg/edsp.cc
@@ -1074,6 +1074,20 @@ bool EDSP::ResolveExternal(const char* const solver, pkgDepCache &Cache,
bool EIPP::OrderInstall(char const * const solver, pkgPackageManager * const PM, /*{{{*/
unsigned int const flags, OpProgress * const Progress)
{
+ if (strcmp(solver, "internal") == 0)
+ {
+ auto const dumpfile = _config->FindFile("Dir::Log::Planer");
+ if (dumpfile.empty())
+ return false;
+ auto const dumpdir = flNotFile(dumpfile);
+ FileFd output;
+ if (CreateAPTDirectoryIfNeeded(dumpdir, dumpdir) == false ||
+ output.Open(dumpfile, FileFd::WriteOnly | FileFd::Exclusive | FileFd::Create, FileFd::Extension, 0644) == false)
+ return _error->WarningE("EIPP::OrderInstall", _("Could not open file '%s'"), dumpfile.c_str());
+ bool Okay = EIPP::WriteRequest(PM->Cache, output, flags, nullptr);
+ return Okay && EIPP::WriteScenario(PM->Cache, output, nullptr);
+ }
+
int solver_in, solver_out;
pid_t const solver_pid = ExecuteExternal("planer", solver, "Dir::Bin::Planers", &solver_in, &solver_out);
if (solver_pid == 0)
@@ -1081,7 +1095,7 @@ bool EIPP::OrderInstall(char const * const solver, pkgPackageManager * const PM,
FileFd output;
if (output.OpenDescriptor(solver_in, FileFd::WriteOnly | FileFd::BufferedWrite, true) == false)
- return _error->Errno("OrderInstall", "Opening planer %s stdin on fd %d for writing failed", solver, solver_in);
+ return _error->Errno("EIPP::OrderInstall", "Opening planer %s stdin on fd %d for writing failed", solver, solver_in);
bool Okay = output.Failed() == false;
if (Progress != NULL)
diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc
index 70a119a6e..0e8d9be8a 100644
--- a/apt-pkg/init.cc
+++ b/apt-pkg/init.cc
@@ -76,6 +76,7 @@ bool pkgInitConfig(Configuration &Cnf)
Cnf.CndSet("Dir::Log","var/log/apt");
Cnf.CndSet("Dir::Log::Terminal","term.log");
Cnf.CndSet("Dir::Log::History","history.log");
+ Cnf.CndSet("Dir::Log::Planer","eipp.log.xz");
Cnf.Set("Dir::Ignore-Files-Silently::", "~$");
Cnf.Set("Dir::Ignore-Files-Silently::", "\\.disabled$");
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index a61c5f7a9..898e5d156 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -1033,26 +1033,21 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
return Failed;
Reset();
-
+
if (Debug == true)
clog << "Beginning to order" << endl;
std::string const planer = _config->Find("APT::Planer", "internal");
+ unsigned int flags = 0;
+ if (_config->FindB("APT::Immediate-Configure", true) == false)
+ flags |= EIPP::Request::NO_IMMEDIATE_CONFIGURATION;
+ else if (_config->FindB("APT::Immediate-Configure-All", false))
+ flags |= EIPP::Request::IMMEDIATE_CONFIGURATION_ALL;
+ else if (_config->FindB("APT::Force-LoopBreak", false))
+ flags |= EIPP::Request::ALLOW_TEMPORARY_REMOVE_OF_ESSENTIALS;
+ auto const ret = EIPP::OrderInstall(planer.c_str(), this, flags, nullptr);
if (planer != "internal")
- {
- unsigned int flags = 0;
- if (_config->FindB("APT::Immediate-Configure", true) == false)
- flags |= EIPP::Request::NO_IMMEDIATE_CONFIGURATION;
- else if (_config->FindB("APT::Immediate-Configure-All", false))
- flags |= EIPP::Request::IMMEDIATE_CONFIGURATION_ALL;
- else if (_config->FindB("APT::Force-LoopBreak", false))
- flags |= EIPP::Request::ALLOW_TEMPORARY_REMOVE_OF_ESSENTIALS;
-
- if (EIPP::OrderInstall(planer.c_str(), this, flags, nullptr))
- return Completed;
- else
- return Failed;
- }
+ return ret ? Completed : Failed;
bool const ordering =
_config->FindB("PackageManager::UnpackAll",true) ?
@@ -1062,7 +1057,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
_error->Error("Internal ordering error");
return Failed;
}
-
+
if (Debug == true)
clog << "Done ordering" << endl;