]> git.saurik.com Git - apt.git/blobdiff - apt-private/private-install.cc
Merge branch 'feature/acq-trans' into feature/expected-size
[apt.git] / apt-private / private-install.cc
index 656b972339b124c39a9193dffa75e92bf3dc0e56..c06caeedd7207e483ade21455c0862640a2fa070 100644 (file)
@@ -119,14 +119,14 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety)
       return false;
 
    // Create the download object
-   pkgAcquire Fetcher;
-   AcqTextStatus Stat(ScreenWidth,_config->FindI("quiet",0));   
+   AcqTextStatus Stat(ScreenWidth,_config->FindI("quiet",0));
+   pkgAcquire Fetcher(&Stat);
    if (_config->FindB("APT::Get::Print-URIs", false) == true)
    {
       // force a hashsum for compatibility reasons
       _config->CndSet("Acquire::ForceHash", "md5sum");
    }
-   else if (Fetcher.Setup(&Stat, _config->FindDir("Dir::Cache::Archives")) == false)
+   else if (Fetcher.GetLock(_config->FindDir("Dir::Cache::Archives")) == false)
       return false;
 
    // Read the source list
@@ -560,9 +560,9 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache,
 
    std::list<APT::VersionSet::Modifier> mods;
    mods.push_back(APT::VersionSet::Modifier(MOD_INSTALL, "+",
-               APT::VersionSet::Modifier::POSTFIX, APT::VersionSet::CANDIDATE));
+               APT::VersionSet::Modifier::POSTFIX, APT::CacheSetHelper::CANDIDATE));
    mods.push_back(APT::VersionSet::Modifier(MOD_REMOVE, "-",
-               APT::VersionSet::Modifier::POSTFIX, APT::VersionSet::NEWEST));
+               APT::VersionSet::Modifier::POSTFIX, APT::CacheSetHelper::NEWEST));
    CacheSetHelperAPTGet helper(c0out);
    verset = APT::VersionSet::GroupedFromCommandLine(Cache,
                CmdL.FileList + 1, mods, fallback, helper);
@@ -619,18 +619,14 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache,
       if (Fix != NULL)
       {
         // Call the scored problem resolver
-        bool resolver_fail = false;
         OpTextProgress Progress(*_config);
         bool const distUpgradeMode = strcmp(CmdL.FileList[0], "dist-upgrade") == 0 || strcmp(CmdL.FileList[0], "full-upgrade") == 0;
 
-        if (UpgradeMode == 0)
-        {
-           if (distUpgradeMode == true)
-              resolver_fail = APT::Upgrade::Upgrade(Cache, 0, &Progress);
-           else
-              resolver_fail = Fix->Resolve(true, &Progress);
-        } else
+        bool resolver_fail = false;
+        if (distUpgradeMode == true || UpgradeMode != APT::Upgrade::ALLOW_EVERYTHING)
            resolver_fail = APT::Upgrade::Upgrade(Cache, UpgradeMode, &Progress);
+        else
+           resolver_fail = Fix->Resolve(true, &Progress);
 
         if (resolver_fail == false && Cache->BrokenCount() == 0)
            return false;