Author: schubi2
Date: Mon Apr 21 14:12:09 2008
New Revision: 9759
URL: http://svn.opensuse.org/viewcvs/zypp?rev=9759&view=rev
Log:
cleanup in ignore dependencies
Modified:
trunk/libzypp/zypp/solver/detail/ProblemSolutionIgnore.cc
trunk/libzypp/zypp/solver/detail/ProblemSolutionIgnore.h
trunk/libzypp/zypp/solver/detail/Resolver.cc
trunk/libzypp/zypp/solver/detail/Resolver.h
trunk/libzypp/zypp/solver/detail/SolutionAction.cc
trunk/libzypp/zypp/solver/detail/SolutionAction.h
Modified: trunk/libzypp/zypp/solver/detail/ProblemSolutionIgnore.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/ProblemSolutionIgnore.cc?rev=9759&r1=9758&r2=9759&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/ProblemSolutionIgnore.cc (original)
+++ trunk/libzypp/zypp/solver/detail/ProblemSolutionIgnore.cc Mon Apr 21 14:12:09 2008
@@ -40,112 +40,30 @@
namespace detail
{ ///////////////////////////////////////////////////////////////////
-IMPL_PTR_TYPE(ProblemSolutionIgnoreConflicts);
-IMPL_PTR_TYPE(ProblemSolutionIgnoreRequires);
-IMPL_PTR_TYPE(ProblemSolutionIgnoreArchitecture);
-IMPL_PTR_TYPE(ProblemSolutionIgnoreVendor);
-IMPL_PTR_TYPE(ProblemSolutionIgnoreInstalled);
+IMPL_PTR_TYPE(ProblemSolutionIgnore);
//---------------------------------------------------------------------------
-ProblemSolutionIgnoreRequires::ProblemSolutionIgnoreRequires( ResolverProblem_Ptr parent,
- PoolItem item,
- const Capability & capability)
+ProblemSolutionIgnore::ProblemSolutionIgnore( ResolverProblem_Ptr parent,
+ PoolItem item )
: ProblemSolution (parent, "", "")
{
- _description = _("Ignore this requirement just here");
- addAction ( new InjectSolutionAction (item, capability, REQUIRES));
-}
-
-ProblemSolutionIgnoreRequires::ProblemSolutionIgnoreRequires( ResolverProblem_Ptr parent,
- PoolItemList itemList,
- const Capability & capability)
- : ProblemSolution (parent, "", "")
-{
- _description = _("Generally ignore this requirement");
- for (PoolItemList::const_iterator iter = itemList.begin();
- iter != itemList.end(); iter++) {
- addAction ( new InjectSolutionAction (*iter, capability, REQUIRES));
- }
-}
+ // TranslatorExplanation %s = name of package, patch, selection ...
+ _description = str::form (_("Ignore some dependencies for %s"), item->name().c_str() );
-ProblemSolutionIgnoreArchitecture::ProblemSolutionIgnoreArchitecture( ResolverProblem_Ptr parent,
- PoolItem item)
- : ProblemSolution (parent, "", "")
-{
- // TranslatorExplanation %s = name of package, patch, selection ...
- _description = str::form(_("Install %s although it would change the architecture"),
- item->name().c_str());
- // TranslatorExplanation %s = name of package, patch, selection ...
- _details = str::form(_("%s provides this dependency, but would change the architecture of the installed item"),
- Helper::itemToString (item).c_str());
- addAction ( new InjectSolutionAction (item, ARCHITECTURE));
-}
-
-ProblemSolutionIgnoreVendor::ProblemSolutionIgnoreVendor( ResolverProblem_Ptr parent,
- PoolItem item)
- : ProblemSolution (parent, "", "")
-{
- // TranslatorExplanation %s = name of package, patch, selection ...
- _description = str::form(_("Install %s although it would change the vendor"),
- item->name().c_str());
- // TranslatorExplanation %s = name of package, patch, selection ...
- _details = str::form(_("%s provides this dependency, but would change the vendor of the installed item"),
- Helper::itemToString (item).c_str());
- addAction ( new InjectSolutionAction (item, VENDOR));
-}
+// addAction ( new InjectSolutionAction (item, capability, REQUIRES));
+}
-ProblemSolutionIgnoreConflicts::ProblemSolutionIgnoreConflicts( ResolverProblem_Ptr parent,
- PoolItem item,
- const Capability & capability,
- PoolItem otherItem)
+ProblemSolutionIgnore::ProblemSolutionIgnore( ResolverProblem_Ptr parent,
+ PoolItemList itemList )
: ProblemSolution (parent, "", "")
{
- // TranslatorExplanation %s = name of package, patch, selection ...
- _description = str::form (_("Ignore this conflict of %s"),
- item->name().c_str());
- addAction (new InjectSolutionAction (item, capability, CONFLICTS, otherItem));
-}
-
-ProblemSolutionIgnoreConflicts::ProblemSolutionIgnoreConflicts( ResolverProblem_Ptr parent,
- PoolItem item,
- const Capability & capability,
- PoolItemList itemList)
- : ProblemSolution (parent, "", "")
-{
- // TranslatorExplanation %s = name of package, patch, selection ...
- _description = str::form (_("Ignore this conflict of %s"),
- item->name().c_str());
+ _description = _("Generally ignore of some dependecies");
for (PoolItemList::const_iterator iter = itemList.begin();
iter != itemList.end(); iter++) {
- addAction (new InjectSolutionAction (item, capability, CONFLICTS, *iter));
+// addAction ( new InjectSolutionAction (*iter, capability, REQUIRES));
}
}
-
-ProblemSolutionIgnoreObsoletes::ProblemSolutionIgnoreObsoletes( ResolverProblem_Ptr parent,
- PoolItem item,
- const Capability & capability,
- PoolItem otherItem)
- : ProblemSolution (parent, "", "")
-{
- // TranslatorExplanation %s = name of package, patch, selection ...
- _description = str::form (_("Ignore the obsolete %s in %s"),
- Helper::capToString (capability).c_str(),
- otherItem->name().c_str());
- addAction (new InjectSolutionAction (item, capability, OBSOLETES, otherItem));
-}
-
-
-ProblemSolutionIgnoreInstalled::ProblemSolutionIgnoreInstalled( ResolverProblem_Ptr parent,
- PoolItem item,
- PoolItem otherItem)
- : ProblemSolution (parent, "", "")
-{
- // TranslatorExplanation %s = name of package, patch, selection ...
- _description = str::form (_("Ignore that %s is already set to install"),
- item->name().c_str());
- addAction (new InjectSolutionAction (item, Capability(), INSTALLED, otherItem));
-}
///////////////////////////////////////////////////////////////////
};// namespace detail
Modified: trunk/libzypp/zypp/solver/detail/ProblemSolutionIgnore.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/ProblemSolutionIgnore.h?rev=9759&r1=9758&r2=9759&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/ProblemSolutionIgnore.h (original)
+++ trunk/libzypp/zypp/solver/detail/ProblemSolutionIgnore.h Mon Apr 21 14:12:09 2008
@@ -37,87 +37,22 @@
/**
* Class representing one possible solution to one problem found during resolving
- * This problem solution ignores one or more items
- *
+ * This problem solution ignores one or more items by setting his dependencies
+ * to weak
**/
- class ProblemSolutionIgnoreConflicts : public ProblemSolution
+ class ProblemSolutionIgnore : public ProblemSolution
{
public:
/**
* Constructor.
**/
- ProblemSolutionIgnoreConflicts( ResolverProblem_Ptr parent,
- PoolItem item,
- const Capability & capability,
- PoolItem otherItem);
- ProblemSolutionIgnoreConflicts( ResolverProblem_Ptr parent,
- PoolItem item,
- const Capability & capability,
- PoolItemList itemList);
+ ProblemSolutionIgnore( ResolverProblem_Ptr parent,
+ PoolItem item );
+ ProblemSolutionIgnore( ResolverProblem_Ptr parent,
+ PoolItemList itemList);
};
- class ProblemSolutionIgnoreRequires : public ProblemSolution
- {
- public:
-
- /**
- * Constructor.
- **/
- ProblemSolutionIgnoreRequires( ResolverProblem_Ptr parent,
- PoolItem item,
- const Capability & capability);
- ProblemSolutionIgnoreRequires( ResolverProblem_Ptr parent,
- PoolItemList itemList,
- const Capability & capability);
- };
-
- class ProblemSolutionIgnoreArchitecture : public ProblemSolution
- {
- public:
-
- /**
- * Constructor.
- **/
- ProblemSolutionIgnoreArchitecture( ResolverProblem_Ptr parent,
- PoolItem item);
- };
-
- class ProblemSolutionIgnoreVendor : public ProblemSolution
- {
- public:
-
- /**
- * Constructor.
- **/
- ProblemSolutionIgnoreVendor( ResolverProblem_Ptr parent,
- PoolItem item);
- };
-
- class ProblemSolutionIgnoreObsoletes : public ProblemSolution
- {
- public:
-
- /**
- * Constructor.
- **/
- ProblemSolutionIgnoreObsoletes( ResolverProblem_Ptr parent,
- PoolItem item,
- const Capability & capability,
- PoolItem otherItem);
- };
-
- class ProblemSolutionIgnoreInstalled : public ProblemSolution
- {
- public:
-
- /**
- * Constructor.
- **/
- ProblemSolutionIgnoreInstalled( ResolverProblem_Ptr parent,
- PoolItem item,
- PoolItem otherItem);
- };
///////////////////////////////////////////////////////////////////
Modified: trunk/libzypp/zypp/solver/detail/Resolver.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Resolver.cc?rev=9759&r1=9758&r2=9759&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/Resolver.cc (original)
+++ trunk/libzypp/zypp/solver/detail/Resolver.cc Mon Apr 21 14:12:09 2008
@@ -139,42 +139,9 @@
}
void
-Resolver::addIgnoreConflict (const PoolItem item,
- const Capability & capability)
+Resolver::addWeak (const PoolItem item)
{
- _ignoreConflicts.insert(make_pair(item, capability));
-}
-
-void
-Resolver::addIgnoreRequires (const PoolItem item,
- const Capability & capability)
-{
- _ignoreRequires.insert(make_pair(item, capability));
-}
-
-void
-Resolver::addIgnoreObsoletes (const PoolItem item,
- const Capability & capability)
-{
- _ignoreObsoletes.insert(make_pair(item, capability));
-}
-
-void
-Resolver::addIgnoreInstalledItem (const PoolItem item)
-{
- _ignoreInstalledItem.push_back (item);
-}
-
-void
-Resolver::addIgnoreArchitectureItem (const PoolItem item)
-{
- _ignoreArchitectureItem.push_back (item);
-}
-
-void
-Resolver::addIgnoreVendorItem (const PoolItem item)
-{
- _ignoreVendorItem.push_back (item);
+ _addWeak.push_back (item);
}
//---------------------------------------------------------------------------
@@ -237,21 +204,8 @@
invokeOnEach ( _pool.begin(), _pool.end(),
resfilter::ByTransact( ), // collect transacts from Pool to resolver queue
functor::functorRef