bool operator()( PoolItem_Ref provider )
{
- if (!uninstalled // none yet
+ if ((!uninstalled // none yet
|| uninstalled->edition().compare( provider->edition() ) < 0) // or a better one
+ && !provider.status().isLocked()) // is not locked
{
uninstalled = provider; // store
}
Helper::findUpdateItem (const ResPool & pool, PoolItem_Ref item)
{
LookForUpdate info;
-#warning FIXME, should not report locked update candidates.
invokeOnEach( pool.byNameBegin( item->name() ),
pool.byNameEnd( item->name() ),
bool operator()( PoolItem_Ref provider )
{
- uninstalled = provider;
- return false; // stop here, we found it
+ if (provider.status().isLocked()) {
+ return true; // search next
+ } else {
+ uninstalled = provider;
+ return false; // stop here, we found it
+ }
}
};
Helper::findReinstallItem (const ResPool & pool, PoolItem_Ref item)
{
LookForReinstall info;
-#warning FIXME, should not report locked update candidates.
invokeOnEach( pool.byNameBegin( item->name() ),
pool.byNameEnd( item->name() ),
if (! (status.isToBeUninstalled() || status.isImpossible())
&& ! context->isParallelInstall( provider )
&& context->itemIsPossible( provider )
-#warning Locks not implemented
-// && ! pool->itemIsLocked( provider )
+ && ! provider.status().isLocked()
) {
// if we found a to-be-installed provider, choose this and drop all others
|| ! context->itemIsPossible (provider)) {
misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_NOT_INSTALLABLE_PROVIDER, requirer, RESOLVER_INFO_PRIORITY_VERBOSE, match);
misc_info->setOtherPoolItem (provider);
-#warning Locks not implemented
-#if 0
- } else if (pool->itemIsLocked (provider)) {
+ } else if (provider.status().isLocked()) {
misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_LOCKED_PROVIDER, requirer, RESOLVER_INFO_PRIORITY_VERBOSE, match);
misc_info->setOtherPoolItem (provider);
-#endif
}
if (misc_info != NULL) {
if (status.staysInstalled()) {
-#warning Needs Locks
-#if 0
if (! _explicitly_requested
- && pool().itemIsLocked (_item)) {
+ && _item.status().isLocked()) {
ResolverInfo_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_UNINSTALL_LOCKED, _item, RESOLVER_INFO_PRIORITY_VERBOSE);
context->addError (misc_info);
goto finished;
}
-#endif
+
this->logInfo (context);
if (_cap_leading_to_uninstall != Capability() // non-empty _cap_leading_to_uninstall
}
}
-#warning FIXME needs locks
-#if 0
- if ( item->isLocked() ) {
+ if ( item.status().isLocked() ) {
MIL << "doUpgrade available: SKIP taboo candidate " << item << endl;
++opt_stats_r.pre_nocand;
continue;
}
-#endif
++opt_stats_r.pre_avcand;
#warning this should add the best candidate
continue;
}
-#warning This needs locks
-#if 0
- if ( (*it)->is_taboo() ) {
- MIL << "SKIP taboo: " << (*it)->installedObj() << endl;
+ if ( (*it).status().isLocked() ) {
+ MIL << "SKIP taboo: " << (*it) << endl;
++opt_stats_r.chk_is_taboo;
_update_items.push_back ( *it ); // remember in problem list ?
continue;
}
-#endif
CandidateMap::iterator cand_it = candidatemap.find(installed);
_item.status().setToBeUninstalled (ResStatus::USER);
break;
case UNLOCK:
- ERR << "Not implemented yet" << endl;
- ret = false;
-#warning Unlocking items not implemented
+ _item.status().setLock (false, ResStatus::USER);
break;
default:
ERR << "Wrong TransactionKind" << endl;