getZYpp()->initializeTarget( sysRoot );
}
getZYpp()->target()->load();
- USR << getZYpp()->target()->targetDistribution() << endl;
- USR << getZYpp()->target()->targetDistributionRelease() << endl;
+ USR << "targetDistribution: " << getZYpp()->target()->targetDistribution() << endl;
+ USR << "targetDistributionRelease: " << getZYpp()->target()->targetDistributionRelease() << endl;
dumpRange( USR << "Product ", pool.byKindBegin<Product>(), pool.byKindEnd<Product>() ) << endl;
}
}
#include "Tools.h"
-#include "ExplicitMap.h"
-#include <boost/call_traits.hpp>
-
-#include <iostream>
-#include <fstream>
-#include <map>
-
-#include <zypp/base/LogControl.h>
-#include <zypp/base/LogTools.h>
-#include "zypp/base/Exception.h"
-#include "zypp/base/InputStream.h"
-#include "zypp/base/DefaultIntegral.h"
-#include <zypp/base/Function.h>
-#include <zypp/base/Iterator.h>
-
-#include <zypp/Pathname.h>
-#include <zypp/Edition.h>
-#include <zypp/CheckSum.h>
-#include <zypp/Date.h>
-
-using namespace std;
-using namespace zypp;
-
-///////////////////////////////////////////////////////////////////
/******************************************************************
**
{
INT << "===[START]==========================================" << endl;
+ // https://bugzilla.novell.com/show_bug.cgi?id=442200
+
+ Pathname mroot( "/tmp/ToolScanRepos" );
+ TestSetup test( mroot, Arch_x86_64 );
+ test.loadRepos();
+
+
INT << "===[END]============================================" << endl << endl;
return 0;
}
if ( ! argc )
{
- cerr << "Usage: " << appname << " URL..." << endl;
- cerr << " Load repos from URL to test system below /tmp/" << appname << endl;
+ cerr << "Usage: " << appname << "[OPTIONS] URL..." << endl;
+ cerr << " Load repos from URL to test system below /tmp/" << appname << "." << endl;
+ cerr << " --nc Do not clear an existing test system but reuse it." << endl;
return 0;
}
Pathname mroot( "/tmp/"+appname );
- filesystem::recursive_rmdir( mroot );
+ if ( argc && argv[0] == std::string("--nc") )
+ {
+ --argc;
+ ++argv;
+ }
+ else
+ {
+ filesystem::recursive_rmdir( mroot );
+ }
filesystem::assert_dir( mroot );
TestSetup test( mroot, Arch_x86_64 );
void loadRepo( RepoInfo nrepo )
{
RepoManager rmanager( repomanager() );
+ rmanager.addRepository( nrepo );
rmanager.buildCache( nrepo );
rmanager.loadFromCache( nrepo );
}
satpool().addRepoSolv( path_r, nrepo );
}
+ public:
+ /** Load all enabled repos in repos.d to pool. */
+ void loadRepos()
+ {
+ RepoManager repoManager( repomanager() );
+ RepoInfoList repos = repoManager.knownRepositories();
+ for ( RepoInfoList::iterator it = repos.begin(); it != repos.end(); ++it )
+ {
+ RepoInfo & nrepo( *it );
+ USR << nrepo << endl;
+
+ if ( ! nrepo.enabled() )
+ continue;
+
+ if ( ! repoManager.isCached( nrepo ) || nrepo.type() == repo::RepoType::RPMPLAINDIR )
+ {
+ if ( repoManager.isCached( nrepo ) )
+ {
+ USR << "cleanCache" << endl;
+ repoManager.cleanCache( nrepo );
+ }
+ //USR << "refreshMetadata" << endl;
+ //repoManager.refreshMetadata( nrepo );
+ USR << "buildCache" << endl;
+ repoManager.buildCache( nrepo );
+ }
+ USR << "Create from cache" << endl;
+ repoManager.loadFromCache( nrepo );
+ }
+
+ }
private:
void _ctor( const Pathname & rootdir_r, const Arch & sysarch_r )
{