https://bugzilla.novell.com/show_bug.cgi?id=421588
User jkupec@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=421588#c5
--- Comment #5 from Ján Kupec 2008-10-05 11:55:07 MDT ---
Aaah, i see :O) OK, i will at least do it 'somehow' until Michl answers.
But this should be fast enough:
struct PoolItemGetter
{
PoolItem item;
bool operator()(const PoolItem & pi)
{ item = pi; return false; }
}
PoolItem findInstalledItemInRepos(const PoolItem & installed)
{
const zypp::ResPool& pool = God->pool();
PoolItemGetter getter;
invokeOnEach(
pool.byIdentBegin(installed->kind(), installed->name()),
pool.byIdentEnd(installed->kind(), installed->name()),
functor::chain(
functor::chain(
resfilter::ByUninstalled(),
resfilter::byEdition(installed->edition())),
resfilter::byArch(installed->arch())),
functor::functorRef(getter));
return getter.item;
}
I can also do it with a Selectable (we can add such method to the selectable)
PoolItem Selectable::findInAvailable(const PoolItem & item)
{
PoolItemGetter getter;
invokeOnEach(
availableBegin(),
availableEnd(),
functor::chain(
resfilter::byEdition(item->edition()),
resfilter::byArch(item->arch()),
functor::functorRef(getter));
return getter.item;
}
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.