Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / zypp / solver / detail / ProblemSolutionIgnore.cc
index 3abc818..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;
 
@@ -39,65 +40,31 @@ namespace zypp
     namespace detail
     { ///////////////////////////////////////////////////////////////////
 
-IMPL_PTR_TYPE(ProblemSolutionIgnoreConflicts);
-IMPL_PTR_TYPE(ProblemSolutionIgnoreRequires);
-IMPL_PTR_TYPE(ProblemSolutionIgnoreArch);
-IMPL_PTR_TYPE(ProblemSolutionIgnoreInstalled); 
+IMPL_PTR_TYPE(ProblemSolutionIgnore);
 
 //---------------------------------------------------------------------------
 
-ProblemSolutionIgnoreRequires::ProblemSolutionIgnoreRequires( ResolverProblem_Ptr parent,
-                                                             PoolItem_Ref item,
-                                                             const Capability & capability)
+ProblemSolutionIgnore::ProblemSolutionIgnore( ResolverProblem_Ptr parent,
+                                             PoolItem item )
     : ProblemSolution (parent, "", "")
 {
-       _description = _("Ignoring this requirement");
-       addAction ( new InjectSolutionAction (item, capability, REQUIRES));
+    // 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));
 }
 
-ProblemSolutionIgnoreRequires::ProblemSolutionIgnoreRequires( ResolverProblem_Ptr parent,
-                                                             PoolItemList itemList,      
-                                                             const Capability & capability)
+ProblemSolutionIgnore::ProblemSolutionIgnore( ResolverProblem_Ptr parent,
+                                             PoolItemList itemList )
     : ProblemSolution (parent, "", "")
 {
-       _description = _("Ignoring this requirement");
+       _description = _("generally ignore of some dependecies");
        for (PoolItemList::const_iterator iter = itemList.begin();
             iter != itemList.end(); iter++) {
-           addAction ( new InjectSolutionAction (*iter, capability, REQUIRES));
+           addAction ( new InjectSolutionAction (*iter, WEAK));
        }
 }
-       
-ProblemSolutionIgnoreConflicts::ProblemSolutionIgnoreConflicts( ResolverProblem_Ptr parent,
-                                                               PoolItem_Ref item,
-                                                               const Capability & capability,
-                                                               PoolItem_Ref otherItem)
-    : ProblemSolution (parent, "", "")
-{
-       // TranslatorExplanation %s = name of package, patch, selection ...
-       _description = str::form (_("Ignoring conflict of %s"),
-                                 item->name().c_str());
-       addAction (new InjectSolutionAction (item, capability, CONFLICTS, otherItem));  
-}
 
-ProblemSolutionIgnoreArch::ProblemSolutionIgnoreArch( ResolverProblem_Ptr parent,
-                                                     PoolItem_Ref item )
-    : ProblemSolution (parent, "", "")
-{
-    _description = _("Ignoring Architecture");
-    addAction ( new InjectSolutionAction (item, Capability(), ARCHITECTURE));
-}
-
-ProblemSolutionIgnoreInstalled::ProblemSolutionIgnoreInstalled( ResolverProblem_Ptr parent,
-                                                               PoolItem_Ref item,
-                                                               PoolItem_Ref otherItem)
-    : ProblemSolution (parent, "", "")
-{
-       // TranslatorExplanation %s = name of package, patch, selection ...
-       _description = str::form (_("Ignoring that %s is already set to install"),
-                                 item->name().c_str());
-       addAction (new InjectSolutionAction (item, Capability(), INSTALLED, otherItem));        
-}
-       
       ///////////////////////////////////////////////////////////////////
     };// namespace detail
     /////////////////////////////////////////////////////////////////////