-------------------------------------------------------------------
+Fri Aug 31 19:56:40 CEST 2007 - ma@suse.de
+
+- On demand translate patch requirements into a list of atoms.
+ Required by the UI to display packages acssociated with a patch.
+ (#300612)
+- version 3.21.1
+
+-------------------------------------------------------------------
Fri Aug 31 13:59:54 CEST 2007 - kkaempf@suse.de
- enrich ResolverInfo with the reason if a user-initiated request
/** \file zypp/detail/PatchImplIf.cc
*
*/
+#include <iostream>
+
+#include "zypp/base/Easy.h"
+#include "zypp/base/Logger.h"
+#include "zypp/ResStore.h"
+#include "zypp/CapMatchHelper.h"
+
#include "zypp/detail/PatchImplIf.h"
+using std::endl;
+
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
PatchImplIf::AtomList PatchImplIf::all_atoms() const
{
- return AtomList();
+ if ( ! _atomlist )
+ {
+ if ( ! hasBackRef() )
+ {
+ // We are not jet connected to the Resolvable that
+ // contains our dependencies.
+ return AtomList();
+ }
+
+ // lazy init
+ _atomlist.reset( new AtomList );
+
+ // Build the list using the repositories resolvables.
+ // Installed Patches (no repository) have this method overloaded.
+ if ( repository() )
+ {
+ const CapSet & requires( self()->dep( Dep::REQUIRES ) );
+ const ResStore & store( repository().resolvables() );
+
+ for_( req, requires.begin(), requires.end() )
+ {
+ // lookup Patch requirements that refer to an Atom, Script or Message.
+ if ( refersTo<Atom>( *req ) || refersTo<Script>( *req ) || refersTo<Message>( *req ) )
+ {
+ for_( res, store.begin(), store.end() )
+ {
+ // Collect ALL matches in the store.
+ if ( hasMatches( (*res)->dep( Dep::PROVIDES ), (*req) ) )
+ {
+ _atomlist->push_back( *res );
+ }
+ }
+ }
+ }
+ }
+ }
+ return *_atomlist;
}
/////////////////////////////////////////////////////////////////