]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/packagemanager.cc
init: Add Dir::Bin::planners default entry
[apt.git] / apt-pkg / packagemanager.cc
index 77a6b0e57547a84c8584e17614b403ae5dcad12c..90dd3a3ee29e078c390af424fab0c137d7880c70 100644 (file)
@@ -19,6 +19,7 @@
 #include <apt-pkg/orderlist.h>
 #include <apt-pkg/depcache.h>
 #include <apt-pkg/error.h>
+#include <apt-pkg/edsp.h>
 #include <apt-pkg/version.h>
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/algorithms.h>
@@ -314,8 +315,8 @@ bool pkgPackageManager::ConfigureAll()
    if (OList.OrderConfigure() == false)
       return false;
 
-   std::string const conf = _config->Find("PackageManager::Configure","all");
-   bool const ConfigurePkgs = (conf == "all");
+   std::string const conf = _config->Find("PackageManager::Configure", "smart");
+   bool const ConfigurePkgs = (ImmConfigureAll || conf == "all");
 
    // Perform the configuring
    for (pkgOrderList::iterator I = OList.begin(); I != OList.end(); ++I)
@@ -599,7 +600,7 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg, int const Depth)
 
    if (PkgLoop) return true;
 
-   static std::string const conf = _config->Find("PackageManager::Configure","all");
+   static std::string const conf = _config->Find("PackageManager::Configure", "smart");
    static bool const ConfigurePkgs = (conf == "all" || conf == "smart");
 
    if (List->IsFlag(Pkg,pkgOrderList::Configured))
@@ -1032,10 +1033,22 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
       return Failed;
 
    Reset();
-   
+
    if (Debug == true)
       clog << "Beginning to order" << endl;
 
+   std::string const planner = _config->Find("APT::Planner", "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(planner.c_str(), this, flags, nullptr);
+   if (planner != "internal")
+      return ret ? Completed : Failed;
+
    bool const ordering =
        _config->FindB("PackageManager::UnpackAll",true) ?
                List->OrderUnpack(FileNames) : List->OrderCritical();
@@ -1044,7 +1057,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
       _error->Error("Internal ordering error");
       return Failed;
    }
-   
+
    if (Debug == true)
       clog << "Done ordering" << endl;
 
@@ -1135,7 +1148,12 @@ pkgPackageManager::DoInstallPostFork(int statusFd)
 pkgPackageManager::OrderResult 
 pkgPackageManager::DoInstallPostFork(APT::Progress::PackageManager *progress)
 {
-   bool goResult = Go(progress);
+   bool goResult;
+   auto simulation = dynamic_cast<pkgSimulate*>(this);
+   if (simulation == nullptr)
+      goResult = Go(progress);
+   else
+      goResult = simulation->Go2(progress);
    if(goResult == false) 
       return Failed;