]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/upgrade.cc
edsp: if internal is used, keep this decision
[apt.git] / apt-pkg / upgrade.cc
index e7f2aae4012cf076a7145d29c848c581e58417f4..c3be9b64f88e1877c95ac93385cc8912a7c6c306 100644 (file)
@@ -28,7 +28,7 @@ static bool pkgDistUpgrade(pkgDepCache &Cache, OpProgress * const Progress)
 {
    std::string const solver = _config->Find("APT::Solver", "internal");
    if (solver != "internal")
-      return EDSP::ResolveExternal(solver.c_str(), Cache, false, true, false, Progress);
+      return EDSP::ResolveExternal(solver.c_str(), Cache, EDSP::Request::UPGRADE_ALL, Progress);
 
    if (Progress != NULL)
       Progress->OverallProgress(0, 100, 1, _("Calculating upgrade"));
@@ -115,7 +115,7 @@ static bool pkgDistUpgrade(pkgDepCache &Cache, OpProgress * const Progress)
       }
    }
 
-   bool const success = Fix.Resolve(false, Progress);
+   bool const success = Fix.ResolveInternal(false);
    if (Progress != NULL)
       Progress->Done();
    return success;
@@ -130,18 +130,16 @@ static bool pkgAllUpgradeNoNewPackages(pkgDepCache &Cache, OpProgress * const Pr
 {
    std::string const solver = _config->Find("APT::Solver", "internal");
    if (solver != "internal")
-      return EDSP::ResolveExternal(solver.c_str(), Cache, true, false, false, Progress);
+      return EDSP::ResolveExternal(solver.c_str(), Cache,
+           EDSP::Request::UPGRADE_ALL | EDSP::Request::FORBID_NEW_INSTALL | EDSP::Request::FORBID_REMOVE,
+           Progress);
 
    if (Progress != NULL)
       Progress->OverallProgress(0, 100, 1, _("Calculating upgrade"));
 
    pkgDepCache::ActionGroup group(Cache);
-
    pkgProblemResolver Fix(&Cache);
 
-   if (Cache.BrokenCount() != 0)
-      return false;
-   
    // Upgrade all installed packages
    for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
    {
@@ -160,7 +158,7 @@ static bool pkgAllUpgradeNoNewPackages(pkgDepCache &Cache, OpProgress * const Pr
       Progress->Progress(50);
 
    // resolve remaining issues via keep
-   bool const success = Fix.ResolveByKeep(Progress);
+   bool const success = Fix.ResolveByKeepInternal();
    if (Progress != NULL)
       Progress->Done();
    return success;
@@ -176,18 +174,16 @@ static bool pkgAllUpgradeWithNewPackages(pkgDepCache &Cache, OpProgress * const
 {
    std::string const solver = _config->Find("APT::Solver", "internal");
    if (solver != "internal")
-      return EDSP::ResolveExternal(solver.c_str(), Cache, true, false, false, Progress);
+       return EDSP::ResolveExternal(solver.c_str(), Cache,
+           EDSP::Request::UPGRADE_ALL | EDSP::Request::FORBID_REMOVE,
+           Progress);
 
    if (Progress != NULL)
       Progress->OverallProgress(0, 100, 1, _("Calculating upgrade"));
 
    pkgDepCache::ActionGroup group(Cache);
-
    pkgProblemResolver Fix(&Cache);
 
-   if (Cache.BrokenCount() != 0)
-      return false;
-
    // provide the initial set of stuff we want to upgrade by marking
    // all upgradable packages for upgrade
    for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
@@ -222,7 +218,7 @@ static bool pkgAllUpgradeWithNewPackages(pkgDepCache &Cache, OpProgress * const
       Progress->Progress(60);
 
    // resolve remaining issues via keep
-   bool const success = Fix.ResolveByKeep(Progress);
+   bool const success = Fix.ResolveByKeepInternal();
    if (Progress != NULL)
       Progress->Done();
    return success;