]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-cache.cc
do delay the test for http, too, to make it more reliable
[apt.git] / cmdline / apt-cache.cc
index a0322498652954073f2ba4cc410af21c879ecdaf..050508663ef3464b2bfc566afe9b68c6f1d1c070 100644 (file)
@@ -1332,6 +1332,7 @@ static bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V)
 struct ExDescFile
 {
    pkgCache::DescFile *Df;
+   pkgCache::VerIterator V;
    map_id_t ID;
 };
 
@@ -1417,6 +1418,7 @@ static bool Search(CommandLine &CmdL)
         if (D.end() == true)
            continue;
         DFList[G->ID].Df = D.FileList();
+        DFList[G->ID].V = V;
         DFList[G->ID].ID = G->ID;
       }
 
@@ -1436,11 +1438,12 @@ static bool Search(CommandLine &CmdL)
         if (D.end() == true)
            continue;
         DFList[id].Df = D.FileList();
+        DFList[id].V = V;
         DFList[id].ID = id;
 
         size_t const PrvPatternOffset = id * NumPatterns;
         for (unsigned I = 0; I < NumPatterns; ++I)
-           PatternMatch[PrvPatternOffset + I] = PatternMatch[PatternOffset + I];
+           PatternMatch[PrvPatternOffset + I] |= PatternMatch[PatternOffset + I];
       }
    }
 
@@ -1477,13 +1480,7 @@ static bool Search(CommandLine &CmdL)
       if (matchedAll == true)
       {
         if (ShowFull == true)
-        {
-           const char *Start;
-           const char *End;
-           P.GetRec(Start,End);
-           fwrite(Start,End-Start,1,stdout);
-           putc('\n',stdout);
-        }       
+           DisplayRecord(CacheFile, J->V);
         else
            printf("%s - %s\n",P.Name().c_str(),P.ShortDesc().c_str());
       }
@@ -1610,6 +1607,10 @@ static bool ShowSrcPackage(CommandLine &CmdL)
       pkgSrcRecords::Parser *Parse;
       unsigned found_this = 0;
       while ((Parse = SrcRecs.Find(*I,false)) != 0) {
+         // SrcRecs.Find() will find both binary and source names
+         if (_config->FindB("APT::Cache::Only-Source", false) == true)
+            if (Parse->Package() != *I)
+               continue;
         cout << Parse->AsStr() << endl;;
         found++;
         found_this++;