00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "zypp/base/String.h"
00026 #include "zypp/base/Gettext.h"
00027 #include "zypp/base/Logger.h"
00028 #include "zypp/solver/detail/ProblemSolutionIgnore.h"
00029
00030 using namespace std;
00031
00033 namespace zypp
00034 {
00035
00036 namespace solver
00037 {
00038
00039 namespace detail
00040 {
00041
00042 IMPL_PTR_TYPE(ProblemSolutionIgnoreConflicts);
00043 IMPL_PTR_TYPE(ProblemSolutionIgnoreRequires);
00044 IMPL_PTR_TYPE(ProblemSolutionIgnoreArchitecture);
00045 IMPL_PTR_TYPE(ProblemSolutionIgnoreInstalled);
00046
00047
00048
00049 ProblemSolutionIgnoreRequires::ProblemSolutionIgnoreRequires( ResolverProblem_Ptr parent,
00050 PoolItem_Ref item,
00051 const Capability & capability)
00052 : ProblemSolution (parent, "", "")
00053 {
00054 _description = _("Ignore this requirement just here");
00055 addAction ( new InjectSolutionAction (item, capability, REQUIRES));
00056 }
00057
00058 ProblemSolutionIgnoreRequires::ProblemSolutionIgnoreRequires( ResolverProblem_Ptr parent,
00059 PoolItemList itemList,
00060 const Capability & capability)
00061 : ProblemSolution (parent, "", "")
00062 {
00063 _description = _("Ignore this requirement generally");
00064 for (PoolItemList::const_iterator iter = itemList.begin();
00065 iter != itemList.end(); iter++) {
00066 addAction ( new InjectSolutionAction (*iter, capability, REQUIRES));
00067 }
00068 }
00069
00070 ProblemSolutionIgnoreArchitecture::ProblemSolutionIgnoreArchitecture( ResolverProblem_Ptr parent,
00071 PoolItem_Ref item)
00072 : ProblemSolution (parent, "", "")
00073 {
00074
00075 _description = str::form(_("Install %s although it would change the architecture"),
00076 item->name().c_str());
00077
00078 _details = str::form(_("%s provides this dependency but would changed the architecture of the installed item"),
00079 ResolverInfo::toString (item).c_str());
00080 addAction ( new InjectSolutionAction (item, ARCHITECTURE));
00081 }
00082
00083 ProblemSolutionIgnoreConflicts::ProblemSolutionIgnoreConflicts( ResolverProblem_Ptr parent,
00084 PoolItem_Ref item,
00085 const Capability & capability,
00086 PoolItem_Ref otherItem)
00087 : ProblemSolution (parent, "", "")
00088 {
00089
00090 _description = str::form (_("Ignore this conflict of %s"),
00091 item->name().c_str());
00092 addAction (new InjectSolutionAction (item, capability, CONFLICTS, otherItem));
00093 }
00094
00095 ProblemSolutionIgnoreConflicts::ProblemSolutionIgnoreConflicts( ResolverProblem_Ptr parent,
00096 PoolItem_Ref item,
00097 const Capability & capability,
00098 PoolItemList itemList)
00099 : ProblemSolution (parent, "", "")
00100 {
00101
00102 _description = str::form (_("Ignore this conflict of %s"),
00103 item->name().c_str());
00104 for (PoolItemList::const_iterator iter = itemList.begin();
00105 iter != itemList.end(); iter++) {
00106 addAction (new InjectSolutionAction (item, capability, CONFLICTS, *iter));
00107 }
00108 }
00109
00110 ProblemSolutionIgnoreObsoletes::ProblemSolutionIgnoreObsoletes( ResolverProblem_Ptr parent,
00111 PoolItem_Ref item,
00112 const Capability & capability,
00113 PoolItem_Ref otherItem)
00114 : ProblemSolution (parent, "", "")
00115 {
00116
00117 _description = str::form (_("Ignore the obsolete %s in %s"),
00118 ResolverInfo::toString (capability).c_str(),
00119 otherItem->name().c_str());
00120 addAction (new InjectSolutionAction (item, capability, OBSOLETES, otherItem));
00121 }
00122
00123
00124 ProblemSolutionIgnoreInstalled::ProblemSolutionIgnoreInstalled( ResolverProblem_Ptr parent,
00125 PoolItem_Ref item,
00126 PoolItem_Ref otherItem)
00127 : ProblemSolution (parent, "", "")
00128 {
00129
00130 _description = str::form (_("Ignore that %s is already set to install"),
00131 item->name().c_str());
00132 addAction (new InjectSolutionAction (item, Capability(), INSTALLED, otherItem));
00133 }
00134
00136 };
00139 };
00142 };