Author: mlandres
Date: Tue Feb 12 18:31:05 2008
New Revision: 8640
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8640&view=rev
Log:
pool iterator fixes
Modified:
branches/tmp/ma/jump_sat/libzypp/zypp/DiskUsageCounter.cc
branches/tmp/ma/jump_sat/libzypp/zypp/ResPool.h
branches/tmp/ma/jump_sat/libzypp/zypp/pool/PoolTraits.h
branches/tmp/ma/jump_sat/libzypp/zypp/sat/SATResolver.cc
branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/ResolverUpgrade.cc
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/DiskUsageCounter.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/DiskUsageCounter.cc?rev=8640&r1=8639&r2=8640&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/DiskUsageCounter.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/DiskUsageCounter.cc Tue Feb 12 18:31:05 2008
@@ -107,10 +107,9 @@
if ( ! (*it)->installOnly() )
{
// Item to update -> check the installed ones.
- for_( nit, pool_r.byNameBegin((*it)->name()), pool_r.byNameEnd((*it)->name()) )
- { // same name
- if ( (*nit)->kind() == (*it)->kind() // same kind
- && nit->status().staysInstalled() ) // and unselected installed
+ for_( nit, pool_r.byIdentBegin( *it ), pool_r.byIdentEnd( *it ) )
+ { // same kind and name
+ if ( nit->status().staysInstalled() ) // and unselected installed
{
DiskUsage ndu( (*nit)->diskusage() );
if ( ! ndu.empty() )
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/ResPool.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/ResPool.h?rev=8640&r1=8639&r2=8640&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/ResPool.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/ResPool.h Tue Feb 12 18:31:05 2008
@@ -134,6 +134,9 @@
/** Derive name and kind from \ref sat::Solvable. */
byIdent_iterator byIdentBegin( sat::Solvable slv_r ) const
{ return make_filter_begin( ByIdent(slv_r), *this ); }
+ /** Takes a \ref sat::Solvable::ident string. */
+ byIdent_iterator byIdentBegin( IdString ident_r ) const
+ { return make_filter_begin( ByIdent(ident_r), *this ); }
byIdent_iterator byIdentEnd( ResKind kind_r, IdString name_r ) const
@@ -156,6 +159,9 @@
/** Derive name and kind from \ref sat::Solvable. */
byIdent_iterator byIdentEnd( sat::Solvable slv_r ) const
{ return make_filter_begin( ByIdent(slv_r), *this ); }
+ /** Takes a \ref sat::Solvable::ident string. */
+ byIdent_iterator byIdentEnd( IdString ident_r ) const
+ { return make_filter_end( ByIdent(ident_r), *this ); }
//@}
public:
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/pool/PoolTraits.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/pool/PoolTraits.h?rev=8640&r1=8639&r2=8640&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/pool/PoolTraits.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/pool/PoolTraits.h Tue Feb 12 18:31:05 2008
@@ -40,14 +40,20 @@
{ return pi; }
};
- /** Main filter selecting PoolItems bu \c name and \c kind. */
- class ByIdent //: public ResObjectFilterFunctor
+ /** Main filter selecting PoolItems bu \c name and \c kind.
+ *
+ */
+ class ByIdent
{
public:
ByIdent( sat::Solvable slv_r )
: _id( makeIdent( slv_r ) )
{}
+ ByIdent( IdString ident_r )
+ : _id( ident_r.id() )
+ {}
+
ByIdent( ResKind kind_r, IdString name_r )
: _id( makeIdent( kind_r, name_r ) )
{}
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/sat/SATResolver.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/sat/SATResolver.cc?rev=8640&r1=8639&r2=8640&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/sat/SATResolver.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/sat/SATResolver.cc Tue Feb 12 18:31:05 2008
@@ -239,8 +239,7 @@
//------------------------------------------------------------------------------------------------------------
-// This function loops over the pool and grabs
-// all item.status().transacts() and item.status().byUser()
+// This function loops over the pool and grabs all items
// It clears all previous bySolver() states also
//
// Every toBeInstalled is passed to zypp::solver:detail::Resolver.addPoolItemToInstall()
@@ -273,27 +272,15 @@
if (status.isToBeInstalled()) {
resolver.addPoolItemToInstall(item); // -> install!
}
- if (status.isToBeUninstalled()) {
+ else if (status.isToBeUninstalled()) {
resolver.addPoolItemToRemove(item); // -> remove !
}
- if (status.isIncomplete()) { // incomplete (re-install needed)
- PoolItem reinstall = Helper::findReinstallItem (resolver.pool(), item);
- if (reinstall) {
- MIL << "Reinstall " << reinstall << " for incomplete " << item << endl;
- resolver.addPoolItemToInstall(reinstall); // -> install!
- }
- else {
- WAR << "Can't find " << item << " for re-installation" << endl;
- }
- }
-
- if (status.isLocked()
- || (status.isKept()
- && !by_solver)) {
+ else if (status.isLocked()
+ || (status.isKept()
+ && !by_solver)) {
resolver.addPoolItemToLock (item);
}
-
return true;
}
};
@@ -349,17 +336,8 @@
_items_to_lock.clear();
invokeOnEach ( _pool.begin(), _pool.end(),
- resfilter::ByTransact( ), // collect transacts from Pool to resolver queue
functor::functorRef