#include <iostream>
-
-#include <qapplication.h>
-#include <qpushbutton.h>
-#include <qlistview.h>
-#include <qvbox.h>
-#include <qdir.h>
-
-#include "Tools.h"
-#include "FakePool.h"
-
-#include <zypp/base/PtrTypes.h>
-#include <zypp/base/Exception.h>
-
-#include "zypp/ZYppFactory.h"
-#include "zypp/ResPoolProxy.h"
-#include "zypp/ResTraits.h"
-#include "zypp/ResPool.h"
-#include "zypp/Package.h"
+#include <zypp/base/LogTools.h>
+#include <zypp/base/Easy.h>
+#include <zypp/sat/Pool.h>
using std::endl;
+using std::cout;
using namespace zypp;
-///////////////////////////////////////////////////////////////////
-
-void setup( QVBox & top, int argc, char **argv )
+/******************************************************************
+**
+** FUNCTION NAME : main
+** FUNCTION TYPE : int
+*/
+int main( int argc, const char * argv[] )
{
- if ( ! argc )
- return;
-
- MIL << argv[0] << endl;
+ --argc; ++argv; // skip arg 0
+ sat::Pool satpool( sat::Pool::instance() );
+
+ for ( ; argc; --argc, ++argv )
+ {
+ cout << "Read: " << argv[0] << endl;
+ satpool.addRepoSolv( argv[0] );
+ }
+
+ cout << "Done: " << satpool << endl;
+
+ if ( getenv("VERBOSE") )
+ {
+ for_( it, satpool.solvablesBegin(), satpool.solvablesEnd() )
+ {
+ cout << dump(*it) << endl;
+ }
+ }
+
+ return 0;
}
-///////////////////////////////////////////////////////////////////
-
-int main( int argc, char **argv )
-{
- base::LogControl::instance().logfile( "-" );
- INT << "===[START]==========================================" << endl;
-
- QApplication app( argc, argv );
- QVBox top;
-
- --argc;
- ++argv;
- setup( top, argc, argv );
-
- QPushButton quit( "Quit", &top );
- QObject::connect( &quit,SIGNAL(clicked()), &app, SLOT(quit()) );
- app.setMainWidget( &top );
- top.show();
- INT << "===[LOOP]==========================================" << endl;
- return app.exec();
-}
-
-///////////////////////////////////////////////////////////////////
-//#include "QPool.moc"
-///////////////////////////////////////////////////////////////////
-
-
*/
int main( int argc, char * argv[] )
try {
- //zypp::base::LogControl::instance().logfile( "log.restrict" );
+ zypp::base::LogControl::instance().logToStdErr();
INT << "===[START]==========================================" << endl;
sat::Pool satpool( sat::Pool::instance() );
-------------------------------------------------------------------
+Thu Mar 6 13:42:53 CET 2008 - ma@suse.de
+
+- Do not filter any installed solvables.
+- revision 9031
+
+-------------------------------------------------------------------
Wed Mar 5 11:33:26 CET 2008 - ma@suse.de
- Try to rebuild broken solv files in Target::load.
ZYPP_THROW( Exception( _("Can't open solv-file: ")+file_r.asString() ) );
}
- if ( myPool()._addSolv( _repo, file ) != 0 )
+ if ( myPool()._addSolv( _repo, file, isSystemRepo() ) != 0 )
{
ZYPP_THROW( Exception( _("Error reading solv-file: ")+file_r.asString() ) );
}
PoolImpl::PoolImpl()
: _pool( ::pool_create() )
{
+ MIL << "Creating sat-pool." << endl;
if ( ! _pool )
{
ZYPP_THROW( Exception( _("Can not create sat-pool.") ) );
::pool_setdebuglevel( _pool, verbose ? 5 : 1 );
::pool_setdebugcallback( _pool, logSat, NULL );
- // set pool architecture
- ::pool_setarch( _pool, ZConfig::instance().systemArchitecture().asString().c_str() );
-
// set namespace callback
_pool->nscallback = &nsCallback;
_pool->nscallbackdata = (void*)this;
{
if ( _watcher.remember( _serial ) )
{
- /* nothing to do here, but _watcher MUST remember... */
- // set pool architecture
+ // After repo/solvable add/remove:
+ // set pool architecture
::pool_setarch( _pool, ZConfig::instance().systemArchitecture().asString().c_str() );
}
if ( ! _pool->whatprovides )
///////////////////////////////////////////////////////////////////
- int PoolImpl::_addSolv( ::_Repo * repo_r, FILE * file_r )
+ int PoolImpl::_addSolv( ::_Repo * repo_r, FILE * file_r, bool isSystemRepo_r )
{
setDirty(__FUNCTION__, repo_r->name );
int ret = ::repo_add_solv( repo_r , file_r );
- if ( ret == 0 )
+ if ( ret == 0 && ! isSystemRepo_r )
{
// Filter out unwanted archs
std::set<detail::IdType> sysids;
eraseRepoInfo( repo_r );
}
- /** Adding solv file to a repo. */
- int _addSolv( ::_Repo * repo_r, FILE * file_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 );
/** Adding Solvables to a repo. */
detail::SolvableIdType _addSolvables( ::_Repo * repo_r, unsigned count_r )