Author: mlandres
Date: Wed Nov 28 17:47:36 2007
New Revision: 7965
URL: http://svn.opensuse.org/viewcvs/zypp?rev=7965&view=rev
Log:
update satpool housekeeping data after sync.
Modified:
trunk/libzypp/zypp/pool/PoolImpl.cc
trunk/libzypp/zypp/pool/PoolImpl.h
trunk/libzypp/zypp/pool/Res2Sat.cc
trunk/libzypp/zypp/sat/IdStr.cc
trunk/libzypp/zypp/sat/Pool.cc
trunk/libzypp/zypp/sat/Pool.h
trunk/libzypp/zypp/sat/detail/PoolImpl.h
Modified: trunk/libzypp/zypp/pool/PoolImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/pool/PoolImpl.cc?rev=7965&r1=7964&r2=7965&view=diff
==============================================================================
--- trunk/libzypp/zypp/pool/PoolImpl.cc (original)
+++ trunk/libzypp/zypp/pool/PoolImpl.cc Wed Nov 28 17:47:36 2007
@@ -273,7 +273,9 @@
}
_satSyncRequired.remember( _serial );
+ sat::Pool::instance().prepare();
MIL << "Pool: " << _serial << ": In sync with sat-pool " << _satSyncRequired << endl;
+ MIL << "sat::Pool: " << sat::Pool::instance() << endl;
}
///////////////////////////////////////////////////////////////////
Modified: trunk/libzypp/zypp/pool/PoolImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/pool/PoolImpl.h?rev=7965&r1=7964&r2=7965&view=diff
==============================================================================
--- trunk/libzypp/zypp/pool/PoolImpl.h (original)
+++ trunk/libzypp/zypp/pool/PoolImpl.h Wed Nov 28 17:47:36 2007
@@ -346,7 +346,7 @@
SerialNumber _serial;
/** Watch for changes in /etc/sysconfig/storage. */
SerialNumberWatcher _watchFilesystemSysconfigStorage;
- /** Watch for changes in /etc/sysconfig/storage. */
+ /** Watch for changes \c _serial. */
SerialNumberWatcher _satSyncRequired;
public:
Modified: trunk/libzypp/zypp/pool/Res2Sat.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/pool/Res2Sat.cc?rev=7965&r1=7964&r2=7965&view=diff
==============================================================================
--- trunk/libzypp/zypp/pool/Res2Sat.cc (original)
+++ trunk/libzypp/zypp/pool/Res2Sat.cc Wed Nov 28 17:47:36 2007
@@ -10,6 +10,7 @@
*
*/
#include <iostream>
+#include
#include "zypp/base/Easy.h"
#include "zypp/base/LogTools.h"
@@ -27,6 +28,8 @@
using std::endl;
+
+
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
@@ -45,14 +48,19 @@
inline void store( ::Offset & where_r, ::_Solvable * slv_r, const Dependencies & dep_r, Dep which_r )
{
+ enum SatIsRreq {
+ ISRREQ_NORMAL = 0,
+ ISRREQ_REQUIRES = 1,
+ ISRREQ_PREREQUIRES = 2
+ };
const CapSet & caps( dep_r[which_r] );
if ( caps.empty() )
return;
for_( it, caps.begin(), caps.end() )
{
- // check PREREQUIRES later
- int isreq = ( which_r == Dep::REQUIRES ? 1 : 0 );
+ // checking PREREQUIRES later
+ SatIsRreq isreq = ( which_r == Dep::REQUIRES ? ISRREQ_REQUIRES : ISRREQ_NORMAL );
std::string name;
Rel op;
@@ -71,29 +79,26 @@
name = (*it).asString();
}
- sat::IdStr nid;
+ ::Id nid = 0;
if ( refersTo<Package>( *it ) )
{
- nid = sat::IdStr( name );
+ store( nid, name );
}
else
{
- nid = sat::IdStr( str::form( "%s:%s",
- (*it).refers().asString().c_str(),
- name.c_str() ) );
+ store( nid, str::form( "%s:%s",
+ (*it).refers().asString().c_str(),
+ name.c_str() ) );
}
if ( op != Rel::ANY && ed != Edition::noedition )
{
sat::IdStr eid( ed.asString() );
#warning TBD calc rel and prereqcheck
- ::Id rid = ::rel2id( slv_r->repo->pool, nid.id(), eid.id(), REL_EQ, true );
- where_r = ::repo_addid_dep( slv_r->repo, where_r, rid, isreq );
- }
- else
- {
- where_r = ::repo_addid_dep( slv_r->repo, where_r, nid.id(), isreq );
+ nid = ::rel2id( slv_r->repo->pool, nid, eid.id(), op.bits(), true );
}
+
+ where_r = ::repo_addid_dep( slv_r->repo, where_r, nid, isreq );
}
}
Modified: trunk/libzypp/zypp/sat/IdStr.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/IdStr.cc?rev=7965&r1=7964&r2=7965&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/IdStr.cc (original)
+++ trunk/libzypp/zypp/sat/IdStr.cc Wed Nov 28 17:47:36 2007
@@ -30,11 +30,11 @@
/////////////////////////////////////////////////////////////////
IdStr::IdStr( const char * str_r )
- : _id( ::stringpool_str2id( &myPool()->ss, str_r, true ) )
+ : _id( ::str2id( myPool().getPool(), str_r, true ) )
{}
IdStr::IdStr( const std::string & str_r )
- : _id( ::stringpool_str2id( &myPool()->ss, str_r.c_str(), true ) )
+ : _id( ::str2id( myPool().getPool(), str_r.c_str(), true ) )
{}
const char * IdStr::c_str() const
Modified: trunk/libzypp/zypp/sat/Pool.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Pool.cc?rev=7965&r1=7964&r2=7965&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/Pool.cc (original)
+++ trunk/libzypp/zypp/sat/Pool.cc Wed Nov 28 17:47:36 2007
@@ -43,6 +43,12 @@
const SerialNumber & Pool::serial() const
{ return myPool().serial(); }
+ void Pool::setDirty()
+ { return myPool().setDirty(); }
+
+ void Pool::prepare()
+ { return myPool().prepare(); }
+
bool Pool::reposEmpty() const
{ return myPool()->nrepos; }
Modified: trunk/libzypp/zypp/sat/Pool.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Pool.h?rev=7965&r1=7964&r2=7965&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/Pool.h (original)
+++ trunk/libzypp/zypp/sat/Pool.h Wed Nov 28 17:47:36 2007
@@ -51,9 +51,15 @@
{}
public:
- /***/
+ /** */
const SerialNumber & serial() const;
+ /** Invalidate housekeeping data (e.g. whatprovides). */
+ void setDirty();
+
+ /** Update housekeeping data (e.g. whatprovides). */
+ void prepare();
+
public:
/** Whether \ref Pool contains repos. */
bool reposEmpty() const;
Modified: trunk/libzypp/zypp/sat/detail/PoolImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/detail/PoolImpl.h?rev=7965&r1=7964&r2=7965&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/detail/PoolImpl.h (original)
+++ trunk/libzypp/zypp/sat/detail/PoolImpl.h Wed Nov 28 17:47:36 2007
@@ -57,10 +57,24 @@
/** Serial number changing whenever the content changes. */
const SerialNumber & serial() const
{ return _serial; }
- /** */
+
+ /** Invalidate housekeeping data (e.g. whatprovides).
+ */
void setDirty()
{ _serial.setDirty(); }
+ /** Update housekeeping data (e.g. whatprovides).
+ * \todo actually requires a watcher.
+ */
+ void prepare()
+ {
+ if ( _serial.dirty() )
+ {
+ ::pool_createwhatprovides( _pool );
+ _serial.serial();
+ }
+ }
+
public:
/** a \c valid \ref Solvable has a non NULL repo pointer. */
bool validSolvable( const ::_Solvable & slv_r ) const
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org