*/
PoolItem candidateObjFrom( Repository repo_r ) const
{
- for ( const PoolItem & pi : available() )
+ for_( it, availableBegin(), availableEnd() )
{
- if ( pi.repository() == repo_r )
- return pi;
+ if ( (*it)->repository() == repo_r )
+ return *it;
}
return PoolItem();
}
PoolItem highestAvailableVersionObj() const
{
PoolItem ret;
- for ( const PoolItem & pi : available() )
+ for_( it, availableBegin(), availableEnd() )
{
- if ( !ret || pi.edition() > ret.edition() )
- ret = pi;
+ if ( !ret || (*it).satSolvable().edition() > ret.satSolvable().edition() )
+ ret = *it;
}
return ret;
}
available_size_type availableSize() const
{ return _availableItems.size(); }
- available_iterator availableBegin() const
+ available_const_iterator availableBegin() const
{ return _availableItems.begin(); }
- available_iterator availableEnd() const
+ available_const_iterator availableEnd() const
{ return _availableItems.end(); }
- inline Iterable<available_iterator> available() const
- { return makeIterable( availableBegin(), availableEnd() ); }
-
////////////////////////////////////////////////////////////////////////
bool installedEmpty() const
installed_iterator installedEnd() const
{ return _installedItems.end(); }
- inline Iterable<installed_iterator> installed() const
- { return makeIterable( installedBegin(), installedEnd() ); }
-
////////////////////////////////////////////////////////////////////////
const PickList & picklist() const
{
_picklistPtr.reset( new PickList );
// installed without identical avaialble first:
- for ( const PoolItem & pi : installed() )
+ for_( it, _installedItems.begin(), _installedItems.end() )
{
- if ( ! identicalAvailable( pi ) )
- _picklistPtr->push_back( pi );
+ if ( ! identicalAvailable( *it ) )
+ _picklistPtr->push_back( *it );
}
_picklistPtr->insert( _picklistPtr->end(), availableBegin(), availableEnd() );
}
{ return availableEmpty(); }
bool multiversionInstall() const
- {
- for ( const PoolItem & pi : available() )
- {
- if ( pi.multiversionInstall() )
- return true;
- }
- return false;
- }
+ { return sat::Pool::instance().isMultiversion( ident() ); }
bool pickInstall( const PoolItem & pi_r, ResStatus::TransactByValue causer_r, bool yesno_r );
private:
PoolItem transactingInstalled() const
{
- for ( const PoolItem & pi : installed() )
+ for_( it, installedBegin(), installedEnd() )
{
- if ( pi.status().transacts() )
- return pi;
+ if ( (*it).status().transacts() )
+ return (*it);
}
return PoolItem();
}
PoolItem transactingCandidate() const
{
- for ( const PoolItem & pi : available() )
+ for_( it, availableBegin(), availableEnd() )
{
- if ( pi.status().transacts() )
- return pi;
+ if ( (*it).status().transacts() )
+ return (*it);
}
return PoolItem();
}
{
// prefer the installed objects arch and vendor
bool solver_allowVendorChange( ResPool::instance().resolver().allowVendorChange() );
- for ( const PoolItem & ipi : installed() )
+ for ( installed_const_iterator iit = installedBegin();
+ iit != installedEnd(); ++iit )
{
PoolItem sameArch; // in case there's no same vendor at least stay with same arch.
- for ( const PoolItem & api : available() )
+ for ( available_const_iterator it = availableBegin();
+ it != availableEnd(); ++it )
{
// 'same arch' includes allowed changes to/from noarch.
- if ( ipi.arch() == api.arch() || ipi.arch() == Arch_noarch || api.arch() == Arch_noarch )
+ if ( (*iit)->arch() == (*it)->arch() || (*iit)->arch() == Arch_noarch || (*it)->arch() == Arch_noarch )
{
if ( ! solver_allowVendorChange )
{
- if ( VendorAttr::instance().equivalent( ipi, api ) )
- return api;
+ if ( VendorAttr::instance().equivalent( (*iit), (*it) ) )
+ return *it;
else if ( ! sameArch ) // remember best same arch in case no same vendor found
- sameArch = api;
+ sameArch = *it;
}
else // same arch is sufficient
- return api;
+ return *it;
}
}
if ( sameArch )
bool allCandidatesLocked() const
{
- for ( const PoolItem & pi : available() )
+ for ( available_const_iterator it = availableBegin();
+ it != availableEnd(); ++it )
{
- if ( ! pi.status().isLocked() )
+ if ( ! (*it).status().isLocked() )
return false;
}
return( ! _availableItems.empty() );
bool allInstalledLocked() const
{
- for ( const PoolItem & pi : installed() )
+ for ( installed_const_iterator it = installedBegin();
+ it != installedEnd(); ++it )
{
- if ( ! pi.status().isLocked() )
+ if ( ! (*it).status().isLocked() )
return false;
}
return( ! _installedItems.empty() );
{
PoolItem icand( obj.installedObj() );
str << " (I " << obj.installedSize() << ") {" << endl;
- for ( const PoolItem & pi : obj.installed() )
+ for_( it, obj.installedBegin(), obj.installedEnd() )
{
char t = ' ';
- if ( pi == icand )
+ if ( *it == icand )
{
t = 'i';
}
- str << " " << t << " " << pi << endl;
+ str << " " << t << " " << *it << endl;
}
str << "} ";
}
PoolItem cand( obj.candidateObj() );
PoolItem up( obj.updateCandidateObj() );
str << "(A " << obj.availableSize() << ") {" << endl;
- for ( const PoolItem & pi : obj.available() )
+ for_( it, obj.availableBegin(), obj.availableEnd() )
{
char t = ' ';
- if ( pi == cand )
+ if ( *it == cand )
{
- t = pi == up ? 'C' : 'c';
+ t = *it == up ? 'C' : 'c';
}
- else if ( pi == up )
+ else if ( *it == up )
{
t = 'u';
}
- str << " " << t << " " << pi << endl;
+ str << " " << t << " " << *it << endl;
}
str << "} ";
}
PoolItem cand( obj.candidateObj() );
PoolItem up( obj.updateCandidateObj() );
str << "(P " << obj.picklistSize() << ") {" << endl;
- for ( const PoolItem & pi : obj.picklist() )
+ for_( it, obj.picklistBegin(), obj.picklistEnd() )
{
char t = ' ';
- if ( pi == cand )
+ if ( *it == cand )
{
- t = pi == up ? 'C' : 'c';
+ t = *it == up ? 'C' : 'c';
}
- else if ( pi == up )
+ else if ( *it == up )
{
t = 'u';
}
- str << " " << t << " " << pi << "\t" << obj.pickStatus( pi ) << endl;
+ str << " " << t << " " << *it << "\t" << obj.pickStatus( *it ) << endl;
}
str << "} ";
}