Author: mlandres
Date: Tue Nov 27 10:23:08 2007
New Revision: 7930
URL: http://svn.opensuse.org/viewcvs/zypp?rev=7930&view=rev
Log:
backup
Added:
trunk/libzypp/zypp/sat/IdStr.cc
trunk/libzypp/zypp/sat/IdStr.h
Modified:
trunk/libzypp/devel/devel.ma/NewPool.cc
trunk/libzypp/zypp/CMakeLists.txt
trunk/libzypp/zypp/PoolItem.cc
trunk/libzypp/zypp/PoolItem.h
trunk/libzypp/zypp/ResPool.cc
trunk/libzypp/zypp/ResPool.h
trunk/libzypp/zypp/pool/PoolImpl.cc
trunk/libzypp/zypp/pool/PoolImpl.h
trunk/libzypp/zypp/sat/Pool.cc
trunk/libzypp/zypp/sat/Pool.h
trunk/libzypp/zypp/sat/Repo.cc
trunk/libzypp/zypp/sat/Solvable.cc
trunk/libzypp/zypp/sat/Solvable.h
trunk/libzypp/zypp/sat/detail/PoolImpl.h
trunk/libzypp/zypp/sat/detail/PoolMember.h
Modified: trunk/libzypp/devel/devel.ma/NewPool.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/NewPool.cc?rev=7930&r1=7929&r2=7930&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/NewPool.cc (original)
+++ trunk/libzypp/devel/devel.ma/NewPool.cc Tue Nov 27 10:23:08 2007
@@ -423,44 +423,19 @@
sat::Pool satpool( sat::Pool::instance() );
- //sat::Repo r( satpool.addRepoSolv( "sl10.1-beta7-packages.solv" ) );
- sat::Repo s( satpool.addRepoSolv( "sl10.1-beta7-selections.solv" ) );
- MIL << satpool << endl;
- std::for_each( s.solvablesBegin(), s.solvablesEnd(), Print() );
-
- // r.eraseFromPool();
- // MIL << satpool << endl;
- //MIL << s << endl;
- //std::for_each( s.solvablesBegin(), s.solvablesEnd(), Print() );
-
-
#if 0
- satpool.addRepoSolv( "sl10.1-beta7-packages.solv" );
- satpool.addRepoSolv( "sl10.1-beta7-selections.solv" );
- MIL << satpool << endl;
-
- sat::Repo outdated( satpool.reposFind( "sl10.1-beta7-packages.solv" ) );
- satpool.reposErase( "sl10.1-beta7-packages.solv" );
-
- WAR << outdated << endl;
- for_( sit, outdated.solvablesBegin(), outdated.solvablesEnd() )
- MIL << *sit << endl;
-
- if ( 0 )
- for_( it, satpool.reposBegin(), satpool.reposEnd() )
- {
- WAR << *it << endl;
- for_( sit, it->solvablesBegin(), it->solvablesEnd() )
- MIL << *sit << endl;
- }
-#endif
///////////////////////////////////////////////////////////////////
INT << "===[END]============================================" << endl << endl;
zypp::base::LogControl::instance().logNothing();
return 0;
+#endif
setenv( "ZYPP_CONF", (sysRoot/"zypp.conf").c_str(), 1 );
+ ResPool pool( getZYpp()->pool() );
+ USR << "pool: " << pool << endl;
+ pool.satSync();
+
RepoManager repoManager( makeRepoManager( sysRoot ) );
RepoInfoList repos = repoManager.knownRepositories();
// SEC << "/Local/ROOT " << repos << endl;
@@ -518,7 +493,7 @@
}
- if ( 0 )
+ if ( 1 )
{
Measure x( "INIT TARGET" );
{
@@ -531,8 +506,8 @@
getZYpp()->target()->resolvables().end() ) << endl;
}
- ResPool pool( getZYpp()->pool() );
USR << "pool: " << pool << endl;
+ pool.satSync();
//std::for_each( pool.begin(), pool.end(), Xprint() );
Modified: trunk/libzypp/zypp/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/CMakeLists.txt?rev=7930&r1=7929&r2=7930&view=diff
==============================================================================
--- trunk/libzypp/zypp/CMakeLists.txt (original)
+++ trunk/libzypp/zypp/CMakeLists.txt Tue Nov 27 10:23:08 2007
@@ -680,6 +680,7 @@
sat/Pool.cc
sat/Repo.cc
sat/Solvable.cc
+ sat/IdStr.cc
sat/SATResolver.cc
)
@@ -689,6 +690,7 @@
sat/Pool.h
sat/Repo.h
sat/Solvable.h
+ sat/IdStr.h
sat/SATResolver.h
)
Modified: trunk/libzypp/zypp/PoolItem.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/PoolItem.cc?rev=7930&r1=7929&r2=7930&view=diff
==============================================================================
--- trunk/libzypp/zypp/PoolItem.cc (original)
+++ trunk/libzypp/zypp/PoolItem.cc Tue Nov 27 10:23:08 2007
@@ -17,6 +17,8 @@
#include "zypp/SystemResObject.h"
#include "zypp/VendorAttr.h"
+#include "zypp/sat/Solvable.h"
+
using std::endl;
///////////////////////////////////////////////////////////////////
@@ -59,9 +61,16 @@
bool autoprotect() const;
+ const sat::Solvable & satSolvable() const
+ { return _satSolvable; }
+
+ void rememberSatSolvable( const sat::Solvable & slv_r ) const
+ { _satSolvable = slv_r; }
+
private:
- mutable ResStatus _status;
- ResObject::constPtr _resolvable;
+ mutable ResStatus _status;
+ ResObject::constPtr _resolvable;
+ mutable sat::Solvable _satSolvable;
/** \name Poor man's save/restore state.
* \todo There may be better save/restore state strategies.
@@ -99,6 +108,7 @@
inline std::ostream & operator<<( std::ostream & str, const PoolItem_Ref::Impl & obj )
{
str << obj.status();
+ str << obj.satSolvable();
if (obj.resolvable())
str << *obj.resolvable();
else
@@ -191,6 +201,12 @@
bool PoolItem_Ref::sameState() const
{ return _pimpl->sameState(); }
+ const sat::Solvable & PoolItem_Ref::satSolvable() const
+ { return _pimpl->satSolvable(); }
+
+ void PoolItem_Ref::rememberSatSolvable( const sat::Solvable & slv_r ) const
+ { _pimpl->rememberSatSolvable( slv_r ); }
+
/******************************************************************
**
** FUNCTION NAME : operator<<
Modified: trunk/libzypp/zypp/PoolItem.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/PoolItem.h?rev=7930&r1=7929&r2=7930&view=diff
==============================================================================
--- trunk/libzypp/zypp/PoolItem.h (original)
+++ trunk/libzypp/zypp/PoolItem.h Tue Nov 27 10:23:08 2007
@@ -22,6 +22,13 @@
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace sat
+ { /////////////////////////////////////////////////////////////////
+ class Solvable;
+ /////////////////////////////////////////////////////////////////
+ } // namespace sat
+ ///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
//
@@ -90,6 +97,13 @@
operator ResObject::constPtr::unspecified_bool_type() const
{ return resolvable(); }
+ public:
+ /** Return the corresponding \ref sat::Solvable. */
+ const sat::Solvable & satSolvable() const;
+
+ /** Remember the corresponding \ref sat::Solvable. */
+ void rememberSatSolvable( const sat::Solvable & slv_r ) const;
+
private:
/** Pointer to implementation */
RW_pointer<Impl> _pimpl;
Modified: trunk/libzypp/zypp/ResPool.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResPool.cc?rev=7930&r1=7929&r2=7930&view=diff
==============================================================================
--- trunk/libzypp/zypp/ResPool.cc (original)
+++ trunk/libzypp/zypp/ResPool.cc Tue Nov 27 10:23:08 2007
@@ -64,6 +64,12 @@
//
///////////////////////////////////////////////////////////////////
+ bool ResPool::satSynced() const
+ { return _pimpl->satSynced(); }
+
+ void ResPool::satSync() const
+ { return _pimpl->satSync(); }
+
bool ResPool::empty() const
{ return _pimpl->empty(); }
Modified: trunk/libzypp/zypp/ResPool.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResPool.h?rev=7930&r1=7929&r2=7930&view=diff
==============================================================================
--- trunk/libzypp/zypp/ResPool.h (original)
+++ trunk/libzypp/zypp/ResPool.h Tue Nov 27 10:23:08 2007
@@ -63,13 +63,17 @@
*/
const SerialNumber & serial() const;
+ /** Wheter in sync with sat-pool. */
+ bool satSynced() const;
+ /** Sync with sat-pool. */
+ void satSync() const;
+
+ public:
/** */
bool empty() const;
/** */
size_type size() const;
- public:
-
/** \name Iterate through all ResObjects (all kinds). */
//@{
/** */
Modified: trunk/libzypp/zypp/pool/PoolImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/pool/PoolImpl.cc?rev=7930&r1=7929&r2=7930&view=diff
==============================================================================
--- trunk/libzypp/zypp/pool/PoolImpl.cc (original)
+++ trunk/libzypp/zypp/pool/PoolImpl.cc Tue Nov 27 10:23:08 2007
@@ -10,8 +10,9 @@
*
*/
#include <iostream>
-#include "zypp/base/Logger.h"
+#include "zypp/base/LogTools.h"
#include "zypp/capability/FilesystemCap.h"
+#include "zypp/base/Measure.h"
#include "zypp/pool/PoolImpl.h"
#include "zypp/pool/PoolStats.h"
@@ -19,6 +20,9 @@
#include "zypp/Package.h"
#include "zypp/VendorAttr.h"
+#include "zypp/sat/Pool.h"
+#include "zypp/sat/Repo.h"
+
using std::endl;
///////////////////////////////////////////////////////////////////
@@ -220,6 +224,48 @@
return _serial;
}
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : PoolImpl::satSync
+ // METHOD TYPE : void
+ //
+ void PoolImpl::satSync() const
+ {
+ if ( satSynced() )
+ {
+ MIL << "Pool: " << _serial << ": In sync with sat-pool " << _satSyncRequired << endl;
+ return;
+ }
+
+ debug::Measure mnf( "Sync changes to sat-pool..." );
+ MIL << "Pool: " << _serial << ": Sync changes to sat-pool... " << _satSyncRequired << endl;
+
+ std::map todo;
+ for_( it, begin(), end() )
+ {
+ if ( ! (*it).satSolvable() )
+ {
+ todo[(*it)->repository().info().alias()].push_back( *it );
+ }
+ }
+
+ DBG << "Update missing repos... " << todo.size() << endl;
+ for_( it, todo.begin(), todo.end() )
+ {
+ DBG << "Update " << it->first << ": " << it->second.size() << endl;
+ sat::Repo repo( sat::Pool::instance().reposInsert( it->first ) );
+ sat::Solvable first( repo.addSolvables( it->second.size() ) );
+ DBG << " starting at " << first << endl;
+ for_( pit, it->second.begin(), it->second.end() )
+ {
+ // *pit to sat::Solvable
+ }
+ }
+
+ //_satSyncRequired.remember( _serial );
+ //MIL << "Pool: " << _serial << ": In sync with sat-pool " << _satSyncRequired << endl;
+ }
+
/******************************************************************
**
** FUNCTION NAME : operator<<
Modified: trunk/libzypp/zypp/pool/PoolImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/pool/PoolImpl.h?rev=7930&r1=7929&r2=7930&view=diff
==============================================================================
--- trunk/libzypp/zypp/pool/PoolImpl.h (original)
+++ trunk/libzypp/zypp/pool/PoolImpl.h Tue Nov 27 10:23:08 2007
@@ -327,11 +327,20 @@
* (Resolvables or Dependencies) changes. */
const SerialNumber & serial() const;
+ /** Wheter in sync with sat-pool. */
+ bool satSynced() const
+ { return _satSyncRequired.isClean( _serial ); }
+
+ /** Sync with sat-pool. */
+ void satSync() const;
+
private:
/** Serial number. */
SerialNumber _serial;
/** Watch for changes in /etc/sysconfig/storage. */
SerialNumberWatcher _watchFilesystemSysconfigStorage;
+ /** Watch for changes in /etc/sysconfig/storage. */
+ SerialNumberWatcher _satSyncRequired;
public:
ContainerT _store;
Added: trunk/libzypp/zypp/sat/IdStr.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/IdStr.cc?rev=7930&view=auto
==============================================================================
--- trunk/libzypp/zypp/sat/IdStr.cc (added)
+++ trunk/libzypp/zypp/sat/IdStr.cc Tue Nov 27 10:23:08 2007
@@ -0,0 +1,56 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/sat/IdStr.cc
+ *
+*/
+#include <iostream>
+//#include "zypp/base/Logger.h"
+
+#include "zypp/sat/detail/PoolImpl.h"
+#include "zypp/sat/IdStr.h"
+
+using std::endl;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace sat
+ { /////////////////////////////////////////////////////////////////
+
+ static const IdStr::IdStr Null( STRID_NULL );
+
+ /////////////////////////////////////////////////////////////////
+
+ const char * IdStr::c_str() const
+ {
+ return ::id2str( myPool().getPool(), _id );
+ }
+
+ std::string IdStr::string() const
+ {
+ return ::id2str( myPool().getPool(), _id );
+ }
+
+ /******************************************************************
+ **
+ ** FUNCTION NAME : operator<<
+ ** FUNCTION TYPE : std::ostream &
+ */
+ std::ostream & operator<<( std::ostream & str, const IdStr & obj )
+ {
+ return str << obj.c_str();
+ }
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace sat
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
Added: trunk/libzypp/zypp/sat/IdStr.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/IdStr.h?rev=7930&view=auto
==============================================================================
--- trunk/libzypp/zypp/sat/IdStr.h (added)
+++ trunk/libzypp/zypp/sat/IdStr.h Tue Nov 27 10:23:08 2007
@@ -0,0 +1,71 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/sat/IdStr.h
+ *
+*/
+#ifndef ZYPP_SAT_IDSTR_H
+#define ZYPP_SAT_IDSTR_H
+
+#include <iosfwd>
+#include <string>
+
+#include "zypp/sat/detail/PoolMember.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace sat
+ { /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : IdStr
+ //
+ /** */
+ class IdStr: protected detail::PoolMember
+ {
+ friend std::ostream & operator<<( std::ostream & str, const IdStr & obj );
+
+ public:
+ IdStr() : _id( 0 ) {}
+ explicit IdStr( int id_r ) : _id( id_r ) {}
+ explicit IdStr( const char * str_r );
+ explicit IdStr( const std::string & str_r );
+ public:
+ static const IdStr Null;
+ public:
+ const char * c_str() const;
+ std::string string() const;
+ public:
+ int get() const { return _id; }
+ private:
+ int _id;
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ /** \relates IdStr Stream output */
+ std::ostream & operator<<( std::ostream & str, const IdStr & obj );
+
+ /** \relates IdStr */
+ inline bool operator==( const IdStr & lhs, const IdStr & rhs )
+ { return lhs.get() == rhs.get(); }
+
+ /** \relates IdStr */
+ inline bool operator!=( const IdStr & lhs, const IdStr & rhs )
+ { return lhs.get() != rhs.get(); }
+
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace sat
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_SAT_IDSTR_H
Modified: trunk/libzypp/zypp/sat/Pool.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Pool.cc?rev=7930&r1=7929&r2=7930&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/Pool.cc (original)
+++ trunk/libzypp/zypp/sat/Pool.cc Tue Nov 27 10:23:08 2007
@@ -40,6 +40,9 @@
::_Pool * Pool::get() const
{ return myPool().getPool(); }
+ const SerialNumber & Pool::serial() const
+ { return myPool().serial(); }
+
bool Pool::reposEmpty() const
{ return myPool()->nrepos; }
@@ -52,7 +55,6 @@
Pool::RepoIterator Pool::reposEnd() const
{ return RepoIterator( myPool()->repos+myPool()->nrepos ); }
-
bool Pool::solvablesEmpty() const
{
// return myPool()->nsolvables;
@@ -90,6 +92,7 @@
Repo ret( reposFind( name_r ) );
if ( ret )
return ret;
+ myPool().setDirty();
return Repo( ::repo_create( get(), name_r.c_str() ) );
}
@@ -132,7 +135,7 @@
*/
std::ostream & operator<<( std::ostream & str, const Pool & obj )
{
- return str << "sat::pool(){"
+ return str << "sat::pool(" << obj.serial() << "){"
<< obj.reposSize() << "repos|"
<< obj.solvablesSize() << "slov}";
}
Modified: trunk/libzypp/zypp/sat/Pool.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Pool.h?rev=7930&r1=7929&r2=7930&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/Pool.h (original)
+++ trunk/libzypp/zypp/sat/Pool.h Tue Nov 27 10:23:08 2007
@@ -50,6 +50,10 @@
{}
public:
+ /***/
+ const SerialNumber & serial() const;
+
+ public:
/** Whether \ref Pool contains repos. */
bool reposEmpty() const;
Modified: trunk/libzypp/zypp/sat/Repo.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Repo.cc?rev=7930&r1=7929&r2=7930&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/Repo.cc (original)
+++ trunk/libzypp/zypp/sat/Repo.cc Tue Nov 27 10:23:08 2007
@@ -88,7 +88,8 @@
void Repo::eraseFromPool()
{
NO_REPO_RETURN();
- ::repo_free( _repo, /*reuseids*/true );
+ myPool().setDirty();
+ ::repo_free( _repo, /*reuseids*/false );
}
void Repo::addSolv( const Pathname & file_r )
@@ -102,18 +103,21 @@
ZYPP_THROW( Exception( "Can't read solv-file "+file_r.asString() ) );
}
+ myPool().setDirty();
::repo_add_solv( _repo, file );
}
detail::SolvableIdType Repo::addSolvable()
{
NO_REPO_THROW( Exception( "Can't add solvables to noepo." ) );
+ myPool().setDirty();
return ::repo_add_solvable( _repo );
}
detail::SolvableIdType Repo::addSolvables( unsigned count_r )
{
NO_REPO_THROW( Exception( "Can't add solvables to noepo." ) );
+ myPool().setDirty();
return ::repo_add_solvable_block( _repo, count_r );
}
Modified: trunk/libzypp/zypp/sat/Solvable.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Solvable.cc?rev=7930&r1=7929&r2=7930&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/Solvable.cc (original)
+++ trunk/libzypp/zypp/sat/Solvable.cc Tue Nov 27 10:23:08 2007
@@ -16,6 +16,7 @@
#include "zypp/base/Exception.h"
#include "zypp/sat/detail/PoolImpl.h"
+#include "zypp/sat/IdStr.h"
#include "zypp/sat/Solvable.h"
#include "zypp/sat/Repo.h"
@@ -28,21 +29,6 @@
namespace sat
{ /////////////////////////////////////////////////////////////////
- const PoolId PoolId::noid;
-
- /******************************************************************
- **
- ** FUNCTION NAME : operator<<
- ** FUNCTION TYPE : std::ostream &
- */
- std::ostream & operator<<( std::ostream & str, const PoolId & obj )
- {
- return str << ::id2str( detail::PoolMember::myPool().getPool(), obj.get() );
- return str << "sat::Id(" << obj.get() << ")";
- }
-
- /////////////////////////////////////////////////////////////////
-
const Solvable Solvable::nosolvable;
/////////////////////////////////////////////////////////////////
@@ -59,25 +45,25 @@
NameId Solvable::name() const
{
- NO_SOLVABLE_RETURN( NameId::noid );
- return _solvable->name; }
+ NO_SOLVABLE_RETURN( NameId() );
+ return NameId( _solvable->name ); }
EvrId Solvable::evr() const
{
- NO_SOLVABLE_RETURN( EvrId::noid );
- return _solvable->arch;
+ NO_SOLVABLE_RETURN( EvrId() );
+ return EvrId( _solvable->evr );
}
ArchId Solvable::arch() const
{
- NO_SOLVABLE_RETURN( ArchId::noid );
- return _solvable->evr;
+ NO_SOLVABLE_RETURN( ArchId() );
+ return ArchId( _solvable->arch );
}
VendorId Solvable::vendor() const
{
- NO_SOLVABLE_RETURN( VendorId::noid );
- return _solvable->vendor;
+ NO_SOLVABLE_RETURN( VendorId() );
+ return VendorId( _solvable->vendor );
}
Repo Solvable::repo() const
@@ -86,18 +72,6 @@
return Repo( _solvable->repo );
}
- const char * Solvable::string( const PoolId & id_r ) const
- {
- NO_SOLVABLE_RETURN( "" );
- SEC << id_r<< endl;
- SEC << " n " << ::id2str( _solvable->repo->pool, id_r.get() ) << endl;
- SEC << " e " << ::dep2str( _solvable->repo->pool, id_r.get() )<< endl;
- SEC << " a " << ::id2rel( _solvable->repo->pool, id_r.get() )<< endl;
- SEC << " v " << ::id2evr( _solvable->repo->pool, id_r.get() )<< endl;
- return ::id2str( _solvable->repo->pool, id_r.get() );
- }
-
-
/******************************************************************
**
** FUNCTION NAME : operator<<
Modified: trunk/libzypp/zypp/sat/Solvable.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Solvable.h?rev=7930&r1=7929&r2=7930&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/Solvable.h (original)
+++ trunk/libzypp/zypp/sat/Solvable.h Tue Nov 27 10:23:08 2007
@@ -25,38 +25,6 @@
namespace sat
{ /////////////////////////////////////////////////////////////////
- class PoolId : private base::SafeBool<PoolId>
- {
- public:
- PoolId() : _id( 0 ) {}
- PoolId( int id_r ) : _id( id_r ) {}
- static const PoolId noid;
- /** Evaluate \ref PoolId in a boolean context (\c != \c 0). */
- using base::SafeBool<PoolId>::operator bool_type;
- int get() const { return _id; }
- private:
- friend base::SafeBool<PoolId>::operator bool_type() const;
- bool boolTest() const { return _id; }
- private:
- int _id;
- };
-
- /** \relates PoolId Stream output */
- std::ostream & operator<<( std::ostream & str, const PoolId & obj );
-
- /** \relates PoolId */
- inline bool operator==( const PoolId & lhs, const PoolId & rhs )
- { return lhs.get() == rhs.get(); }
-
- /** \relates PoolId */
- inline bool operator!=( const PoolId & lhs, const PoolId & rhs )
- { return lhs.get() != rhs.get(); }
-
- typedef PoolId NameId;
- typedef PoolId EvrId;
- typedef PoolId ArchId;
- typedef PoolId VendorId;
-
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : Solvable
@@ -90,14 +58,6 @@
Repo repo() const;
public:
- const char * string( const PoolId & id_r ) const;
-
- const char * nameStr() const { return string( name() ); }
- const char * evrStr() const { return string( evr() ); }
- const char * archStr() const { return string( arch() ); }
- const char * vendorStr() const { return string( vendor() ); }
-
- public:
/** Return next Solvable in \ref Pool (or \ref nosolvable). */
Solvable nextInPool() const;
/** Return next Solvable in \ref Repo (or \ref nosolvable). */
@@ -126,6 +86,10 @@
inline bool operator!=( const Solvable & lhs, const Solvable & rhs )
{ return lhs.get() != rhs.get(); }
+ /** \relates Solvable */
+ inline bool operator<( const Solvable & lhs, const Solvable & rhs )
+ { return lhs.get() < rhs.get(); }
+
///////////////////////////////////////////////////////////////////
namespace detail
{ /////////////////////////////////////////////////////////////////
Modified: trunk/libzypp/zypp/sat/detail/PoolImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/detail/PoolImpl.h?rev=7930&r1=7929&r2=7930&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/detail/PoolImpl.h (original)
+++ trunk/libzypp/zypp/sat/detail/PoolImpl.h Tue Nov 27 10:23:08 2007
@@ -21,6 +21,7 @@
#include <iosfwd>
#include "zypp/base/NonCopyable.h"
+#include "zypp/base/SerialNumber.h"
#include "zypp/sat/detail/PoolMember.h"
@@ -53,6 +54,14 @@
{ return _pool; }
public:
+ /** Serial number changing whenever the content changes. */
+ const SerialNumber & serial() const
+ { return _serial; }
+ /** */
+ void setDirty()
+ { _serial.setDirty(); }
+
+ public:
/** a \c valid \ref Solvable has a non NULL repo pointer. */
bool validSolvable( const ::_Solvable & slv_r ) const
{ return slv_r.repo; }
@@ -104,7 +113,10 @@
}
private:
- ::_Pool * _pool;
+ /** sat-pool. */
+ ::_Pool * _pool;
+ /** Serial number. */
+ SerialNumber _serial;
};
///////////////////////////////////////////////////////////////////
Modified: trunk/libzypp/zypp/sat/detail/PoolMember.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/detail/PoolMember.h?rev=7930&r1=7929&r2=7930&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/detail/PoolMember.h (original)
+++ trunk/libzypp/zypp/sat/detail/PoolMember.h Tue Nov 27 10:23:08 2007
@@ -28,6 +28,7 @@
namespace sat
{ /////////////////////////////////////////////////////////////////
+ class IdStr;
class Solvable;
class Repo;
class Pool;
@@ -89,6 +90,13 @@
} // namespace detail
///////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ typedef IdStr NameId;
+ typedef IdStr EvrId;
+ typedef IdStr ArchId;
+ typedef IdStr VendorId;
+ ///////////////////////////////////////////////////////////////////
+
/////////////////////////////////////////////////////////////////
} // namespace sat
///////////////////////////////////////////////////////////////////
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org