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(ProblemSolutionIgnoreVendor);
00046 IMPL_PTR_TYPE(ProblemSolutionIgnoreInstalled);
00047
00048
00049
00050 ProblemSolutionIgnoreRequires::ProblemSolutionIgnoreRequires( ResolverProblem_Ptr parent,
00051 PoolItem_Ref item,
00052 const Capability & capability)
00053 : ProblemSolution (parent, "", "")
00054 {
00055 _description = _("Ignore this requirement just here");
00056 addAction ( new InjectSolutionAction (item, capability, REQUIRES));
00057 }
00058
00059 ProblemSolutionIgnoreRequires::ProblemSolutionIgnoreRequires( ResolverProblem_Ptr parent,
00060 PoolItemList itemList,
00061 const Capability & capability)
00062 : ProblemSolution (parent, "", "")
00063 {
00064 _description = _("Generally ignore this requirement");
00065 for (PoolItemList::const_iterator iter = itemList.begin();
00066 iter != itemList.end(); iter++) {
00067 addAction ( new InjectSolutionAction (*iter, capability, REQUIRES));
00068 }
00069 }
00070
00071 ProblemSolutionIgnoreArchitecture::ProblemSolutionIgnoreArchitecture( ResolverProblem_Ptr parent,
00072 PoolItem_Ref item)
00073 : ProblemSolution (parent, "", "")
00074 {
00075
00076 _description = str::form(_("Install %s although it would change the architecture"),
00077 item->name().c_str());
00078
00079 _details = str::form(_("%s provides this dependency, but would change the architecture of the installed item"),
00080 ResolverInfo::toString (item).c_str());
00081 addAction ( new InjectSolutionAction (item, ARCHITECTURE));
00082 }
00083
00084 ProblemSolutionIgnoreVendor::ProblemSolutionIgnoreVendor( ResolverProblem_Ptr parent,
00085 PoolItem_Ref item)
00086 : ProblemSolution (parent, "", "")
00087 {
00088
00089 _description = str::form(_("Install %s although it would change the vendor"),
00090 item->name().c_str());
00091
00092 _details = str::form(_("%s provides this dependency, but would change the vendor of the installed item"),
00093 ResolverInfo::toString (item).c_str());
00094 addAction ( new InjectSolutionAction (item, VENDOR));
00095 }
00096
00097 ProblemSolutionIgnoreConflicts::ProblemSolutionIgnoreConflicts( ResolverProblem_Ptr parent,
00098 PoolItem_Ref item,
00099 const Capability & capability,
00100 PoolItem_Ref otherItem)
00101 : ProblemSolution (parent, "", "")
00102 {
00103
00104 _description = str::form (_("Ignore this conflict of %s"),
00105 item->name().c_str());
00106 addAction (new InjectSolutionAction (item, capability, CONFLICTS, otherItem));
00107 }
00108
00109 ProblemSolutionIgnoreConflicts::ProblemSolutionIgnoreConflicts( ResolverProblem_Ptr parent,
00110 PoolItem_Ref item,
00111 const Capability & capability,
00112 PoolItemList itemList)
00113 : ProblemSolution (parent, "", "")
00114 {
00115
00116 _description = str::form (_("Ignore this conflict of %s"),
00117 item->name().c_str());
00118 for (PoolItemList::const_iterator iter = itemList.begin();
00119 iter != itemList.end(); iter++) {
00120 addAction (new InjectSolutionAction (item, capability, CONFLICTS, *iter));
00121 }
00122 }
00123
00124 ProblemSolutionIgnoreObsoletes::ProblemSolutionIgnoreObsoletes( ResolverProblem_Ptr parent,
00125 PoolItem_Ref item,
00126 const Capability & capability,
00127 PoolItem_Ref otherItem)
00128 : ProblemSolution (parent, "", "")
00129 {
00130
00131 _description = str::form (_("Ignore the obsolete %s in %s"),
00132 ResolverInfo::toString (capability).c_str(),
00133 otherItem->name().c_str());
00134 addAction (new InjectSolutionAction (item, capability, OBSOLETES, otherItem));
00135 }
00136
00137
00138 ProblemSolutionIgnoreInstalled::ProblemSolutionIgnoreInstalled( ResolverProblem_Ptr parent,
00139 PoolItem_Ref item,
00140 PoolItem_Ref otherItem)
00141 : ProblemSolution (parent, "", "")
00142 {
00143
00144 _description = str::form (_("Ignore that %s is already set to install"),
00145 item->name().c_str());
00146 addAction (new InjectSolutionAction (item, Capability(), INSTALLED, otherItem));
00147 }
00148
00150 };
00153 };
00156 };