Mailinglist Archive: zypp-commit (339 mails)

< Previous Next >
[zypp-commit] r11464 - in /trunk/libzypp: devel/devel.ma/NewPool.cc zypp/Repository.cc zypp/Repository.h zypp/sat/Pool.cc zypp/sat/Pool.h zypp/sat/Solvable.cc zypp/sat/detail/PoolImpl.cc zypp/sat/detail/PoolImpl.h
  • From: mlandres@xxxxxxxxxxxxxxxx
  • Date: Thu, 23 Oct 2008 14:07:02 -0000
  • Message-id: <20081023140702.73DDC3493A@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Thu Oct 23 16:07:01 2008
New Revision: 11464

URL: http://svn.opensuse.org/viewcvs/zypp?rev=11464&view=rev
Log:
adapt to satpool now recording the system repo

Modified:
trunk/libzypp/devel/devel.ma/NewPool.cc
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
trunk/libzypp/zypp/sat/detail/PoolImpl.h

Modified: trunk/libzypp/devel/devel.ma/NewPool.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/NewPool.cc?rev=11464&r1=11463&r2=11464&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/NewPool.cc (original)
+++ trunk/libzypp/devel/devel.ma/NewPool.cc Thu Oct 23 16:07:01 2008
@@ -523,7 +523,6 @@
continue;

repoManager.refreshService( nservice );
-
}
}

@@ -611,22 +610,6 @@
}
}

- 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") );

Modified: trunk/libzypp/zypp/Repository.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Repository.cc?rev=11464&r1=11463&r2=11464&view=diff
==============================================================================
--- trunk/libzypp/zypp/Repository.cc (original)
+++ trunk/libzypp/zypp/Repository.cc Thu Oct 23 16:07:01 2008
@@ -27,10 +27,12 @@
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////

const Repository Repository::noRepository;

+ const std::string & Repository::systemRepoAlias()
+ { return sat::detail::PoolImpl::systemRepoAlias(); }
+
/////////////////////////////////////////////////////////////////

::_Repo * Repository::get() const
@@ -47,7 +49,7 @@
bool Repository::isSystemRepo() const
{
NO_REPOSITORY_RETURN( false );
- return( sat::Pool::systemRepoAlias() == _repo->name );
+ return myPool().isSystemRepo( _repo );
}

std::string Repository::alias() const
@@ -217,6 +219,7 @@
void Repository::eraseFromPool()
{
NO_REPOSITORY_RETURN();
+ MIL << *this << " removed from pool" << endl;
myPool()._deleteRepo( _repo );
_id = sat::detail::noRepoId;
}
@@ -236,22 +239,23 @@
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 )

Modified: trunk/libzypp/zypp/Repository.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Repository.h?rev=11464&r1=11463&r2=11464&view=diff
==============================================================================
--- trunk/libzypp/zypp/Repository.h (original)
+++ trunk/libzypp/zypp/Repository.h Thu Oct 23 16:07:01 2008
@@ -68,6 +68,9 @@
/** 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;

@@ -83,22 +86,6 @@
*/
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
*

Modified: trunk/libzypp/zypp/sat/Pool.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Pool.cc?rev=11464&r1=11463&r2=11464&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/Pool.cc (original)
+++ trunk/libzypp/zypp/sat/Pool.cc Thu Oct 23 16:07:01 2008
@@ -36,10 +36,7 @@
{ /////////////////////////////////////////////////////////////////

const std::string & Pool::systemRepoAlias()
- {
- static const std::string _val( "@System" );
- return _val;
- }
+ { return detail::PoolImpl::systemRepoAlias(); }

::_Pool * Pool::get() const
{ return myPool().getPool(); }
@@ -104,7 +101,7 @@
return ret;

ret = Repository( myPool()._createRepo( alias_r ) );
- if ( alias_r == systemRepoAlias() )
+ if ( ret.isSystemRepo() )
{
// autoprovide (dummy) RepoInfo
RepoInfo info;
@@ -113,8 +110,6 @@
info.setAutorefresh( true );
info.setEnabled( true );
ret.setInfo( info );
- // indicate
- ::pool_set_installed( get(), ret.get() );
}
return ret;
}

Modified: trunk/libzypp/zypp/sat/Pool.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Pool.h?rev=11464&r1=11463&r2=11464&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/Pool.h (original)
+++ trunk/libzypp/zypp/sat/Pool.h Thu Oct 23 16:07:01 2008
@@ -99,11 +99,6 @@
/** 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() ); }

Modified: trunk/libzypp/zypp/sat/Solvable.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Solvable.cc?rev=11464&r1=11463&r2=11464&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/Solvable.cc (original)
+++ trunk/libzypp/zypp/sat/Solvable.cc Thu Oct 23 16:07:01 2008
@@ -133,7 +133,7 @@
bool Solvable::isSystem() const
{
NO_SOLVABLE_RETURN( _id == detail::systemSolvableId );
- return Repository( _solvable->repo ).isSystemRepo();
+ return myPool().isSystemRepo( _solvable->repo );
}

IdString Solvable::ident() const

Modified: trunk/libzypp/zypp/sat/detail/PoolImpl.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/detail/PoolImpl.cc?rev=11464&r1=11463&r2=11464&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/detail/PoolImpl.cc (original)
+++ trunk/libzypp/zypp/sat/detail/PoolImpl.cc Thu Oct 23 16:07:01 2008
@@ -64,6 +64,14 @@

/////////////////////////////////////////////////////////////////

+ 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))) {
@@ -233,11 +241,27 @@

///////////////////////////////////////////////////////////////////

- 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;
@@ -280,6 +304,12 @@
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

Modified: trunk/libzypp/zypp/sat/detail/PoolImpl.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/detail/PoolImpl.h?rev=11464&r1=11463&r2=11464&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/detail/PoolImpl.h (original)
+++ trunk/libzypp/zypp/sat/detail/PoolImpl.h Thu Oct 23 16:07:01 2008
@@ -82,38 +82,32 @@
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:

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages