]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-cache.cc
add options to disable specific checksums for Indexes
[apt.git] / cmdline / apt-cache.cc
index 74a4f69c2256b4d27c2ce6fe08746caf67f20183..34070ba9b29e245ff5e6f651a0c8d3f09159df2f 100644 (file)
@@ -588,7 +588,7 @@ bool ShowDepends(CommandLine &CmdL, bool const RevDepends)
    CacheSetHelperVirtuals helper(false);
    APT::VersionSet verset = APT::VersionSet::FromCommandLine(CacheFile, CmdL.FileList + 1, APT::VersionSet::CANDIDATE, helper);
    if (verset.empty() == true && helper.virtualPkgs.empty() == true)
    CacheSetHelperVirtuals helper(false);
    APT::VersionSet verset = APT::VersionSet::FromCommandLine(CacheFile, CmdL.FileList + 1, APT::VersionSet::CANDIDATE, helper);
    if (verset.empty() == true && helper.virtualPkgs.empty() == true)
-      return false;
+      return _error->Error(_("No packages found"));
    std::vector<bool> Shown(Cache->Head().PackageCount);
 
    bool const Recurse = _config->FindB("APT::Cache::RecurseDepends", false);
    std::vector<bool> Shown(Cache->Head().PackageCount);
 
    bool const Recurse = _config->FindB("APT::Cache::RecurseDepends", false);
@@ -1116,58 +1116,6 @@ bool Dotty(CommandLine &CmdL)
    
    printf("}\n");
    return true;
    
    printf("}\n");
    return true;
-}
-                                                                       /*}}}*/
-// DoAdd - Perform an adding operation                                 /*{{{*/
-// ---------------------------------------------------------------------
-/* */
-bool DoAdd(CommandLine &CmdL)
-{
-   return _error->Error("Unimplemented");
-#if 0   
-   // Make sure there is at least one argument
-   if (CmdL.FileSize() <= 1)
-      return _error->Error("You must give at least one file name");
-   
-   // Open the cache
-   FileFd CacheF(_config->FindFile("Dir::Cache::pkgcache"),FileFd::WriteAny);
-   if (_error->PendingError() == true)
-      return false;
-   
-   DynamicMMap Map(CacheF,MMap::Public);
-   if (_error->PendingError() == true)
-      return false;
-
-   OpTextProgress Progress(*_config);
-   pkgCacheGenerator Gen(Map,Progress);
-   if (_error->PendingError() == true)
-      return false;
-
-   unsigned long Length = CmdL.FileSize() - 1;
-   for (const char **I = CmdL.FileList + 1; *I != 0; I++)
-   {
-      Progress.OverallProgress(I - CmdL.FileList,Length,1,"Generating cache");
-      Progress.SubProgress(Length);
-
-      // Do the merge
-      FileFd TagF(*I,FileFd::ReadOnly);
-      debListParser Parser(TagF);
-      if (_error->PendingError() == true)
-        return _error->Error("Problem opening %s",*I);
-      
-      if (Gen.SelectFile(*I,"") == false)
-        return _error->Error("Problem with SelectFile");
-        
-      if (Gen.MergeList(Parser) == false)
-        return _error->Error("Problem with MergeList");
-   }
-
-   Progress.Done();
-   GCache = &Gen.GetCache();
-   Stats(CmdL);
-   
-   return true;
-#endif   
 }
                                                                        /*}}}*/
 // DisplayRecord - Displays the complete record for the package                /*{{{*/
 }
                                                                        /*}}}*/
 // DisplayRecord - Displays the complete record for the package                /*{{{*/
@@ -1321,7 +1269,7 @@ bool Search(CommandLine &CmdL)
         continue;
       pkgCache::VerIterator V = Plcy->GetCandidateVer(P);
       if (V.end() == false)
         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;
 
       if (DFList[G->ID].NameMatch == false)
         continue;
@@ -1334,7 +1282,7 @@ bool Search(CommandLine &CmdL)
            continue;
 
         unsigned long id = Prv.OwnerPkg().Group()->ID;
            continue;
 
         unsigned long id = Prv.OwnerPkg().Group()->ID;
-        DFList[id].Df = V.DescriptionList().FileList();
+        DFList[id].Df = V.TranslatedDescription().FileList();
         DFList[id].NameMatch = true;
       }
    }
         DFList[id].NameMatch = true;
       }
    }
@@ -1743,15 +1691,13 @@ bool ShowHelp(CommandLine &Cmd)
 
    cout << 
     _("Usage: apt-cache [options] command\n"
 
    cout << 
     _("Usage: apt-cache [options] command\n"
-      "       apt-cache [options] add file1 [file2 ...]\n"
       "       apt-cache [options] showpkg pkg1 [pkg2 ...]\n"
       "       apt-cache [options] showsrc pkg1 [pkg2 ...]\n"
       "\n"
       "       apt-cache [options] showpkg pkg1 [pkg2 ...]\n"
       "       apt-cache [options] showsrc pkg1 [pkg2 ...]\n"
       "\n"
-      "apt-cache is a low-level tool used to manipulate APT's binary\n"
-      "cache files, and query information from them\n"
+      "apt-cache is a low-level tool used to query information\n"
+      "from APT's binary cache files\n"
       "\n"
       "Commands:\n"
       "\n"
       "Commands:\n"
-      "   add - Add a package file to the source cache\n"
       "   gencaches - Build both the package and source cache\n"
       "   showpkg - Show some general information for a single package\n"
       "   showsrc - Show source records\n"
       "   gencaches - Build both the package and source cache\n"
       "   showpkg - Show some general information for a single package\n"
       "   showsrc - Show source records\n"
@@ -1781,15 +1727,6 @@ bool ShowHelp(CommandLine &Cmd)
    return true;
 }
                                                                        /*}}}*/
    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[] = {
 int main(int argc,const char *argv[])                                  /*{{{*/
 {
    CommandLine::Args Args[] = {
@@ -1820,7 +1757,6 @@ int main(int argc,const char *argv[])                                     /*{{{*/
       {0,"enhances","APT::Cache::ShowEnhances",0},
       {0,0,0,0}};
    CommandLine::Dispatch CmdsA[] = {{"help",&ShowHelp},
       {0,"enhances","APT::Cache::ShowEnhances",0},
       {0,0,0,0}};
    CommandLine::Dispatch CmdsA[] = {{"help",&ShowHelp},
-                                    {"add",&DoAdd},
                                     {"gencaches",&GenCaches},
                                     {"showsrc",&ShowSrcPackage},
                                     {0,0}};
                                     {"gencaches",&GenCaches},
                                     {"showsrc",&ShowSrcPackage},
                                     {0,0}};
@@ -1841,8 +1777,6 @@ int main(int argc,const char *argv[])                                     /*{{{*/
                                     {"madison",&Madison},
                                     {0,0}};
 
                                     {"madison",&Madison},
                                     {0,0}};
 
-   CacheInitialize();
-
    // Set up gettext support
    setlocale(LC_ALL,"");
    textdomain(PACKAGE);
    // Set up gettext support
    setlocale(LC_ALL,"");
    textdomain(PACKAGE);