ResPool pool( ResPool::instance() );
sat::Pool satpool( sat::Pool::instance() );
- if ( 1 )
+ if ( 0 )
{
Measure x( "INIT TARGET" );
{
}
}
- if ( 1 )
+ if ( 0 )
{
RepoManager repoManager( makeRepoManager( sysRoot ) );
RepoInfoList repos = repoManager.knownRepositories();
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
- if ( 0 )
+ RepoManager repoManager( makeRepoManager( sysRoot ) );
+ RepoInfoList repos = repoManager.knownRepositories();
+ // launch repos
+ for ( RepoInfoList::iterator it = repos.begin(); it != repos.end(); ++it )
{
- PoolItem pi ( getPi<Patch>("xorg-x11-Xvnc") );
- MIL << pi << endl;
- if ( pi )
- {
- Patch::constPtr p( pi->asKind<Patch>() );
- INT << p->contents() << endl;
- }
- }
-
- SEC << "baseproduct: " << getZYpp()->target()->baseProduct() << endl;
+ RepoInfo & nrepo( *it );
+ Url url_r( nrepo.url() );
+ SEC << url_r << endl;
+ MIL << RepoManager::makeStupidAlias( url_r ) << endl;
+ }
+ MIL << RepoManager::makeStupidAlias() << endl;
+ MIL << RepoManager::makeStupidAlias() << endl;
+ MIL << RepoManager::makeStupidAlias() << endl;
#if 0
getZYpp()->resolver()->addRequire( Capability("amarok") );
USR << "Solve " << run++ << endl;
bool rres = false;
{
- zypp::base::LogControl::TmpLineWriter shutUp;
+ //zypp::base::LogControl::TmpLineWriter shutUp;
+ getZYpp()->resolver()->setOnlyRequires( true );
+ getZYpp()->resolver()->setIgnoreAlreadyRecommended( true );
rres = getZYpp()->resolver()->resolvePool();
}
if ( ! rres )
typedef sat::ArrayAttr<std::string,std::string> FileList;
+#include "zypp/base/IOStream.h"
+bool isProcessRunning(pid_t pid_r)
+{
+ std::string _locker_name;
+ // it is another program, not me, see if it is still running
+ Pathname procdir( Pathname("/proc")/str::numstring(pid_r) );
+ PathInfo status( procdir );
+ MIL << "Checking " << status << endl;
+
+ if ( ! status.isDir() )
+ {
+ DBG << "No such process." << endl;
+ return false;
+ }
+
+ static char buffer[513];
+ buffer[0] = buffer[512] = 0;
+ // man proc(5): /proc/[pid]/cmdline is empty if zombie.
+ if ( std::ifstream( (procdir/"cmdline").c_str() ).read( buffer, 512 ).gcount() > 0 )
+ {
+ _locker_name = buffer;
+ DBG << "Is running: " << _locker_name << endl;
+ return true;
+ }
+
+ DBG << "In zombie state." << endl;
+ return false;
+ }
+
+
/******************************************************************
**
** FUNCTION NAME : main
{
INT << "===[START]==========================================" << endl;
- Pathname mroot( "/tmp/ToolScanRepos" );
- TestSetup test( mroot, Arch_x86_64 );
- test.loadRepo("/Local/ROOT/cache/solv/@System/solv");
-
- ResPool pool( test.pool() );
- {
- 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;
- }
- {
- Measure x("filenames");
- unsigned p = 0;
- unsigned f = 0;
- std::string a;
- for_( it, pool.byKindBegin<Package>(), pool.byKindEnd<Package>() )
- {
- ++p;
- std::list<std::string> l( (*it)->asKind<Package>()->filenames() );
- f += l.size();
- for_( i, l.begin(), l.end() )
- a = *i;
- }
- SEC << p << " : " << f << endl;
- }
-
+ INT << isProcessRunning( 26992 ) << endl;
+ INT << isProcessRunning( getpid() ) << endl;;
+ INT << isProcessRunning( 10430 ) << endl;
+ INT << isProcessRunning( 55 ) << endl;
INT << "===[END]============================================" << endl << endl;
return 0;
+ Pathname mroot( "/tmp/ToolScanRepos" );
+ TestSetup test( mroot, Arch_i686, TSO_CLEANROOT );
+ test.loadRepo( "/schnell/CD-ARCHIVE/11.1/FTP" );
+ test.loadRepo( "/suse/ma/bug-481836_test.solv" );
+ //test.loadRepos();
- //ui::Selectable::Ptr getSel( const std::string & name_r )
- getSel<Package>( "gcompris" )->setToInstall();
+ ResPool pool( test.pool() );
+ Resolver & resolver( test.resolver() );
+
+ //dumpRange( USR, pool.begin(), pool.end() );
- vdumpPoolStats( USR << "Transacting:"<< endl,
- make_filter_begin<resfilter::ByTransact>(pool),
- make_filter_end<resfilter::ByTransact>(pool) ) << endl;
+ resolver.addRequire( Capability("filesystem") );
+ resolver.addRequire( Capability("glibc-locale") );
+ resolver.addRequire( Capability("glibc.i586 = 2.9-2.8") );
+ resolver.addRequire( Capability("xorg-x11-driver-video-openchrome") );
+ resolver.addRequire( Capability("zypper") );
if ( solve() )
{
vdumpPoolStats( USR << "Transacting:"<< endl,
make_filter_begin<resfilter::ByTransact>(pool),
make_filter_end<resfilter::ByTransact>(pool) ) << endl;
- SEC << getSel<Package>( "librsvg" ) << endl;
}
+
+
INT << "===[END]============================================" << endl << endl;
return 0;
}