X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b5cabd30cc1be1c6c1ca675ceb359bab577c1905..39cc82288036a005226564fadd05ef19ef0037bb:/cmdline/apt-cache.cc

diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index 6813d2978..79654f477 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -1321,7 +1321,7 @@ bool Search(CommandLine &CmdL)
 	 continue;
       pkgCache::VerIterator V = Plcy->GetCandidateVer(P);
       if (V.end() == false)
-	 DFList[G->ID].Df = V.DescriptionList().FileList();
+	 DFList[G->ID].Df = V.TranslatedDescription().FileList();
 
       if (DFList[G->ID].NameMatch == false)
 	 continue;
@@ -1334,7 +1334,7 @@ bool Search(CommandLine &CmdL)
 	    continue;
 
 	 unsigned long id = Prv.OwnerPkg().Group()->ID;
-	 DFList[id].Df = V.DescriptionList().FileList();
+	 DFList[id].Df = V.TranslatedDescription().FileList();
 	 DFList[id].NameMatch = true;
       }
    }
@@ -1664,10 +1664,11 @@ bool Madison(CommandLine &CmdL)
       _error->Discard();
 
    APT::CacheSetHelper helper(true, GlobalError::NOTICE);
-   APT::PackageSet pkgset = APT::PackageSet::FromCommandLine(CacheFile, CmdL.FileList + 1, helper);
-   for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg)
+   for (const char **I = CmdL.FileList + 1; *I != 0; I++)
    {
-      if (Pkg.end() == false)
+      _error->PushToStack();
+      APT::PackageSet pkgset = APT::PackageSet::FromString(CacheFile, *I, helper);
+      for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg)
       {
          for (pkgCache::VerIterator V = Pkg.VersionList(); V.end() == false; V++)
          {
@@ -1698,16 +1699,21 @@ bool Madison(CommandLine &CmdL)
          }
       }
 
-      
       SrcRecs.Restart();
       pkgSrcRecords::Parser *SrcParser;
-      while ((SrcParser = SrcRecs.Find(Pkg.Name(),false)) != 0)
+      bool foundSomething = false;
+      while ((SrcParser = SrcRecs.Find(*I, false)) != 0)
       {
+         foundSomething = true;
          // Maybe support Release info here too eventually
          cout << setw(10) << SrcParser->Package() << " | "
               << setw(10) << SrcParser->Version() << " | "
               << SrcParser->Index().Describe(true) << endl;
       }
+      if (foundSomething == true)
+	 _error->RevertToStack();
+      else
+	 _error->MergeWithStack();
    }
 
    return true;
@@ -1775,15 +1781,6 @@ bool ShowHelp(CommandLine &Cmd)
    return true;
 }
 									/*}}}*/
-// CacheInitialize - Initialize things for apt-cache			/*{{{*/
-// ---------------------------------------------------------------------
-/* */
-void CacheInitialize()
-{
-   _config->Set("quiet",0);
-   _config->Set("help",false);
-}
-									/*}}}*/
 int main(int argc,const char *argv[])					/*{{{*/
 {
    CommandLine::Args Args[] = {
@@ -1835,8 +1832,6 @@ int main(int argc,const char *argv[])					/*{{{*/
                                     {"madison",&Madison},
                                     {0,0}};
 
-   CacheInitialize();
-
    // Set up gettext support
    setlocale(LC_ALL,"");
    textdomain(PACKAGE);