]> git.saurik.com Git - apt.git/commitdiff
Show full package records in apt-cache search -f
authorKusanagi Kouichi <slash@ac.auone-net.jp>
Sun, 16 Aug 2015 14:45:04 +0000 (16:45 +0200)
committerJulian Andres Klode <jak@debian.org>
Sun, 16 Aug 2015 14:45:04 +0000 (16:45 +0200)
This just changes the DoSearch code to use DisplayRecord to
display the record when the full record is requested.

Closes: #660851
[jak@debian.org: Wrote the commit message]

cmdline/apt-cache.cc

index 75337fa0776c9a0650a7dbc87ac360c8c79a408d..f7abb823d6d671befb1847f56b4580af4ccc0f29 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,6 +1438,7 @@ 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;
@@ -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());
       }