/* */
static bool Stats(CommandLine &CmdL)
{
- pkgCacheFile CacheFile;
- pkgCache *Cache = CacheFile.GetPkgCache();
-
if (CmdL.FileSize() > 1) {
_error->Error(_("apt-cache stats does not take any arguments"));
return false;
}
+
+ pkgCacheFile CacheFile;
+ pkgCache *Cache = CacheFile.GetPkgCache();
+
if (unlikely(Cache == NULL))
return false;
continue;
pkgCache::PkgIterator Trg = RevDepends ? D.ParentPkg() : D.TargetPkg();
- bool const showNoArch = RevDepends || (D->CompareOp & pkgCache::Dep::ArchSpecific) != pkgCache::Dep::ArchSpecific;
if((Installed && Trg->CurrentVer != 0) || !Installed)
{
if (ShowDepType == true)
cout << D.DepType() << ": ";
if (Trg->VersionList == 0)
- cout << "<" << Trg.FullName(showNoArch) << ">";
+ cout << "<" << Trg.FullName(true) << ">";
else
- cout << Trg.FullName(showNoArch);
+ cout << Trg.FullName(true);
if (ShowVersion == true && D->Version != 0)
cout << " (" << pkgCache::CompTypeDeb(D->CompareOp) << ' ' << D.TargetVer() << ')';
cout << std::endl;
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++;