Author: lslezak Date: Mon Aug 18 15:24:20 2008 New Revision: 50181 URL: http://svn.opensuse.org/viewcvs/yast?rev=50181&view=rev Log: - ui::Selectable in PkgInstall() and PkgDelete() Modified: branches/tmp/lslezak/pkg-bindings/src/Package.cc Modified: branches/tmp/lslezak/pkg-bindings/src/Package.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/pkg-bindings/src/Package.cc?rev=50181&r1=50180&r2=50181&view=diff ============================================================================== --- branches/tmp/lslezak/pkg-bindings/src/Package.cc (original) +++ branches/tmp/lslezak/pkg-bindings/src/Package.cc Mon Aug 18 15:24:20 2008 @@ -1739,9 +1739,15 @@ if (name.empty()) return YCPBoolean (false); - // ensure installation of the 'best' architecture + bool ret = false; + zypp::ui::Selectable::Ptr selectable = zypp::ui::Selectable::get(name); - return YCPBoolean( DoProvideNameKind( name, zypp::ResKind::package, zypp::ZConfig::instance().systemArchitecture(), "") ); + if (selectable) + { + ret = selectable->setToInstall(whoWantsIt); + } + + return YCPBoolean(ret); } /** @@ -1781,31 +1787,19 @@ if (name.empty()) return YCPBoolean (false); - bool ret = true; + bool ret = false; try { - bool found = false; - - for (zypp::ResPool::byIdent_iterator it = zypp_ptr()->pool().byIdentBeginzypp::Package(name); - it != zypp_ptr()->pool().byIdentEndzypp::Package(name); ++it) - { - // is it an installed package? - if (it->status().isInstalled()) - { - found = true; - ret = it->status().setToBeUninstalled(whoWantsIt) && ret; - } - } + zypp::ui::Selectable::Ptr selectable = zypp::ui::Selectable::get(name); - if (!found) + if (selectable) { - ret = false; + ret = selectable->setToDelete(whoWantsIt); } } catch (...) { - ret = false; } return YCPBoolean(ret); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org