00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #include <iostream> 00013 00014 #include "zypp/detail/SelectionImplIf.h" 00015 #include "zypp/ResTraits.h" 00016 00017 using namespace std; 00018 00020 namespace zypp 00021 { 00022 00023 namespace detail 00024 { 00025 00027 // Default implementation of SelectionImplIf attributes, 00028 // as far as resonable. 00030 00031 Label SelectionImplIf::category() const 00032 { return Label(); } 00033 00034 bool SelectionImplIf::visible() const 00035 { return false; } 00036 00037 Label SelectionImplIf::order() const 00038 { return Label(); } 00039 00040 static void copycaps( std::set<std::string> & out, const CapSet & in) 00041 { 00042 for (CapSet::const_iterator it = in.begin(); it != in.end(); ++it) { 00043 if (isKind<capability::NamedCap>( *it ) 00044 && it->refers() == ResTraits<zypp::Package>::kind ) 00045 { 00046 out.insert( it->index() ); 00047 } 00048 } 00049 } 00050 00051 const std::set<std::string> SelectionImplIf::install_packages( const Locale & lang) const 00052 { 00053 std::set<std::string> result; 00054 copycaps( result, self()->dep( Dep::REQUIRES ) ); 00055 copycaps( result, self()->dep( Dep::RECOMMENDS) ); 00056 00057 return result; 00058 } 00059 00061 } // namespace detail 00064 } // namespace zypp
1.5.3