Author: dmacvicar Date: Wed May 21 19:02:01 2008 New Revision: 10177 URL: http://svn.opensuse.org/viewcvs/zypp?rev=10177&view=rev Log: deprecate Repository::name() and use alias() to be consistent. Related to (bnc#383553) Modified: trunk/libzypp/VERSION.cmake trunk/libzypp/package/libzypp.changes trunk/libzypp/zypp/Repository.cc trunk/libzypp/zypp/Repository.h trunk/libzypp/zypp/sat/Pool.cc trunk/libzypp/zypp/sat/Pool.h trunk/libzypp/zypp/sat/Solvable.cc trunk/libzypp/zypp/sat/detail/PoolImpl.cc Modified: trunk/libzypp/VERSION.cmake URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/VERSION.cmake?rev=10177&r1=10176&r2=10177&view=diff ============================================================================== --- trunk/libzypp/VERSION.cmake (original) +++ trunk/libzypp/VERSION.cmake Wed May 21 19:02:01 2008 @@ -45,6 +45,6 @@ # SET(LIBZYPP_MAJOR "4") -SET(LIBZYPP_MINOR "24") +SET(LIBZYPP_MINOR "25") SET(LIBZYPP_COMPATMINOR "24") SET(LIBZYPP_PATCH "0") Modified: trunk/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=10177&r1=10176&r2=10177&view=diff ============================================================================== --- trunk/libzypp/package/libzypp.changes (original) +++ trunk/libzypp/package/libzypp.changes Wed May 21 19:02:01 2008 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed May 21 13:50:00 CEST 2008 - dmacvicar@suse.de + +- deprecate Repository::name() and use alias() to + be consistent. Related to (bnc#383553) +- 4.25.0 + +------------------------------------------------------------------- Wed May 21 11:37:23 CEST 2008 - schubi@suse.de - added onlyRequires in the testcase (bnc #389184) Modified: trunk/libzypp/zypp/Repository.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Repository.cc?rev=10177&r1=10176&r2=10177&view=diff ============================================================================== --- trunk/libzypp/zypp/Repository.cc (original) +++ trunk/libzypp/zypp/Repository.cc Wed May 21 19:02:01 2008 @@ -50,7 +50,7 @@ return( sat::Pool::systemRepoName() == _repo->name ); } - std::string Repository::name() const + std::string Repository::alias() const { NO_REPOSITORY_RETURN( std::string() ); if ( ! _repo->name ) @@ -99,10 +99,10 @@ void Repository::setInfo( const RepoInfo & info_r ) { NO_REPOSITORY_THROW( Exception( "Can't set RepoInfo for norepo." ) ); - if ( info_r.alias() != name() ) + if ( info_r.alias() != alias() ) { - ZYPP_THROW( Exception( str::form( "RepoInfo alias (%s) does not match repository name (%s)", - info_r.alias().c_str(), name().c_str() ) ) ); + ZYPP_THROW( Exception( str::form( "RepoInfo alias (%s) does not match repository alias (%s)", + info_r.alias().c_str(), alias().c_str() ) ) ); } myPool().setRepoInfo( _repo, info_r ); @@ -173,7 +173,7 @@ if ( ! obj ) return str << "noRepository"; - return str << "sat::repo(" << obj.name() << ")" + return str << "sat::repo(" << obj.alias() << ")" << "{" << "prio " << obj.get()->priority << ", size " << obj.solvablesSize() Modified: trunk/libzypp/zypp/Repository.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Repository.h?rev=10177&r1=10176&r2=10177&view=diff ============================================================================== --- trunk/libzypp/zypp/Repository.h (original) +++ trunk/libzypp/zypp/Repository.h Wed May 21 19:02:01 2008 @@ -56,10 +56,33 @@ bool isSystemRepo() const; public: - /** The repos name (alias). - * \todo FIXME why is this not called alias if it <b>is</b> alias? - */ - std::string name() const; + /** + * Short unique, convenience string to refer to a repo. + * ie: openSUSE-10.3 + * + * If you are looking for a label to display + * see \ref info() which provides \ref RepoInfo::name() + * ie: "openSUSE 10.3 Main repository" + * + */ + std::string alias() const; + + /** + * Short unique, convenience string to refer to a repo. + * ie: openSUSE-10.3 + * + * The sat solver uses name for what we know as alias + * In rpm repositories, name is a label string + * ie: "openSUSE 10.3 Main repository" + * + * We know follow rpm conventions and ignore satsolver + * wording for name. + * + * Use \ref alias() instead + */ + ZYPP_DEPRECATED std::string name() const + { return alias(); } + /** Whether \ref Repository contains solvables. */ bool solvablesEmpty() const; Modified: trunk/libzypp/zypp/sat/Pool.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Pool.cc?rev=10177&r1=10176&r2=10177&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/Pool.cc (original) +++ trunk/libzypp/zypp/sat/Pool.cc Wed May 21 19:02:01 2008 @@ -35,7 +35,7 @@ namespace sat { ///////////////////////////////////////////////////////////////// - const std::string & Pool::systemRepoName() + const std::string & Pool::systemRepoAlias() { static const std::string _val( "@System" ); return _val; @@ -97,40 +97,40 @@ Pool::SolvableIterator Pool::solvablesEnd() const { return SolvableIterator(); } - Repository Pool::reposInsert( const std::string & name_r ) + Repository Pool::reposInsert( const std::string & alias_r ) { - Repository ret( reposFind( name_r ) ); + Repository ret( reposFind( alias_r ) ); if ( ret ) return ret; - ret = Repository( myPool()._createRepo( name_r ) ); - if ( name_r == systemRepoName() ) + ret = Repository( myPool()._createRepo( alias_r ) ); + if ( alias_r == systemRepoAlias() ) { // autoprovide (dummy) RepoInfo ret.setInfo( RepoInfo() - .setAlias( name_r ) - .setName( name_r ) + .setAlias( alias_r ) + .setName( alias_r ) .setAutorefresh( true ) .setEnabled( true ) ); } return ret; } - Repository Pool::reposFind( const std::string & name_r ) const + Repository Pool::reposFind( const std::string & alias_r ) const { for_( it, reposBegin(), reposEnd() ) { - if ( name_r == it->name() ) + if ( alias_r == it->alias() ) return *it; } return Repository(); } - Repository Pool::addRepoSolv( const Pathname & file_r, const std::string & name_r ) + Repository Pool::addRepoSolv( const Pathname & file_r, const std::string & alias_r ) { // Using a temporay repo! (The additional parenthesis are required.) AutoDispose<Repository> tmprepo( (Repository::EraseFromPool()) ); - *tmprepo = reposInsert( name_r ); + *tmprepo = reposInsert( alias_r ); tmprepo->addSolv( file_r ); // no exceptions so we keep it: Modified: trunk/libzypp/zypp/sat/Pool.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Pool.h?rev=10177&r1=10176&r2=10177&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/Pool.h (original) +++ trunk/libzypp/zypp/sat/Pool.h Wed May 21 19:02:01 2008 @@ -78,34 +78,39 @@ /** Iterator behind the last \ref Repository. */ RepositoryIterator reposEnd() const; - /** Return a \ref Repository named \c name_r. + /** Return a \ref Repository named \c alias_r. * It a such a \ref Repository does not already exist * a new empty \ref Repository is created. */ - Repository reposInsert( const std::string & name_r ); + Repository reposInsert( const std::string & alias_r ); - /** Find a \ref Repository named \c name_r. + /** Find a \ref Repository named \c alias_r. * Returns \ref norepository if there is no such \ref Repository. */ - Repository reposFind( const std::string & name_r ) const; + Repository reposFind( const std::string & alias_r ) const; - /** Remove a \ref Repository named \c name_r. + /** Remove a \ref Repository named \c alias_r. * \see \ref Repository::eraseFromPool */ - void reposErase( const std::string & name_r ) - { reposFind( name_r ).eraseFromPool(); } + void reposErase( const std::string & alias_r ) + { reposFind( alias_r ).eraseFromPool(); } public: - /** Reserved system repository name \c @System. */ - static const std::string & systemRepoName(); + /** Reserved system repository alias \c @System. */ + static const std::string & systemRepoAlias(); + + /** Deprecated, use \ref systemRepoAlias() */ + ZYPP_DEPRECATED static const std::string & systemRepoName() + { return systemRepoAlias(); } + /** Return the system repository if it is on the pool. */ Repository findSystemRepo() const - { return reposFind( systemRepoName() ); } + { return reposFind( systemRepoAlias() ); } /** Return the system repository, create it if missing. */ Repository systemRepo() - { return reposInsert( systemRepoName() ); } + { return reposInsert( systemRepoAlias() ); } public: /** Load \ref Solvables from a solv-file into a \ref Repository named \c name_r. Modified: trunk/libzypp/zypp/sat/Solvable.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Solvable.cc?rev=10177&r1=10176&r2=10177&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/Solvable.cc (original) +++ trunk/libzypp/zypp/sat/Solvable.cc Wed May 21 19:02:01 2008 @@ -525,7 +525,7 @@ return str << "(" << obj.id() << ")" << ( obj.isKind( ResKind::srcpackage ) ? "srcpackage:" : "" ) << obj.ident() << '-' << obj.edition() << '.' << obj.arch() << "(" - << obj.repository().name() << ")"; + << obj.repository().alias() << ")"; } /****************************************************************** Modified: trunk/libzypp/zypp/sat/detail/PoolImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/detail/PoolImpl.cc?rev=10177&r1=10176&r2=10177&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/detail/PoolImpl.cc (original) +++ trunk/libzypp/zypp/sat/detail/PoolImpl.cc Wed May 21 19:02:01 2008 @@ -208,7 +208,7 @@ MIL << "pool_createwhatprovides..." << endl; // NOTE: Thake care not to ctreate a nonexisting systemRepo - Repository sysrepo( sat::Pool::instance().reposFind( sat::Pool::instance().systemRepoName() ) ); + Repository sysrepo( sat::Pool::instance().reposFind( sat::Pool::instance().systemRepoAlias() ) ); if ( sysrepo ) { ::pool_addfileprovides( _pool, sysrepo.get() ); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org