continue;
repoManager.refreshService( nservice );
-
}
}
}
}
- SEC << endl;
- for_( it, pool.knownRepositoriesBegin(), pool.knownRepositoriesEnd() )
- {
- USR << *it << endl;
- it->info().hasLicense();
- }
-
- SEC << endl;
- RepoManager repoManager( makeRepoManager( sysRoot ) );
- RepoInfoList repos = repoManager.knownRepositories();
- for_( it, repos.begin(), repos.end() )
- {
- USR << *it << endl;
- it->hasLicense();
- WAR << it->getLicense( Locale("de_De") ) << endl;
- }
#if 0
getZYpp()->resolver()->addRequire( Capability("amarok") );
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////
const Repository Repository::noRepository;
+ const std::string & Repository::systemRepoAlias()
+ { return sat::detail::PoolImpl::systemRepoAlias(); }
+
/////////////////////////////////////////////////////////////////
::_Repo * Repository::get() const
bool Repository::isSystemRepo() const
{
NO_REPOSITORY_RETURN( false );
- return( sat::Pool::systemRepoAlias() == _repo->name );
+ return myPool().isSystemRepo( _repo );
}
std::string Repository::alias() const
void Repository::eraseFromPool()
{
NO_REPOSITORY_RETURN();
+ MIL << *this << " removed from pool" << endl;
myPool()._deleteRepo( _repo );
_id = sat::detail::noRepoId;
}
return noRepository;
}
-#warning NEED POOL MANIP EXEPTIONS
void Repository::addSolv( const Pathname & file_r )
{
- NO_REPOSITORY_THROW( Exception( "Can't add solvables to norepo." ) );
+ NO_REPOSITORY_THROW( Exception( "Can't add solvables to norepo." ) );
- AutoDispose<FILE*> file( ::fopen( file_r.c_str(), "r" ), ::fclose );
- if ( file == NULL )
- {
- file.resetDispose();
- ZYPP_THROW( Exception( "Can't open solv-file: "+file_r.asString() ));
- }
+ AutoDispose<FILE*> file( ::fopen( file_r.c_str(), "r" ), ::fclose );
+ if ( file == NULL )
+ {
+ file.resetDispose();
+ ZYPP_THROW( Exception( "Can't open solv-file: "+file_r.asString() ) );
+ }
- if ( myPool()._addSolv( _repo, file, isSystemRepo() ) != 0 )
- {
- ZYPP_THROW( Exception( "Error reading solv-file: "+file_r.asString() ));
- }
+ if ( myPool()._addSolv( _repo, file ) != 0 )
+ {
+ ZYPP_THROW( Exception( "Error reading solv-file: "+file_r.asString() ) );
+ }
+
+ MIL << *this << " after adding " << file_r << endl;
}
sat::detail::SolvableIdType Repository::addSolvables( unsigned count_r )
/** Evaluate \ref Repository in a boolean context (\c != \c noRepository). */
using base::SafeBool<Repository>::operator bool_type;
#endif
+ /** Reserved system repository alias \c @System. */
+ static const std::string & systemRepoAlias();
+
/** Return whether this is the system repository. */
bool isSystemRepo() const;
*/
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(); }
-
/**
* Timestamp when this repository was generated
*
{ /////////////////////////////////////////////////////////////////
const std::string & Pool::systemRepoAlias()
- {
- static const std::string _val( "@System" );
- return _val;
- }
+ { return detail::PoolImpl::systemRepoAlias(); }
::_Pool * Pool::get() const
{ return myPool().getPool(); }
return ret;
ret = Repository( myPool()._createRepo( alias_r ) );
- if ( alias_r == systemRepoAlias() )
+ if ( ret.isSystemRepo() )
{
// autoprovide (dummy) RepoInfo
RepoInfo info;
info.setAutorefresh( true );
info.setEnabled( true );
ret.setInfo( info );
- // indicate
- ::pool_set_installed( get(), ret.get() );
}
return ret;
}
/** 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( systemRepoAlias() ); }
bool Solvable::isSystem() const
{
NO_SOLVABLE_RETURN( _id == detail::systemSolvableId );
- return Repository( _solvable->repo ).isSystemRepo();
+ return myPool().isSystemRepo( _solvable->repo );
}
IdString Solvable::ident() const
/////////////////////////////////////////////////////////////////
+ const std::string & PoolImpl::systemRepoAlias()
+ {
+ static const std::string _val( "@System" );
+ return _val;
+ }
+
+ /////////////////////////////////////////////////////////////////
+
static void logSat( struct _Pool *, void *data, int type, const char *logString )
{
if ((type & (SAT_FATAL|SAT_ERROR))) {
///////////////////////////////////////////////////////////////////
- int PoolImpl::_addSolv( ::_Repo * repo_r, FILE * file_r, bool isSystemRepo_r )
+ ::_Repo * PoolImpl::_createRepo( const std::string & name_r )
+ {
+ setDirty(__FUNCTION__, name_r.c_str() );
+ ::_Repo * ret = ::repo_create( _pool, name_r.c_str() );
+ if ( ret && name_r == systemRepoAlias() )
+ ::pool_set_installed( _pool, ret );
+ return ret;
+ }
+
+ void PoolImpl::_deleteRepo( ::_Repo * repo_r )
+ {
+ setDirty(__FUNCTION__, repo_r->name );
+ ::repo_free( repo_r, /*reuseids*/false );
+ eraseRepoInfo( repo_r );
+ }
+
+ int PoolImpl::_addSolv( ::_Repo * repo_r, FILE * file_r )
{
setDirty(__FUNCTION__, repo_r->name );
int ret = ::repo_add_solv( repo_r , file_r );
- if ( ret == 0 && ! isSystemRepo_r )
+ if ( ret == 0 && ! isSystemRepo( repo_r ) )
{
// Filter out unwanted archs
std::set<detail::IdType> sysids;
return ret;
}
+ detail::SolvableIdType PoolImpl::_addSolvables( ::_Repo * repo_r, unsigned count_r )
+ {
+ setDirty(__FUNCTION__, repo_r->name );
+ return ::repo_add_solvable_block( repo_r, count_r );
+ }
+
///////////////////////////////////////////////////////////////////
// need on demand and id based Locale
static detail::IdType nsCallback( ::_Pool *, void * data, detail::IdType lhs, detail::IdType rhs );
public:
+ /** Reserved system repository alias \c @System. */
+ static const std::string & systemRepoAlias();
+
+ bool isSystemRepo( ::_Repo * repo_r ) const
+ { return repo_r && _pool->installed == repo_r; }
+
+ public:
/** \name Actions invalidating housekeeping data.
*
* All methods expect valid arguments being passed.
*/
//@{
/** Creating a new repo named \a name_r. */
- RepoIdType _createRepo( const std::string & name_r )
- {
- setDirty(__FUNCTION__, name_r.c_str() );
- return ::repo_create( _pool, name_r.c_str() );
- }
+ ::_Repo * _createRepo( const std::string & name_r );
/** Creating a new repo named \a name_r. */
- void _deleteRepo( ::_Repo * repo_r )
- {
- setDirty(__FUNCTION__, repo_r->name );
- ::repo_free( repo_r, /*reuseids*/false );
- eraseRepoInfo( repo_r );
- }
+ void _deleteRepo( ::_Repo * repo_r );
/** Adding solv file to a repo.
* Except for \c isSystemRepo_r, solvables of incompatible architecture
* are filtered out.
*/
- int _addSolv( ::_Repo * repo_r, FILE * file_r, bool isSystemRepo_r = false );
+ int _addSolv( ::_Repo * repo_r, FILE * file_r );
/** Adding Solvables to a repo. */
- detail::SolvableIdType _addSolvables( ::_Repo * repo_r, unsigned count_r )
- {
- setDirty(__FUNCTION__, repo_r->name );
- return ::repo_add_solvable_block( repo_r, count_r );
- }
+ detail::SolvableIdType _addSolvables( ::_Repo * repo_r, unsigned count_r );
//@}
public: