- Do not evaluate provide,conflicts.... of an item which has to be
authorStefan Schubert <schubi@suse.de>
Fri, 17 Feb 2006 16:51:38 +0000 (16:51 +0000)
committerStefan Schubert <schubi@suse.de>
Fri, 17 Feb 2006 16:51:38 +0000 (16:51 +0000)
  installed and which is uninstallable
- lower priority of recommend items when a conflict happens

zypp/solver/detail/QueueItemInstall.cc
zypp/solver/detail/ResolverContext.cc

index e8163f9..3c32022 100644 (file)
@@ -237,7 +237,7 @@ struct UninstallConflicting
            _context->addInfo (misc_info);
        }
 
-       _XDEBUG("because: '" << conflicting_item << "' provides " << conflicting_cap);
+       _XDEBUG("because: '" << conflicting_item << "'conflicts " << conflicting_cap);
 
        QueueItemUninstall_Ptr uninstall_qitem = new QueueItemUninstall (_context->pool(), conflicting_item, QueueItemUninstall::CONFLICT);
        uninstall_qitem->setDueToConflict ();
@@ -326,17 +326,23 @@ QueueItemInstall::process (ResolverContext_Ptr context, QueueItemList & qil)
 
     if (!_upgrades) {
 
-       _XDEBUG("simple install of " <<  _item);
-       context->install (_item, context->verifying() || _soft, _other_penalty);
+       _XDEBUG("trying simple install of " <<  _item);
+       if (!context->install (_item, context->verifying() || _soft, _other_penalty))
+           goto finished;
 
     }
     else {
 
        QueueItemUninstall_Ptr uninstall_item;
 
-       _XDEBUG("upgrade install of " << _item);
+       _XDEBUG("trying upgrade install of " << _item);
 
-       context->upgrade (_item, _upgrades, context->verifying() || _soft, _other_penalty);
+       if (!context->upgrade (_item, _upgrades, context->verifying() || _soft, _other_penalty)) {
+           // invalid solution
+           ResolverInfo_Ptr info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_INVALID_SOLUTION, PoolItem_Ref(), RESOLVER_INFO_PRIORITY_VERBOSE);
+           context->addError (info);
+           goto finished;
+       }
 
        // the upgrade will uninstall the installed one, take care of this
 
index 78fded0..f89bba9 100644 (file)
@@ -122,7 +122,7 @@ ResolverContext::~ResolverContext()
 ResStatus
 ResolverContext::getStatus (PoolItem_Ref item)
 {
-_XDEBUG( "[" << this << "]getStatus(" << item << ")" );
+//_XDEBUG( "[" << this << "]getStatus(" << item << ")" );
 
     if (item == _last_checked_item) return _last_checked_status;
 
@@ -135,7 +135,7 @@ _XDEBUG( "[" << this << "]getStatus(" << item << ")" );
 
        it = context->_context.find(item);              // part of local context ?
        if (it != context->_context.end()) {
-_XDEBUG( "[" << context << "]:" << it->second );
+//_XDEBUG( "[" << context << "]:" << it->second );
            _last_checked_status = it->second;
            return it->second;                          // Y: return
        }
@@ -149,7 +149,7 @@ _XDEBUG( "[" << context << "]:" << it->second );
        status = ResStatus::uninstalled;                // return _is_ state, not _to be_ state
 
     _last_checked_status = status;
-    _XDEBUG( "[NULL]:" << status );    
+//    _XDEBUG( "[NULL]:" << status );    
 #else
     _last_checked_status = item.status();    
 #endif
@@ -288,17 +288,17 @@ ResolverContext::upgrade (PoolItem_Ref item, PoolItem_Ref old_item, bool is_soft
     if (status.isToBeUninstalled()
        || status.isImpossible())
        return false;
-
+    
     if (status.isToBeInstalled())
        return true;
-
+    
     if (is_soft) {
        setStatus (item, ResStatus::toBeInstalledSoft);
     }
     else {
        setStatus (item, ResStatus::toBeInstalled);
     }
-
+    
     Resolvable::constPtr res = old_item.resolvable();
     Package::constPtr pkg = asKind<Package>(res);                      // try to access it as a package
     if (pkg) {                                                 // if its !=NULL, get size information