Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / zypp / solver / detail / ProblemSolutionIgnore.cc
index 77f622b..4afeea2 100644 (file)
@@ -26,6 +26,7 @@
 #include "zypp/base/Gettext.h"
 #include "zypp/base/Logger.h"
 #include "zypp/solver/detail/ProblemSolutionIgnore.h"
+#include "zypp/solver/detail/Helper.h"
 
 using namespace std;
 
@@ -44,22 +45,24 @@ IMPL_PTR_TYPE(ProblemSolutionIgnore);
 //---------------------------------------------------------------------------
 
 ProblemSolutionIgnore::ProblemSolutionIgnore( ResolverProblem_Ptr parent,
-                                             const Dep &kind, 
-                                             PoolItem item,
-                                             const Capability & capability)
+                                             PoolItem item )
     : ProblemSolution (parent, "", "")
 {
-    if (kind == Dep::CONFLICTS) {
-       // TranslatorExplanation %s = name of package, patch, selection ...
-       _description = str::form (_("Ignoring conflict of %s"),
-                                 item->name().c_str());
-       addAction (new InjectSolutionAction (capability, kind));        
-    } else if (kind == Dep::PROVIDES) { 
-       _description = _("Ignoring this requirement");
-       addAction ( new InjectSolutionAction (capability, kind));               
-    } else {  
-       ERR << "Wrong kind of capability: " << kind << endl;
-    }
+    // TranslatorExplanation %s = name of package, patch, selection ...
+    _description = str::form (_("break %s by ignoring some of its dependencies"), item.satSolvable().asString().c_str() );
+
+    addAction ( new InjectSolutionAction (item, WEAK));
+}
+
+ProblemSolutionIgnore::ProblemSolutionIgnore( ResolverProblem_Ptr parent,
+                                             PoolItemList itemList )
+    : ProblemSolution (parent, "", "")
+{
+       _description = _("generally ignore of some dependecies");
+       for (PoolItemList::const_iterator iter = itemList.begin();
+            iter != itemList.end(); iter++) {
+           addAction ( new InjectSolutionAction (*iter, WEAK));
+       }
 }
 
       ///////////////////////////////////////////////////////////////////