ref: refs/heads/SuSE-Code-11-Branch
commit 6e26de3652d3cb5456c80aea9005d2c279f70bfb
Author: Michael Andres
Date: Wed Feb 18 16:59:31 2009 +0100
backup
---
devel/devel.ma/Test.cc | 99 ++++++++----------------------------------------
1 files changed, 16 insertions(+), 83 deletions(-)
diff --git a/devel/devel.ma/Test.cc b/devel/devel.ma/Test.cc
index 20e6d28..026af6f 100644
--- a/devel/devel.ma/Test.cc
+++ b/devel/devel.ma/Test.cc
@@ -2,44 +2,13 @@
#include
#include
-#include
-
-static std::string pidAndAppname()
-{
- static std::string _val;
- if ( _val.empty() )
- {
- pid_t mypid = getpid();
- Pathname p( "/proc/"+str::numstring(mypid)+"/exe" );
- Pathname myname( filesystem::readlink( p ) );
-
- _val += str::numstring(mypid);
- _val += ":";
- _val += myname.basename();
- }
- return _val;
-}
-
-bool solve()
-{
- static unsigned run = 0;
- USR << "Solve " << run++ << endl;
- bool rres = false;
- {
- zypp::base::LogControl::TmpLineWriter shutUp;
- rres = getZYpp()->resolver()->resolvePool();
- }
- if ( ! rres )
- {
- ERR << "resolve " << rres << endl;
- getZYpp()->resolver()->problems();
- return false;
- }
+#include
+#include
- return true;
-}
+#include
+#include
-typedef sat::ArrayAttrstd::string,std::string FileList;
+using namespace zypp;
/******************************************************************
**
@@ -48,63 +17,27 @@ typedef sat::ArrayAttrstd::string,std::string FileList;
*/
int main( int argc, char * argv[] )
{
+ std::string appname( Pathname::basename( argv[0] ) ); --argc, ++argv;
INT << "===[START]==========================================" << endl;
- Pathname mroot( "/tmp/ToolScanRepos" );
- TestSetup test( mroot, Arch_x86_64 );
- test.loadRepo("/Local/ROOT/cache/solv/@System/solv");
+ TestSetup test( "/tmp/"+appname, Arch_x86_64, TSO_CLEANROOT );
+ test.loadRepo( "http://download.opensuse.org/repositories/Banshee/openSUSE_11.1", "banshee-1.4" );
ResPool pool( test.pool() );
+ ResPoolProxy poolProxy( test.poolProxy() );
+ //dumpRange( MIL, pool.byKindBegin<Package>(), pool.byKindEnd<Package>() ) << endl;
+ for_( it, pool.byKindBegin<Pattern>(), pool.byKindEnd<Pattern>() )
{
- Measure x("filelist");
- unsigned p = 0;
- unsigned f = 0;
- std::string a;
- for_( it, pool.byKindBegin<Package>(), pool.byKindEnd<Package>() )
- {
- ++p;
- f += (*it)->asKind<Package>()->filelist().size();
- for_( i, (*it)->asKind<Package>()->filelist().begin(), (*it)->asKind<Package>()->filelist().end() )
- a = *i;
- }
- SEC << p << " : " << f << endl;
+ MIL << *it << endl;
+ DBG << ui::Selectable::get( *it ) << endl;
}
+ for_( it, poolProxy.byKindBegin<Pattern>(), poolProxy.byKindEnd<Pattern>() )
{
- Measure x("filenames");
- unsigned p = 0;
- unsigned f = 0;
- std::string a;
- for_( it, pool.byKindBegin<Package>(), pool.byKindEnd<Package>() )
- {
- ++p;
- std::liststd::string l( (*it)->asKind<Package>()->filenames() );
- f += l.size();
- for_( i, l.begin(), l.end() )
- a = *i;
- }
- SEC << p << " : " << f << endl;
+ MIL << *it << endl;
}
INT << "===[END]============================================" << endl << endl;
- return 0;
-
-
-
- //ui::Selectable::Ptr getSel( const std::string & name_r )
- getSel<Package>( "gcompris" )->setToInstall();
-
- vdumpPoolStats( USR << "Transacting:"<< endl,
- make_filter_beginresfilter::ByTransact(pool),
- make_filter_endresfilter::ByTransact(pool) ) << endl;
-
- if ( solve() )
- {
- vdumpPoolStats( USR << "Transacting:"<< endl,
- make_filter_beginresfilter::ByTransact(pool),
- make_filter_endresfilter::ByTransact(pool) ) << endl;
- SEC << getSel<Package>( "librsvg" ) << endl;
- }
- INT << "===[END]============================================" << endl << endl;
+ zypp::base::LogControl::TmpLineWriter shutUp;
return 0;
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org