1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/Patch.cc
12 #include "zypp/Patch.h"
14 ///////////////////////////////////////////////////////////////////
16 { /////////////////////////////////////////////////////////////////
18 IMPL_PTR_TYPE( Patch );
20 ///////////////////////////////////////////////////////////////////
22 // METHOD NAME : Patch::Patch
25 Patch::Patch( const sat::Solvable & solvable_r )
26 : ResObject( solvable_r )
29 ///////////////////////////////////////////////////////////////////
31 // METHOD NAME : Patch::~Patch
37 ///////////////////////////////////////////////////////////////////
39 // Patch interface forwarded to implementation
41 ///////////////////////////////////////////////////////////////////
43 std::string Patch::id() const
44 { return std::string(); }
46 Date Patch::timestamp() const
49 std::string Patch::category() const
50 { return std::string(); }
52 bool Patch::reboot_needed() const
55 bool Patch::affects_pkg_manager() const
58 #warning Implement PATCH::ATOMS
60 Patch::AtomList Patch::atoms() const
66 // We are not jet connected to the Resolvable that
67 // contains our dependencies.
72 _atomlist.reset( new AtomList );
74 // Build the list using the repositories resolvables.
75 // Installed Patches (no repository) have this method overloaded.
78 const CapSet & requires( self()->dep( Dep::REQUIRES ) );
79 const ResStore & store( repository().resolvables() );
81 for_( req, requires.begin(), requires.end() )
83 // lookup Patch requirements that refer to an Atom, Script or Message.
84 if ( refersTo<Atom>( *req ) || refersTo<Script>( *req ) || refersTo<Message>( *req ) )
86 for_( res, store.begin(), store.end() )
88 // Collect ALL matches in the store.
89 if ( hasMatches( (*res)->dep( Dep::PROVIDES ), (*req) ) )
91 _atomlist->push_back( *res );
103 bool Patch::interactive() const
105 #warning Implement PATCH::INTERACTIVE
108 || ! licenseToConfirm().empty() )
113 AtomList atoms = all_atoms();
114 for ( AtomList::const_iterator it = atoms.begin(); it != atoms.end(); it++)
116 if ( isKind<Message>( *it )
117 || ! licenseToConfirm().empty() )
128 /////////////////////////////////////////////////////////////////
130 ///////////////////////////////////////////////////////////////////