Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / zypp / solver / detail / ProblemSolutionIgnore.cc
index cb798d6..cb44837 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  * 02111-1307, USA.
  */
+#define ZYPP_USE_RESOLVER_INTERNALS
 
 #include "zypp/base/String.h"
 #include "zypp/base/Gettext.h"
-#include "zypp/base/Logger.h"
 #include "zypp/solver/detail/ProblemSolutionIgnore.h"
-
-using namespace std;
+#include "zypp/solver/detail/SolutionAction.h"
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp
-{ ///////////////////////////////////////////////////////////////////////
+{
   ///////////////////////////////////////////////////////////////////////
   namespace solver
-  { /////////////////////////////////////////////////////////////////////
+  {
     /////////////////////////////////////////////////////////////////////
     namespace detail
-    { ///////////////////////////////////////////////////////////////////
-
-IMPL_PTR_TYPE(ProblemSolutionIgnore);
-
-//---------------------------------------------------------------------------
-
-ProblemSolutionIgnore::ProblemSolutionIgnore( ResolverProblem_Ptr parent,
-                                             const Dep &kind, 
-                                             PoolItem_Ref item,
-                                             const Capability & capability)
-    : 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 (item, capability, kind));  
-    } else if (kind == Dep::PROVIDES) { 
-       _description = _("Ignoring this requirement");
-       addAction ( new InjectSolutionAction (item, capability, kind));         
-    } else {  
-       ERR << "Wrong kind of capability: " << kind << endl;
-    }
-}
-
-      ///////////////////////////////////////////////////////////////////
-    };// namespace detail
+    {
+      ProblemSolutionIgnore::ProblemSolutionIgnore( PoolItem item )
+      // TranslatorExplanation %s = name of package, patch, selection ...
+      : ProblemSolution( str::form(_("break %s by ignoring some of its dependencies"), item.satSolvable().asString().c_str() ) )
+      {
+       addAction( new InjectSolutionAction( item, WEAK ) );
+      }
+
+      ProblemSolutionIgnore::ProblemSolutionIgnore( PoolItemList itemList )
+      : ProblemSolution( _("generally ignore of some dependencies") )
+      {
+       for ( const auto & item : itemList)
+       { addAction( new InjectSolutionAction( item, WEAK ) ); }
+      }
+
+    } // namespace detail
     /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-  };// namespace solver
-  ///////////////////////////////////////////////////////////////////////
+  } // namespace solver
   ///////////////////////////////////////////////////////////////////////
-};// namespace zypp
+} // namespace zypp
 /////////////////////////////////////////////////////////////////////////