00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ 00002 /* ResolverInfoMissingReq.cc 00003 * 00004 * Copyright (C) 2000-2002 Ximian, Inc. 00005 * Copyright (C) 2005 SUSE Linux Products GmbH 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License, 00009 * version 2, as published by the Free Software Foundation. 00010 * 00011 * This program is distributed in the hope that it will be useful, but 00012 * WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 00019 * 02111-1307, USA. 00020 */ 00021 00022 #include <map> 00023 #include <sstream> 00024 00025 #include "zypp/solver/detail/ResolverInfo.h" 00026 #include "zypp/solver/detail/ResolverInfoMissingReq.h" 00027 #include "zypp/base/String.h" 00028 #include "zypp/base/Gettext.h" 00029 00031 namespace zypp 00032 { 00033 00034 namespace solver 00035 { 00036 00037 namespace detail 00038 { 00039 00040 using namespace std; 00041 00042 IMPL_PTR_TYPE(ResolverInfoMissingReq); 00043 00044 //--------------------------------------------------------------------------- 00045 00046 00047 std::ostream & 00048 ResolverInfoMissingReq::dumpOn( std::ostream & os ) const 00049 { 00050 ResolverInfo::dumpOn (os); 00051 00052 os << message(); 00053 00054 return os; 00055 } 00056 00057 00058 string 00059 ResolverInfoMissingReq::message( ) const 00060 { 00061 string affected_str = ResolverInfo::toString(affected()); 00062 00063 // Translator: 1.%s = name of package,patch,...; 2.%s = dependency 00064 return str::form (_("%s is missing the requirement %s"), 00065 affected_str.c_str(), 00066 _missing.asString().c_str()); 00067 } 00068 00069 //--------------------------------------------------------------------------- 00070 00071 ResolverInfoMissingReq::ResolverInfoMissingReq (PoolItem_Ref item, const Capability & missing) 00072 : ResolverInfo (RESOLVER_INFO_TYPE_MISSING_REQ, item, RESOLVER_INFO_PRIORITY_USER) 00073 , _missing (missing) 00074 { 00075 } 00076 00077 00078 ResolverInfoMissingReq::~ResolverInfoMissingReq () 00079 { 00080 } 00081 00082 //--------------------------------------------------------------------------- 00083 00084 ResolverInfo_Ptr 00085 ResolverInfoMissingReq::copy (void) const 00086 { 00087 ResolverInfoMissingReq_Ptr cpy = new ResolverInfoMissingReq(affected(), _missing); 00088 00089 ((ResolverInfo_Ptr)cpy)->copy (this); 00090 00091 return cpy; 00092 } 00094 };// namespace detail 00097 };// namespace solver 00100 };// namespace zypp 00102 00103