#
SET(LIBZYPP_MAJOR "4")
-SET(LIBZYPP_MINOR "24")
+SET(LIBZYPP_MINOR "25")
SET(LIBZYPP_COMPATMINOR "24")
SET(LIBZYPP_PATCH "0")
-------------------------------------------------------------------
+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)
return( sat::Pool::systemRepoName() == _repo->name );
}
- std::string Repository::name() const
+ std::string Repository::alias() const
{
NO_REPOSITORY_RETURN( std::string() );
if ( ! _repo->name )
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 );
if ( ! obj )
return str << "noRepository";
- return str << "sat::repo(" << obj.name() << ")"
+ return str << "sat::repo(" << obj.alias() << ")"
<< "{"
<< "prio " << obj.get()->priority
<< ", size " << obj.solvablesSize()
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;
namespace sat
{ /////////////////////////////////////////////////////////////////
- const std::string & Pool::systemRepoName()
+ const std::string & Pool::systemRepoAlias()
{
static const std::string _val( "@System" );
return _val;
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:
/** 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.
return str << "(" << obj.id() << ")"
<< ( obj.isKind( ResKind::srcpackage ) ? "srcpackage:" : "" ) << obj.ident()
<< '-' << obj.edition() << '.' << obj.arch() << "("
- << obj.repository().name() << ")";
+ << obj.repository().alias() << ")";
}
/******************************************************************
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() );