[zypp-commit] r7065 - in /trunk/libzypp: VERSION.cmake package/libzypp.changes zypp/detail/PatchImplIf.cc zypp/detail/PatchImplIf.h
Author: mlandres Date: Fri Aug 31 19:58:27 2007 New Revision: 7065 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7065&view=rev Log: - On demand translate patch requirements into a list of atoms. Required by the UI to display packages acssociated with a patch. Modified: trunk/libzypp/VERSION.cmake trunk/libzypp/package/libzypp.changes trunk/libzypp/zypp/detail/PatchImplIf.cc trunk/libzypp/zypp/detail/PatchImplIf.h Modified: trunk/libzypp/VERSION.cmake URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/VERSION.cmake?rev=7065&r1=7064&r2=7065&view=diff ============================================================================== --- trunk/libzypp/VERSION.cmake (original) +++ trunk/libzypp/VERSION.cmake Fri Aug 31 19:58:27 2007 @@ -47,4 +47,4 @@ SET(LIBZYPP_MAJOR "3") SET(LIBZYPP_MINOR "21") SET(LIBZYPP_COMPATMINOR "21") -SET(LIBZYPP_PATCH "0") +SET(LIBZYPP_PATCH "1") Modified: trunk/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=7065&r1=7064&r2=7065&view=diff ============================================================================== --- trunk/libzypp/package/libzypp.changes (original) +++ trunk/libzypp/package/libzypp.changes Fri Aug 31 19:58:27 2007 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +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 Modified: trunk/libzypp/zypp/detail/PatchImplIf.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/detail/PatchImplIf.cc?rev=7065&r1=7064&r2=7065&view=diff ============================================================================== --- trunk/libzypp/zypp/detail/PatchImplIf.cc (original) +++ trunk/libzypp/zypp/detail/PatchImplIf.cc Fri Aug 31 19:58:27 2007 @@ -9,8 +9,17 @@ /** \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 { ///////////////////////////////////////////////////////////////// @@ -61,7 +70,43 @@ 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; } ///////////////////////////////////////////////////////////////// Modified: trunk/libzypp/zypp/detail/PatchImplIf.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/detail/PatchImplIf.h?rev=7065&r1=7064&r2=7065&view=diff ============================================================================== --- trunk/libzypp/zypp/detail/PatchImplIf.h (original) +++ trunk/libzypp/zypp/detail/PatchImplIf.h Fri Aug 31 19:58:27 2007 @@ -60,6 +60,9 @@ * \warning Computed here, usually no need to overload this. */ virtual AtomList all_atoms() const PURE_VIRTUAL; + + private: + mutable scoped_ptr<AtomList> _atomlist; }; /////////////////////////////////////////////////////////////////// -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
mlandres@svn.opensuse.org