Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / zypp / solver / detail / ProblemSolutionIgnore.cc
index 0cbb373..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"
-#include "zypp/solver/detail/Helper.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,
-                                             PoolItem item )
-    : ProblemSolution (parent, "", "")
-{
-    // TranslatorExplanation %s = name of package, patch, selection ...    
-    _description = str::form (_("Ignore some dependencies for %s"), item->name().c_str() );
-
-//    addAction ( new InjectSolutionAction (item, capability, REQUIRES));
-}      
-       
-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, capability, REQUIRES));
-       }
-}
-       
-      ///////////////////////////////////////////////////////////////////
-    };// 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
 /////////////////////////////////////////////////////////////////////////