X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/47f1d6d23c344b4c592565cc1ea61b5456570a06..127e6df37213a1fda0dd5b44182acf678ccbbf02:/cmdline/apt-cache.cc diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 0e950310b..2b47184f9 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -929,7 +929,11 @@ bool XVcg(CommandLine &CmdL) Shapes[ShapeMap[Pkg->ID]]); } - + + delete[] Show; + delete[] Flags; + delete[] ShapeMap; + printf("}\n"); return true; } @@ -1216,7 +1220,7 @@ bool DisplayRecord(pkgCache::VerIterator V) if (I.IsOk() == false) return _error->Error(_("Package file %s is out of sync."),I.FileName()); - FileFd PkgF(I.FileName(),FileFd::ReadOnly); + FileFd PkgF(I.FileName(),FileFd::ReadOnlyGzip); if (_error->PendingError() == true) return false; @@ -1494,15 +1498,26 @@ bool ShowSrcPackage(CommandLine &CmdL) if (_error->PendingError() == true) return false; + unsigned found = 0; for (const char **I = CmdL.FileList + 1; *I != 0; I++) { SrcRecs.Restart(); pkgSrcRecords::Parser *Parse; - while ((Parse = SrcRecs.Find(*I,false)) != 0) - cout << Parse->AsStr() << endl;; + unsigned found_this = 0; + while ((Parse = SrcRecs.Find(*I,false)) != 0) { + cout << Parse->AsStr() << endl;; + found++; + found_this++; + } + if (found_this == 0) { + _error->Warning(_("Unable to locate package %s"),*I); + continue; + } } - return true; + if (found > 0) + return true; + return _error->Error(_("No packages found")); } /*}}}*/ // Policy - Show the results of the preferences file /*{{{*/ @@ -1616,7 +1631,7 @@ bool Policy(CommandLine &CmdL) if (SrcList->FindIndex(VF.File(),Indx) == false && _system->FindIndex(VF.File(),Indx) == false) return _error->Error(_("Cache is out of sync, can't x-ref a package file")); - printf(_(" %4i %s\n"),Plcy.GetPriority(VF.File()), + printf(" %4i %s\n",Plcy.GetPriority(VF.File()), Indx->Describe(true).c_str()); } }