2 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
5 * Easy-to use interface to the ZYPP dependency resolver
7 * Copyright (C) 2000-2002 Ximian, Inc.
8 * Copyright (C) 2005 SUSE Linux Products GmbH
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License,
12 * version 2, as published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
25 #include "zypp/base/String.h"
26 #include "zypp/base/Gettext.h"
27 #include "zypp/base/Logger.h"
28 #include "zypp/solver/detail/ProblemSolutionIgnore.h"
29 #include "zypp/solver/detail/Helper.h"
33 /////////////////////////////////////////////////////////////////////////
35 { ///////////////////////////////////////////////////////////////////////
36 ///////////////////////////////////////////////////////////////////////
38 { /////////////////////////////////////////////////////////////////////
39 /////////////////////////////////////////////////////////////////////
41 { ///////////////////////////////////////////////////////////////////
43 IMPL_PTR_TYPE(ProblemSolutionIgnoreConflicts);
44 IMPL_PTR_TYPE(ProblemSolutionIgnoreRequires);
45 IMPL_PTR_TYPE(ProblemSolutionIgnoreArchitecture);
46 IMPL_PTR_TYPE(ProblemSolutionIgnoreVendor);
47 IMPL_PTR_TYPE(ProblemSolutionIgnoreInstalled);
49 //---------------------------------------------------------------------------
51 ProblemSolutionIgnoreRequires::ProblemSolutionIgnoreRequires( ResolverProblem_Ptr parent,
53 const Capability & capability)
54 : ProblemSolution (parent, "", "")
56 _description = _("Ignore this requirement just here");
57 addAction ( new InjectSolutionAction (item, capability, REQUIRES));
60 ProblemSolutionIgnoreRequires::ProblemSolutionIgnoreRequires( ResolverProblem_Ptr parent,
61 PoolItemList itemList,
62 const Capability & capability)
63 : ProblemSolution (parent, "", "")
65 _description = _("Generally ignore this requirement");
66 for (PoolItemList::const_iterator iter = itemList.begin();
67 iter != itemList.end(); iter++) {
68 addAction ( new InjectSolutionAction (*iter, capability, REQUIRES));
72 ProblemSolutionIgnoreArchitecture::ProblemSolutionIgnoreArchitecture( ResolverProblem_Ptr parent,
74 : ProblemSolution (parent, "", "")
76 // TranslatorExplanation %s = name of package, patch, selection ...
77 _description = str::form(_("Install %s although it would change the architecture"),
78 item->name().c_str());
79 // TranslatorExplanation %s = name of package, patch, selection ...
80 _details = str::form(_("%s provides this dependency, but would change the architecture of the installed item"),
81 Helper::itemToString (item).c_str());
82 addAction ( new InjectSolutionAction (item, ARCHITECTURE));
85 ProblemSolutionIgnoreVendor::ProblemSolutionIgnoreVendor( ResolverProblem_Ptr parent,
87 : ProblemSolution (parent, "", "")
89 // TranslatorExplanation %s = name of package, patch, selection ...
90 _description = str::form(_("Install %s although it would change the vendor"),
91 item->name().c_str());
92 // TranslatorExplanation %s = name of package, patch, selection ...
93 _details = str::form(_("%s provides this dependency, but would change the vendor of the installed item"),
94 Helper::itemToString (item).c_str());
95 addAction ( new InjectSolutionAction (item, VENDOR));
98 ProblemSolutionIgnoreConflicts::ProblemSolutionIgnoreConflicts( ResolverProblem_Ptr parent,
100 const Capability & capability,
102 : ProblemSolution (parent, "", "")
104 // TranslatorExplanation %s = name of package, patch, selection ...
105 _description = str::form (_("Ignore this conflict of %s"),
106 item->name().c_str());
107 addAction (new InjectSolutionAction (item, capability, CONFLICTS, otherItem));
110 ProblemSolutionIgnoreConflicts::ProblemSolutionIgnoreConflicts( ResolverProblem_Ptr parent,
112 const Capability & capability,
113 PoolItemList itemList)
114 : ProblemSolution (parent, "", "")
116 // TranslatorExplanation %s = name of package, patch, selection ...
117 _description = str::form (_("Ignore this conflict of %s"),
118 item->name().c_str());
119 for (PoolItemList::const_iterator iter = itemList.begin();
120 iter != itemList.end(); iter++) {
121 addAction (new InjectSolutionAction (item, capability, CONFLICTS, *iter));
125 ProblemSolutionIgnoreObsoletes::ProblemSolutionIgnoreObsoletes( ResolverProblem_Ptr parent,
127 const Capability & capability,
129 : ProblemSolution (parent, "", "")
131 // TranslatorExplanation %s = name of package, patch, selection ...
132 _description = str::form (_("Ignore the obsolete %s in %s"),
133 Helper::capToString (capability).c_str(),
134 otherItem->name().c_str());
135 addAction (new InjectSolutionAction (item, capability, OBSOLETES, otherItem));
139 ProblemSolutionIgnoreInstalled::ProblemSolutionIgnoreInstalled( ResolverProblem_Ptr parent,
142 : ProblemSolution (parent, "", "")
144 // TranslatorExplanation %s = name of package, patch, selection ...
145 _description = str::form (_("Ignore that %s is already set to install"),
146 item->name().c_str());
147 addAction (new InjectSolutionAction (item, Capability(), INSTALLED, otherItem));
150 ///////////////////////////////////////////////////////////////////
151 };// namespace detail
152 /////////////////////////////////////////////////////////////////////
153 /////////////////////////////////////////////////////////////////////
154 };// namespace solver
155 ///////////////////////////////////////////////////////////////////////
156 ///////////////////////////////////////////////////////////////////////
158 /////////////////////////////////////////////////////////////////////////