Author: jkupec Date: Fri Sep 12 13:52:35 2008 New Revision: 11032 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11032&view=rev Log: - filter installed/uninstalled according to options Modified: trunk/zypper/src/search.cc Modified: trunk/zypper/src/search.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/search.cc?rev=11032&r1=11031&r2=11032&view=diff ============================================================================== --- trunk/zypper/src/search.cc (original) +++ trunk/zypper/src/search.cc Fri Sep 12 13:52:35 2008 @@ -354,11 +354,19 @@ { cout << "<pattern-list>" << endl; + bool installed_only = zypper.cOpts().count("installed-only"); + bool notinst_only = zypper.cOpts().count("uninstalled-only"); + ResPool::byKind_iterator it = God->pool().byKindBegin(ResKind::pattern), e = God->pool().byKindEnd(ResKind::pattern); for (; it != e; ++it ) { + if (it->isSatisfied() && notinst_only) + continue; + else if (!it->isSatisfied() && installed_only) + continue; + Pattern::constPtr pattern = asKind<Pattern>(it->resolvable()); cout << asXML(*pattern, it->isSatisfied()) << endl; } @@ -380,11 +388,19 @@ th << _("Repository") << _("Dependency"); tbl << th; + bool installed_only = zypper.cOpts().count("installed-only"); + bool notinst_only = zypper.cOpts().count("uninstalled-only"); + ResPool::byKind_iterator it = God->pool().byKindBegin(ResKind::pattern), e = God->pool().byKindEnd(ResKind::pattern); for (; it != e; ++it ) { + if (it->isSatisfied() && notinst_only) + continue; + else if (!it->isSatisfied() && installed_only) + continue; + Pattern::constPtr pattern = asKind<Pattern>(it->resolvable()); TableRow tr; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org