INT << "===[START]==========================================" << endl;
// initialize target
- ZYpp::Ptr zypp = ZYppFactory().letsTest();
+ ZYpp::Ptr zypp = ZYppFactory::instance().getZYpp();
zypp->initTarget("/");
Target_Ptr target = zypp->target();
-
- // initialize source
- SourceManager_Ptr mgr = SourceManager::sourceManager();
- unsigned id = mgr->addSource(Url("http://lide.suse.cz/~~jsrain/devel.jsrain"));
- Source & src = mgr->findSource(id);
- ResStore store = src.resolvables();
+ target->setInstallationLogfile("/tmp/instlog");
RpmDb & rpm = target->rpmDb();
- for (ResStore::const_iterator it = store.begin();
- it != store.end();
- it++)
- {
- if (isKind<Package>(*it))
- {
- Package::Ptr p = dynamic_pointer_cast<Package>(*it);
- try {
- Pathname path = p->getPlainRpm();
- rpm.installPackage(path);
- }
- catch (...)
- {}
- }
- }
-
+rpm.installPackage("/tmp/xxx.rpm");
+
INT << "===[END]============================================" << endl;
return 0;