-------------------------------------------------------------------
+Mon Aug 20 14:16:20 CEST 2007 - kkaempf@suse.de
+
+- fix first column (i/v) of 'search' output
+- r6759
+- 0.8.14
+
+-------------------------------------------------------------------
Mon Aug 20 13:55:53 CEST 2007 - kkaempf@suse.de
- adapt to unified query API of libzypp-3.18.x
const vector<string> qstrings
) :
_zypp(zypp), _options(options), _qstrings(qstrings), _query( _manager_options.repoCachePath ) {
-#if 0
+
+#if 0 // we don't search the pool but iterate on the cache directly, hence no repos needed
// no repos warning
if (gData.repos.empty()) {
cerr << _("No repositories configured. Please add at least one"
exit(ZYPPER_EXIT_NO_REPOS); // TODO #define zypper error codes?
}
#endif
+
setupRegexp();
cacheInstalled();
-#if 0
+#if 0 // we iterate directly on the cache, no ResPool populate needed
load_repo_resolvables(); // populates ResPool with resolvables from repos
#endif
// cache identification strings of source resolvables (used to check for
(_incl_kind_in_key ? pi.resolvable()->kind().asString() : "");
}
+ std::string getKey( const zypp::data::ResObject_Ptr res ) const {
+ return res->name +
+ (_incl_kind_in_key ? res->kind.asString() : "");
+ }
+
void addItem(const zypp::PoolItem & pi) { _items[getKey(pi)] = pi; }
zypp::PoolItem & getItem(const zypp::PoolItem & pi) {
return _items[getKey(pi)];
}
+ zypp::PoolItem & getItem( const zypp::data::ResObject_Ptr res ) {
+ return _items[getKey( res )];
+ }
+
unsigned int size() {
return _items.size();
}
}
/** defined for use as a functor for filling the hashmap in a for_each */
- // FIXME: should be cache::ProcessResolvable
bool operator()(const zypp::data::RecordId & id, const zypp::data::ResObject_Ptr res) {
- // dummy
+ // dummy, since zypp::data::ResObject_Ptr is never 'installed'
return true;
}
pi.resolvable()->kind().asString() + pi.resolvable()->arch().asString();
}
+ std::string getKey(const zypp::data::ResObject_Ptr res) const {
+ return res->name + res->edition.asString() +
+ res->kind.asString() + res->arch.asString();
+ }
+
void addItem(const zypp::PoolItem & pi) { _items.insert(getKey(pi)); }
+ void addItem(const zypp::data::ResObject_Ptr res) { _items.insert(getKey(res)); }
bool contains(const zypp::PoolItem & pi) {
return _items.count(getKey(pi));
}
+ bool contains(const zypp::data::ResObject_Ptr res) {
+ return _items.count(getKey(res));
+ }
+
/** defined for use as a functor for filling the IdSet in a for_each */
bool operator()(const zypp::PoolItem & pi) {
addItem(pi);
}
/** defined for use as a functor for filling the IdSet in a for_each */
- // FIXME: should be cache::ProcessResolvable
bool operator()(const zypp::data::RecordId & id, const zypp::data::ResObject_Ptr res) {
- // dummy
+ addItem( res );
return true;
}
TableRow row;
// add status to the result table
- zypp::PoolItem inst_item; // = _icache->getItem(pool_item);
+ zypp::PoolItem inst_item = _icache->getItem( res );
if (inst_item) {
// check whether the pool item is installed...
if (inst_item.resolvable()->edition() == res->edition &&