Bug 159673
authorStefan Schubert <schubi@suse.de>
Wed, 5 Apr 2006 16:22:02 +0000 (16:22 +0000)
committerStefan Schubert <schubi@suse.de>
Wed, 5 Apr 2006 16:22:02 +0000 (16:22 +0000)
zypp/solver/detail/ResolverContext.cc
zypp/solver/detail/ResolverContext.h
zypp/solver/detail/ResolverQueue.cc

index 897447eea6c8bd5b2c1152276fd33c68e953842e..74b7266ab2f946013c2f4a4084d5413986670ee9 100644 (file)
@@ -95,6 +95,7 @@ ResolverContext::ResolverContext (const ResPool & pool, const Arch & arch, Resol
     , _verifying (false)
     , _establishing (false)
     , _invalid (false)
+    , _askUser(false)
     , _architecture(arch)
     , _forceResolve(false)
     , _upgradeMode(false)
@@ -476,16 +477,16 @@ ResolverContext::uninstall (PoolItem_Ref item, bool part_of_upgrade, bool due_to
        if (!found) {
            // generating a default problem
            ResolverInfo_Ptr misc_info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_REJECT_INSTALL, item, RESOLVER_INFO_PRIORITY_VERBOSE);
-           addError (misc_info);
+           addError (misc_info, true); // true = asking the user
        } else {
            // Put the info at the end of the list, flagged as error
            for (ResolverInfoList::const_iterator iter = addList.begin(); iter != addList.end(); iter++) {
                ResolverInfo_Ptr info = *iter;
-               addError (info);
+               addError (info, true);  // true = asking the user
            }
        }
        
-       return false;
+//     return false;
     }
 
     if (status.isToBeUninstalled()
@@ -1112,14 +1113,15 @@ ResolverContext::incompleteCount (void) const
 // info
 
 void
-ResolverContext::addInfo (ResolverInfo_Ptr info)
+ResolverContext::addInfo (ResolverInfo_Ptr info, bool askUser)
 {
     _XDEBUG( "ResolverContext[" << this << "]::addInfo(" << *info << ")" );
     _log.push_back (info);
 
     // _propagated_importance = false;
 
-    if (info->error ()) {
+    if (info->error ()
+       && !askUser) { // Go forward in order to evaluate more problems
 
        if (! _invalid) {
            ResolverInfo_Ptr info = new ResolverInfoMisc (RESOLVER_INFO_TYPE_INVALID_SOLUTION, PoolItem_Ref(), RESOLVER_INFO_PRIORITY_VERBOSE);
@@ -1129,15 +1131,17 @@ ResolverContext::addInfo (ResolverInfo_Ptr info)
 
        _invalid = true;
     }
+    if (askUser)
+       _askUser = true;
 }
 
 
 void
-ResolverContext::addError (ResolverInfo_Ptr info)
+ResolverContext::addError (ResolverInfo_Ptr info, bool askUser)
 {
     info->flagAsError ();
     WAR << "******** Error: " << *info << endl;
-    addInfo (info);
+    addInfo (info, askUser);
 }
 
 
index f07e2f167a8827b6a18b4b900ef9bc15d6560dce..e73f8cc1ee9c171879e9018ae511091e72874f3c 100644 (file)
@@ -77,6 +77,7 @@ class ResolverContext : public base::ReferenceCounted, private base::NonCopyable
     bool _verifying;                           // running 'verifySystem'
     bool _establishing;                                // running 'establishSystem'
     bool _invalid;                             // lead to invalid solution
+    bool _askUser;                             // lead to invalid solution too cause we have to ask the user 
 
     PoolItem_Ref _last_checked_item;           // cache for {get,set}Status
     ResStatus _last_checked_status;
@@ -122,6 +123,7 @@ class ResolverContext : public base::ReferenceCounted, private base::NonCopyable
     int otherPenalties (void) const { return _other_penalties; }
 
     bool isValid (void) const { return !_invalid; }
+    bool askUser (void) const { return _askUser; }
     bool isInvalid (void) const { return _invalid; }
 
     bool verifying (void) const { return _verifying; }
@@ -247,9 +249,9 @@ class ResolverContext : public base::ReferenceCounted, private base::NonCopyable
 //    int impossibleCount (void);
 
     // add to the report log
-    void addInfo (ResolverInfo_Ptr info);                                      // normal progress info
-    void addError (ResolverInfo_Ptr info);                                     // error progress info
-
+    void addInfo (ResolverInfo_Ptr info, bool askUser = false);        // normal progress info
+    void addError (ResolverInfo_Ptr info, bool askUser = false);// error progress info
+    
     // iterate over report log
     void foreachInfo (PoolItem_Ref item, int priority, ResolverInfoFn fn, void *data) const;
     ResolverInfoList getInfo (void) const;
index 4f6ec5d794be2aabf6105108e6eeb69cebeac169..59b9039cc21d033ee1e82a278ca5e4e88cfee1c7 100644 (file)
@@ -173,7 +173,7 @@ ResolverQueue::addItem (QueueItem_Ptr qitem)
 bool
 ResolverQueue::isInvalid ()
 {
-    return _context->isInvalid();
+    return _context->isInvalid() || _context->askUser();
 }