Author: mlandres Date: Wed Aug 13 15:13:59 2008 New Revision: 10835 URL: http://svn.opensuse.org/viewcvs/zypp?rev=10835&view=rev Log: - Add ResPool::reposFind to get repositories by alias. Modified: trunk/libzypp/VERSION.cmake trunk/libzypp/devel/devel.ma/NewPool.cc trunk/libzypp/package/libzypp.changes trunk/libzypp/zypp/ResPool.cc trunk/libzypp/zypp/ResPool.h trunk/libzypp/zypp/pool/PoolImpl.h Modified: trunk/libzypp/VERSION.cmake URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/VERSION.cmake?rev=10835&r1=10834&r2=10835&view=diff ============================================================================== --- trunk/libzypp/VERSION.cmake (original) +++ trunk/libzypp/VERSION.cmake Wed Aug 13 15:13:59 2008 @@ -61,7 +61,7 @@ SET(LIBZYPP_MAJOR "5") SET(LIBZYPP_COMPATMINOR "4") SET(LIBZYPP_MINOR "4") -SET(LIBZYPP_PATCH "0") +SET(LIBZYPP_PATCH "1") # # LAST RELEASED: 5.4.0 (4) # (The number in parenthesis is LIBZYPP_COMPATMINOR) Modified: trunk/libzypp/devel/devel.ma/NewPool.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/NewPool.cc?rev=10835&r1=10834&r2=10835&view=diff ============================================================================== --- trunk/libzypp/devel/devel.ma/NewPool.cc (original) +++ trunk/libzypp/devel/devel.ma/NewPool.cc Wed Aug 13 15:13:59 2008 @@ -523,6 +523,38 @@ /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// + // ResPool pool( ResPool::instance() ); + + // Iterate all repositories loaded to the pool + for_( it, pool.knownRepositoriesBegin(), pool.knownRepositoriesEnd() ) + { + MIL << *it << endl; + } + + // some specific repo + Repository myRepo( *pool.knownRepositoriesBegin() ); + + // Iterate all packages named "amarok" (from all repos) + for_( it, pool.byIdentBegin( ResKind::package, "amarok" ), pool.byIdentEnd( ResKind::package, "amarok" ) ) + { + MIL << "Check: " << *it << endl; + if ( (*it)->repository() == myRepo ) + { + MIL << " Found: " << (*it)->name() << endl; + MIL << " Version: " << (*it)->edition() << endl; + MIL << " Repository: " << (*it)->repository() << endl; + } + + } + + + + /////////////////////////////////////////////////////////////////// + INT << "===[END]============================================" << endl << endl; + zypp::base::LogControl::instance().logNothing(); + return 0; + + ui::Selectable::Ptr item( ui::Selectable::get( "amarok" ) ); item->setUpToDate(); SEC << dump(item) << endl; Modified: trunk/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=10835&r1=10834&r2=10835&view=diff ============================================================================== --- trunk/libzypp/package/libzypp.changes (original) +++ trunk/libzypp/package/libzypp.changes Wed Aug 13 15:13:59 2008 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Wed Aug 13 15:12:45 CEST 2008 - ma@suse.de + +- Add ResPool::reposFind to get repositories by alias. +- revision 10835 + +------------------------------------------------------------------- Tue Aug 12 19:37:36 CEST 2008 - ma@suse.de - Advise rpmdb2solv to parse the product database. Modified: trunk/libzypp/zypp/ResPool.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResPool.cc?rev=10835&r1=10834&r2=10835&view=diff ============================================================================== --- trunk/libzypp/zypp/ResPool.cc (original) +++ trunk/libzypp/zypp/ResPool.cc Wed Aug 13 15:13:59 2008 @@ -76,6 +76,8 @@ ResPool::repository_iterator ResPool::knownRepositoriesEnd() const { return _pimpl->knownRepositoriesEnd(); } + Repository ResPool::reposFind( const std::string & alias_r ) const + { return _pimpl->reposFind( alias_r ); } bool ResPool::autoSoftLocksEmpty() const { return _pimpl->autoSoftLocks().empty(); } Modified: trunk/libzypp/zypp/ResPool.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResPool.h?rev=10835&r1=10834&r2=10835&view=diff ============================================================================== --- trunk/libzypp/zypp/ResPool.h (original) +++ trunk/libzypp/zypp/ResPool.h Wed Aug 13 15:13:59 2008 @@ -224,6 +224,11 @@ repository_iterator knownRepositoriesBegin() const; repository_iterator knownRepositoriesEnd() const; + + /** Find a \ref Repository named \c alias_r. + * Returns \ref Repository::norepository if there is no such \ref Repository. + */ + Repository reposFind( const std::string & alias_r ) const; //@} public: Modified: trunk/libzypp/zypp/pool/PoolImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/pool/PoolImpl.h?rev=10835&r1=10834&r2=10835&view=diff ============================================================================== --- trunk/libzypp/zypp/pool/PoolImpl.h (original) +++ trunk/libzypp/zypp/pool/PoolImpl.h Wed Aug 13 15:13:59 2008 @@ -208,6 +208,9 @@ repository_iterator knownRepositoriesEnd() const { checkSerial(); return satpool().reposEnd(); } + Repository reposFind( const std::string & alias_r ) const + { checkSerial(); return satpool().reposFind( alias_r ); } + /////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////// -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org