+ cout << "Total Distinct Versions: " << Cache.Head().VersionCount << " (" <<
+ SizeToStr(Cache.Head().VersionCount*Cache.Head().VersionSz) << ')' << endl;
+ cout << "Total Dependencies: " << Cache.Head().DependsCount << " (" <<
+ SizeToStr(Cache.Head().DependsCount*Cache.Head().DependencySz) << ')' << endl;
+
+ cout << "Total Ver/File relations: " << Cache.Head().VerFileCount << " (" <<
+ SizeToStr(Cache.Head().VerFileCount*Cache.Head().VerFileSz) << ')' << endl;
+ cout << "Total Provides Mappings: " << Cache.Head().ProvidesCount << " (" <<
+ SizeToStr(Cache.Head().ProvidesCount*Cache.Head().ProvidesSz) << ')' << endl;
+
+ // String list stats
+ unsigned long Size = 0;
+ unsigned long Count = 0;
+ for (pkgCache::StringItem *I = Cache.StringItemP + Cache.Head().StringList;
+ I!= Cache.StringItemP; I = Cache.StringItemP + I->NextItem)
+ {
+ Count++;
+ Size += strlen(Cache.StrP + I->String);
+ }
+ cout << "Total Globbed Strings: " << Count << " (" << SizeToStr(Size) << ')' << endl;
+
+ unsigned long Slack = 0;
+ for (int I = 0; I != 7; I++)
+ Slack += Cache.Head().Pools[I].ItemSize*Cache.Head().Pools[I].Count;
+ cout << "Total Slack space: " << SizeToStr(Slack) << endl;
+
+ unsigned long Total = 0;
+ Total = Slack + Size + Cache.Head().DependsCount*Cache.Head().DependencySz +
+ Cache.Head().VersionCount*Cache.Head().VersionSz +
+ Cache.Head().PackageCount*Cache.Head().PackageSz +
+ Cache.Head().VerFileCount*Cache.Head().VerFileSz +
+ Cache.Head().ProvidesCount*Cache.Head().ProvidesSz;
+ cout << "Total Space Accounted for: " << SizeToStr(Total) << endl;
+
+ return true;
+}
+ /*}}}*/
+// Check - Check some things about the cache /*{{{*/
+// ---------------------------------------------------------------------
+/* Debug aide mostly */
+bool Check(CommandLine &Cmd)
+{
+ pkgCache &Cache = *GCache;
+ pkgCache::PkgIterator Pkg = Cache.PkgBegin();
+ for (;Pkg.end() != true; Pkg++)
+ {
+ if (Pkg.Section() == 0 && Pkg->VersionList != 0)
+ cout << "Bad section " << Pkg.Name() << endl;
+
+ for (pkgCache::VerIterator Cur = Pkg.VersionList();
+ Cur.end() != true; Cur++)
+ {
+ if (Cur->Priority < 1 || Cur->Priority > 5)
+ cout << "Bad prio " << Pkg.Name() << ',' << Cur.VerStr() << " == " << (int)Cur->Priority << endl;
+ }
+ }