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(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         // TranslatorExplanation %s = name of package, patch, selection ...
00076         _description = str::form(_("Install %s although it would change the architecture"),
00077                                  item->name().c_str());
00078         // TranslatorExplanation %s = name of package, patch, selection ...     
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         // TranslatorExplanation %s = name of package, patch, selection ...
00089         _description = str::form(_("Install %s although it would change the vendor"),
00090                                  item->name().c_str());
00091         // TranslatorExplanation %s = name of package, patch, selection ...     
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         // TranslatorExplanation %s = name of package, patch, selection ...
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         // TranslatorExplanation %s = name of package, patch, selection ...
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         // TranslatorExplanation %s = name of package, patch, selection ...
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         // TranslatorExplanation %s = name of package, patch, selection ...
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     };// namespace detail
00153   };// namespace solver
00156 };// namespace zypp

Generated on Tue Sep 25 19:23:07 2007 for libzypp by  doxygen 1.5.3