LocalitySortedVersionSet bag;
OpTextProgress progress(*_config);
progress.OverallProgress(0, 100, 50, _("Sorting"));
- GetLocalitySortedVersionSet(CacheFile, bag, progress);
+ GetLocalitySortedVersionSet(CacheFile, &bag, &progress);
LocalitySortedVersionSet::iterator V = bag.begin();
progress.OverallProgress(50, 100, 50, _("Full Text Search"));
progress.SubProgress(bag.size());
pkgRecords records(CacheFile);
+
+ std::string format = "${color:highlight}${Package}${color:neutral}/${Origin} ${Version} ${Architecture}${ }${apt:Status}\n";
+ if (_config->FindB("APT::Cache::ShowFull",false) == false)
+ format += " ${Description}\n";
+ else
+ format += " ${LongDescription}\n";
+
int Done = 0;
+ std::vector<bool> PkgsDone(Cache->Head().PackageCount, false);
for ( ;V != bag.end(); ++V)
{
if (Done%500 == 0)
++Done;
// we want to list each package only once
- char const * const PkgName = V.ParentPkg().Name();
- if (output_map.find(PkgName) != output_map.end())
+ pkgCache::PkgIterator const P = V.ParentPkg();
+ if (PkgsDone[P->ID] == true)
continue;
+ char const * const PkgName = P.Name();
pkgCache::DescIterator Desc = V.TranslatedDescription();
pkgRecords::Parser &parser = records.Lookup(Desc.FileList());
std::string const LongDesc = parser.LongDesc();
}
if (all_found == true)
{
- std::stringstream outs;
- ListSingleVersion(CacheFile, records, V, outs);
- output_map.insert(std::make_pair<std::string, std::string>(
- PkgName, outs.str()));
+ PkgsDone[P->ID] = true;
+ std::stringstream outs;
+ ListSingleVersion(CacheFile, records, V, outs, format);
+ output_map.insert(std::make_pair<std::string, std::string>(
+ PkgName, outs.str()));
}
}
APT_FREE_PATTERNS();