Author: aschnell Date: Thu Jul 19 13:59:00 2007 New Revision: 6088 URL: http://svn.opensuse.org/viewcvs/zypp?rev=6088&view=rev Log: - do not mess with system repo, cache et.al. Modified: trunk/libzypp/devel/devel.aschnell/parse1.cc Modified: trunk/libzypp/devel/devel.aschnell/parse1.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.aschnell/parse1.cc?rev=6088&r1=6087&r2=6088&view=diff ============================================================================== --- trunk/libzypp/devel/devel.aschnell/parse1.cc (original) +++ trunk/libzypp/devel/devel.aschnell/parse1.cc Thu Jul 19 13:59:00 2007 @@ -18,10 +18,12 @@ #include "zypp/NameKindProxy.h" #include "zypp/RepoManager.h" #include "zypp/RepoInfo.h" +#include "zypp/TmpPath.h" using namespace std; using namespace zypp; +using namespace zypp::filesystem; int @@ -29,33 +31,37 @@ { MIL << "===[START]==========================================" << endl; - // TODO: tell RepoManager and SQLite to use different path + TmpDir tmpCachePath; + TmpDir tmpRawCachePath; + TmpDir tmpKnownReposPath; + + RepoManagerOptions opts; + opts.repoCachePath = tmpCachePath.path(); + opts.repoRawCachePath = tmpRawCachePath.path(); + opts.knownReposPath = tmpKnownReposPath.path(); - RepoManager repoManager; - RepoInfoList repos = repoManager.knownRepositories(); - -#if 1 - if ( repos.empty() ) - { - RepoInfo nrepo; - nrepo - .setAlias( "factorytest" ) - .setName( "Test Repo for factory." ) - .setEnabled( true ) - .setAutorefresh( false ) - .addBaseUrl(Url("ftp://dist.suse.de/install/stable-x86/")); - // .addBaseUrl(Url("http://software.opensuse.org/download/home:/Arvin42/openSUSE_Factory/")); - // .addBaseUrl(Url("file:///ARVIN/zypp/trunk/repotools/")); + RepoManager repoManager (opts); - repoManager.addRepository( nrepo ); - repos = repoManager.knownRepositories(); + RepoInfoList repos = repoManager.knownRepositories(); + if ( !repos.empty() ) + ERR << "repos not empty" << endl; - SEC << "refreshMetadata" << endl; - repoManager.refreshMetadata( nrepo ); - SEC << "buildCache" << endl; - repoManager.buildCache( nrepo ); - } -#endif + RepoInfo nrepo; + nrepo.setAlias( "factorytest" ) + .setName( "Test Repo for factory." ) + .setEnabled( true ) + .setAutorefresh( false ) + .addBaseUrl(Url("ftp://dist.suse.de/install/stable-x86/")); + // .addBaseUrl(Url("http://software.opensuse.org/download/home:/Arvin42/openSUSE_Factory/")); + // .addBaseUrl(Url("file:///ARVIN/zypp/trunk/repotools/")); + + repoManager.addRepository( nrepo ); + repos = repoManager.knownRepositories(); + + SEC << "refreshMetadata" << endl; + repoManager.refreshMetadata( nrepo ); + SEC << "buildCache" << endl; + repoManager.buildCache( nrepo ); ResPool pool( getZYpp()->pool() ); @@ -65,21 +71,17 @@ { RepoInfo& nrepo( *it ); -#if 1 SEC << "refreshMetadata" << endl; repoManager.refreshMetadata( nrepo ); SEC << "buildCache" << endl; repoManager.buildCache( nrepo ); -#endif // here SQLite is upto-date -#if 1 SEC << nrepo << endl; Repository nrep( repoManager.createFromCache( nrepo ) ); const zypp::ResStore& store( nrep.resolvables() ); getZYpp()->addResolvables( store ); -#endif } USR << "pool: " << pool << endl; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org