ProblemSolutionIgnore.cc

Go to the documentation of this file.
00001 
00002 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00003 /* ProblemSolution.cc
00004  *
00005  * Easy-to use interface to the ZYPP dependency resolver
00006  *
00007  * Copyright (C) 2000-2002 Ximian, Inc.
00008  * Copyright (C) 2005 SUSE Linux Products GmbH
00009  *
00010  * This program is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU General Public License,
00012  * version 2, as published by the Free Software Foundation.
00013  *
00014  * This program is distributed in the hope that it will be useful, but
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00022  * 02111-1307, USA.
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         // TranslatorExplanation %s = name of package, patch, selection ...
00075         _description = str::form(_("Install %s although it would change the architecture"),
00076                                  item->name().c_str());
00077         // TranslatorExplanation %s = name of package, patch, selection ...     
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         // TranslatorExplanation %s = name of package, patch, selection ...
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         // TranslatorExplanation %s = name of package, patch, selection ...
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         // TranslatorExplanation %s = name of package, patch, selection ...
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         // TranslatorExplanation %s = name of package, patch, selection ...
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     };// namespace detail
00139   };// namespace solver
00142 };// namespace zypp

Generated on Thu Jul 6 00:07:23 2006 for zypp by  doxygen 1.4.6