Author: lslezak Date: Mon Aug 18 15:34:08 2008 New Revision: 50182 URL: http://svn.opensuse.org/viewcvs/yast?rev=50182&view=rev Log: - ui::Selectable in PkgTaboo() and PkgNeutral() 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=50182&r1=50181&r2=50182&view=diff ============================================================================== --- branches/tmp/lslezak/pkg-bindings/src/Package.cc (original) +++ branches/tmp/lslezak/pkg-bindings/src/Package.cc Mon Aug 18 15:34:08 2008 @@ -1821,37 +1821,20 @@ if (name.empty()) return YCPBoolean (false); - bool ret = true; + bool ret = false; try { - bool found = false; + zypp::ui::Selectable::Ptr selectable = zypp::ui::Selectable::get(name); - for (zypp::ResPool::byIdent_iterator it = zypp_ptr()->pool().byIdentBeginzypp::Package(name); - it != zypp_ptr()->pool().byIdentEndzypp::Package(name); ++it) + if (selectable) { - // installed package cannot be set to taboo - if (!it->status().isInstalled()) - { - found = true; - - bool res = it->status().resetTransact(whoWantsIt) - // lock the package at the USER level (bug #186205) - && it->status().resetTransact(zypp::ResStatus::USER) - && it->status().setLock(true, zypp::ResStatus::USER); - - ret = ret && res; - } - } - - if (!found) - { - ret = false; + // lock the package at the USER level (bug #186205) + ret = selectable->setStatus(zypp::ui::S_Taboo, zypp::ResStatus::USER); } } catch (...) { - ret = false; } return YCPBoolean(ret); @@ -1873,27 +1856,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) - { - found = true; - ret = it->status().resetTransact(whoWantsIt) && ret; - } + zypp::ui::Selectable::Ptr selectable = zypp::ui::Selectable::get(name); - if (!found) + if (selectable) { - ret = false; + ret = selectable->unset(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