]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-get.cc
depend on debhelper 7 to raise compat level
[apt.git] / cmdline / apt-get.cc
index 476896322e742d4b6f46c0bd7702e4452f005315..0a22fd42baa05d7acd3aae50237cb8930c50011a 100644 (file)
@@ -833,6 +833,10 @@ struct TryToInstall {
 
    bool propergateReleaseCandiateSwitching(std::list<std::pair<pkgCache::VerIterator, std::string> > start, std::ostream &out)
    {
+      for (std::list<std::pair<pkgCache::VerIterator, std::string> >::const_iterator s = start.begin();
+               s != start.end(); ++s)
+        Cache->GetDepCache()->SetCandidateVersion(s->first);
+
       bool Success = true;
       std::list<std::pair<pkgCache::VerIterator, pkgCache::VerIterator> > Changed;
       for (std::list<std::pair<pkgCache::VerIterator, std::string> >::const_iterator s = start.begin();
@@ -1647,9 +1651,7 @@ bool DoAutomaticRemove(CacheFile &Cache)
 
    bool purgePkgs = _config->FindB("APT::Get::Purge", false);
    bool smallList = (hideAutoRemove == false &&
-               strcasecmp(_config->Find("APT::Get::HideAutoRemove","").c_str(),"small") == 0) ||
-       // we don't want to autoremove and we don't want to see it, so don't generate lists
-       (doAutoRemove == false && hideAutoRemove == true);
+               strcasecmp(_config->Find("APT::Get::HideAutoRemove","").c_str(),"small") == 0);
 
    string autoremovelist, autoremoveversions;
    unsigned long autoRemoveCount = 0;
@@ -1677,7 +1679,7 @@ bool DoAutomaticRemove(CacheFile &Cache)
            if (Cache[Pkg].Install() == true && Pkg.CurrentVer() == 0)
               Cache->MarkDelete(Pkg, false);
            // only show stuff in the list that is not yet marked for removal
-           else if(Cache[Pkg].Delete() == false) 
+           else if(hideAutoRemove == false && Cache[Pkg].Delete() == false) 
            {
               ++autoRemoveCount;
               // we don't need to fill the strings if we don't need them
@@ -1873,16 +1875,15 @@ bool DoInstall(CommandLine &CmdL)
         pkgCache::PkgIterator I(Cache,Cache.List[J]);
         if ((*Cache)[I].Install() == false)
            continue;
+        pkgCache::VerIterator Cand = Cache[I].CandidateVerIter(Cache);
+        if (Cand.Pseudo() == true)
+           continue;
 
-        const char **J;
-        for (J = CmdL.FileList + 1; *J != 0; J++)
-           if (strcmp(*J,I.Name()) == 0)
-               break;
-        
-        if (*J == 0) {
-           List += I.FullName(true) + " ";
-           VersionsList += string(Cache[I].CandVersion) + "\n";
-        }
+        if (verset[MOD_INSTALL].find(Cand) != verset[MOD_INSTALL].end())
+           continue;
+
+        List += I.FullName(true) + " ";
+        VersionsList += string(Cache[I].CandVersion) + "\n";
       }
       
       ShowList(c1out,_("The following extra packages will be installed:"),List,VersionsList);