Author: jkupec
Date: Mon Apr 7 00:27:53 2008
New Revision: 9409
URL: http://svn.opensuse.org/viewcvs/zypp?rev=9409&view=rev
Log:
- adapt to new PoolQuery
Modified:
trunk/zypper/src/zypper-search.h
trunk/zypper/src/zypper.cc
trunk/zypper/zypper.spec.cmake
Modified: trunk/zypper/src/zypper-search.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-search.h?rev=9409&r1=9408&r2=9409&view=diff
==============================================================================
--- trunk/zypper/src/zypper-search.h (original)
+++ trunk/zypper/src/zypper-search.h Mon Apr 7 00:27:53 2008
@@ -83,6 +83,26 @@
*_table << row;
return true;
}
+
+ bool operator()(const zypp::sat::Solvable & solv) const
+ {
+ TableRow row;
+
+ // add other fields to the result table
+
+ zypp::PoolItem pi( zypp::ResPool::instance().find( solv ) );
+
+ row << ( pi.status().isInstalled() ? "i" : " " )
+ << pi->repository().info().name()
+ // TODO what about rug's Bundle?
+ << (_gopts.is_rug_compatible ?
+ "" : kind_to_string_localized(pi->kind(), 1))
+ << pi->name()
+ << pi->edition().asString()
+ << pi->arch().asString();
+ *_table << row;
+ return true;
+ }
};
#endif /*ZYPPERSEARCH_H_*/
Modified: trunk/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=9409&r1=9408&r2=9409&view=diff
==============================================================================
--- trunk/zypper/src/zypper.cc (original)
+++ trunk/zypper/src/zypper.cc Mon Apr 7 00:27:53 2008
@@ -23,9 +23,12 @@
#include "zypp/ZYppFactory.h"
#include "zypp/base/Logger.h"
+//#include "zypp/base/Algorithm.h"
+
#include "zypp/base/UserRequestException.h"
#include "zypp/repo/RepoException.h"
#include "zypp/zypp_detail/ZYppReadOnlyHack.h"
+#include "zypp/sat/SolvAttr.h"
#include "zypp/target/rpm/RpmHeader.h" // for install <.rpmURI>
@@ -2065,10 +2068,13 @@
if (exitCode() != ZYPPER_EXIT_OK)
return;
- //add available repos to query
- std::listzypp::RepoInfo::const_iterator repo_it;
- for (repo_it = gData.repos.begin();repo_it != gData.repos.end();++repo_it){
- query.addRepo( repo_it->alias());
+ // add available repos to query
+ if (cOpts().count("repo"))
+ {
+ std::listzypp::RepoInfo::const_iterator repo_it;
+ for (repo_it = gData.repos.begin();repo_it != gData.repos.end();++repo_it){
+ query.addRepo( repo_it->alias());
+ }
}
init_target(*this);
@@ -2079,20 +2085,37 @@
Table t;
t.style(Ascii);
+ for(vector<string>::const_iterator it = _arguments.begin();
+ it != _arguments.end(); ++it)
+ query.addString(*it);
+ query.addAttribute(sat::SolvAttr::name);
+ if (cOpts().count("search-descriptions"))
+ {
+ query.addAttribute(sat::SolvAttr::summary);
+ query.addAttribute(sat::SolvAttr::description);
+ }
+
try
{
FillTable callback( t, query );
- query.execute(_arguments.empty()? string() : _arguments[0], callback );
+ cout <<"going ahead"<