Author: mlandres
Date: Tue Jan 29 21:29:13 2008
New Revision: 8395
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8395&view=rev
Log:
adapt to new libsatsolver api
Modified:
branches/tmp/ma/jump_sat/libzypp/zypp/sat/Pool.cc
branches/tmp/ma/jump_sat/libzypp/zypp/sat/Repo.cc
branches/tmp/ma/jump_sat/libzypp/zypp/sat/SATResolver.cc
branches/tmp/ma/jump_sat/libzypp/zypp/sat/detail/PoolImpl.h
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/sat/Pool.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/sat/Pool.cc?rev=8395&r1=8394&r2=8395&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/sat/Pool.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/sat/Pool.cc Tue Jan 29 21:29:13 2008
@@ -101,8 +101,7 @@
Repo ret( reposFind( name_r ) );
if ( ret )
return ret;
- myPool().setDirty();
- return Repo( ::repo_create( get(), name_r.c_str() ) );
+ return Repo( myPool().createRepo( name_r ) );
}
Repo Pool::reposFind( const std::string & name_r ) const
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/sat/Repo.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/sat/Repo.cc?rev=8395&r1=8394&r2=8395&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/sat/Repo.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/sat/Repo.cc Tue Jan 29 21:29:13 2008
@@ -93,14 +93,13 @@
void Repo::eraseFromPool()
{
- NO_REPO_RETURN();
- myPool().setDirty();
- ::repo_free( _repo, /*reuseids*/false );
+ myPool().deleteRepo( _id );
+ _id = detail::noRepoId;
}
void Repo::addSolv( const Pathname & file_r )
{
- NO_REPO_THROW( Exception( _("Can't add solvables to noepo.") ) );
+ NO_REPO_THROW( Exception( _("Can't add solvables to norepo.") ) );
AutoDispose file( ::fopen( file_r.c_str(), "r" ), ::fclose );
if ( file == NULL )
@@ -115,14 +114,14 @@
detail::SolvableIdType Repo::addSolvable()
{
- NO_REPO_THROW( Exception( _("Can't add solvables to noepo.") ) );
+ NO_REPO_THROW( Exception( _("Can't add solvables to norepo.") ) );
myPool().setDirty();
return ::repo_add_solvable( _repo );
}
detail::SolvableIdType Repo::addSolvables( unsigned count_r )
{
- NO_REPO_THROW( Exception( _("Can't add solvables to noepo.") ) );
+ NO_REPO_THROW( Exception( _("Can't add solvables to norepo.") ) );
myPool().setDirty();
return ::repo_add_solvable_block( _repo, count_r );
}
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/sat/SATResolver.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/sat/SATResolver.cc?rev=8395&r1=8394&r2=8395&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/sat/SATResolver.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/sat/SATResolver.cc Tue Jan 29 21:29:13 2008
@@ -83,7 +83,7 @@
, _allowvirtualconflicts(false)
, _noupdateprovide(false)
, _dosplitprovides(false)
-
+
{
}
@@ -761,14 +761,14 @@
problemSolution->addDescription (description);
gotone = 1;
}
- if (!_solv->allowarchchange && s->name == sd->name && s->arch != sd->arch && policy_illegal_archchange(pool, s, sd))
+ if (!_solv->allowarchchange && s->name == sd->name && s->arch != sd->arch && policy_illegal_archchange(_solv, s, sd))
{
string description = str::form (_("architecture change of %s to %s"), solvable2str(pool, s), solvable2str(pool, sd));
MIL << description << endl;
problemSolution->addDescription (description);
gotone = 1;
}
- if (!_solv->allowvendorchange && s->name == sd->name && s->vendor != sd->vendor && policy_illegal_vendorchange(pool, s, sd))
+ if (!_solv->allowvendorchange && s->name == sd->name && s->vendor != sd->vendor && policy_illegal_vendorchange(_solv, s, sd))
{
string description = str::form (_("vendor change of [%s]%s to [%s]%s") , id2str(pool, s->vendor) , solvable2str(pool, s),
string(sd->vendor ? id2str(pool, sd->vendor) : " (no vendor) ").c_str(), solvable2str(pool, sd));
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/sat/detail/PoolImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/sat/detail/PoolImpl.h?rev=8395&r1=8394&r2=8395&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/sat/detail/PoolImpl.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/sat/detail/PoolImpl.h Tue Jan 29 21:29:13 2008
@@ -23,7 +23,6 @@
#include "zypp/base/NonCopyable.h"
#include "zypp/base/SerialNumber.h"
-
#include "zypp/sat/detail/PoolMember.h"
///////////////////////////////////////////////////////////////////
@@ -51,8 +50,8 @@
~PoolImpl();
/** Pointer style access forwarded to sat-pool. */
- ::_Pool * operator->()
- { return _pool; }
+ ::_Pool * operator->()
+ { return _pool; }
public:
/** Serial number changing whenever the content changes. */
@@ -78,6 +77,29 @@
}
public:
+ /** \name Actions invalidating housekeeping data.
+ */
+ //@{
+ /** Creating a new repo named \a name_r. */
+ RepoIdType createRepo( const std::string & name_r )
+ {
+ setDirty();
+ return ::repo_create( _pool, name_r.c_str() );
+ }
+
+ /** Creating a new repo named \a name_r. */
+ void deleteRepo( RepoIdType id_r )
+ {
+ ::_Repo * todel( getRepo( id_r ) );
+ if ( todel )
+ {
+ setDirty();
+ ::repo_free( todel, /*reuseids*/false );
+ }
+ }
+ //@}
+
+ public:
/** a \c valid \ref Solvable has a non NULL repo pointer. */
bool validSolvable( const ::_Solvable & slv_r ) const
{ return slv_r.repo; }
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org