ResPool pool = _zypp->pool();
// search for specific resolvable type only
- if (_options.kind() != Resolvable::Kind()) {
+ if (_options.kind() != Resolvable::Kind())
+ {
cerr_vv << "invokeOnEachSearched(): search by type" << endl;
if (_options.installedFilter() != ZyppSearchOptions::UNINSTALLED_ONLY)
{
// search cache on ALL or UNINSTALLED by TYPE
- _query.iterateResolvablesByKind( _options.kind(), cache_cb );
+ if (_qstrings.empty())
+ _query.iterateResolvablesByKind( _options.kind(), cache_cb );
+ else
+ {
+ std::vector<zypp::Resolvable::Kind> kinds;
+ kinds.push_back( _options.kind() );
+ _query.iterateResolvablesByKindsAndName( kinds, _qstrings[0], _options.matchExact() ? 0 : 3, cache_cb );
+ }
}
catch ( const Exception & excpt_r )
{
{
try
{
- // search cache on ALL or UNINSTALLED by EXACT NAME
+ // search cache on ALL or UNINSTALLED by Kind AND Name
- _query.iterateResolvablesByName( _qstrings[0], 0, cache_cb );
+ std::vector<zypp::Resolvable::Kind> kinds;
+ kinds.push_back( ResTraits<Package>::kind );
+ _query.iterateResolvablesByKindsAndName( kinds, _qstrings[0], 0, cache_cb );
}
catch ( const Exception & excpt_r )
{
{
// search cache on ALL or UNINSTALLED by WILD NAME
- _query.iterateResolvablesByName( _qstrings[0], 3, cache_cb );
+ std::vector<zypp::Resolvable::Kind> kinds;
+ kinds.push_back( ResTraits<Package>::kind );
+ _query.iterateResolvablesByKindsAndName( kinds, _qstrings[0], 3, cache_cb );
}
catch ( const Exception & excpt_r )
{
ZyppSearch::doSearch(const boost::function<bool(const PoolItem &)> & f, const zypp::cache::ProcessResolvable & r)
{
boost::function<bool (const PoolItem &)> filter;
-cerr << "ZyppSearch::doSearch()" << endl;
+
switch (_options.installedFilter()) {
case ZyppSearchOptions::INSTALLED_ONLY:
filter = chain(ByInstalledCache(_icache),Match(_reg,_options.searchDescriptions()));