return str::form(_("Selecting '%s' for removal."),
resolvable_user_string(*_objsel.resolvable()).c_str());
+ case INSTALLED_LOCKED:
+ {
+ ostringstream cmdhint;
+ cmdhint << "zypper removelock " << _objsel->name();
+ return str::form(
+ _("'%s' is locked. Use '%s' to unlock it."),
+ _objsel->name().c_str(), cmdhint.str().c_str());
+ }
+
case ADDED_REQUIREMENT:
return str::form(_("Adding requirement: '%s'."), _reqpkg.parsed_cap.asString().c_str());
case ADDED_CONFLICT:
out.info(asUserString(opts), Out::HIGH);
break;
+ case INSTALLED_LOCKED:
+ out.warning(asUserString(opts), Out::HIGH);
+ break;
case PATCH_INTERACTIVE_SKIPPED:
out.warning(asUserString(opts));
break;
pi.status().setToBeInstalled(ResStatus::USER);
addFeedback(Feedback::FORCED_INSTALL, PackageSpec(), pi);
}
+ else if ( asSelectable()(pi)->locked() )
+ {
+ // Workaround: Use a solver request instead of selecting the item.
+ // This will enable the solver to report the lock conflict, while
+ // selecting the item will silently remove the lock.
+ // Basically the right way but zypp solver job API needs polishing
+ // as ther are better jobs than 'addRequire'.
+ sat::Solvable solv( pi.satSolvable() );
+ Capability cap( solv.arch(), solv.name(), Rel::EQ, solv.edition(), solv.kind() );
+ zypp::getZYpp()->resolver()->addRequire( cap );
+ _requires.insert( cap );
+ addFeedback(Feedback::SET_TO_INSTALL, PackageSpec(), pi);
+ addFeedback(Feedback::INSTALLED_LOCKED, PackageSpec(), pi);
+ return;
+ }
else
{
asSelectable()(pi)->setOnSystem(pi, ResStatus::USER);
void SolverRequester::setToRemove(const zypp::PoolItem & pi)
{
+ if ( asSelectable()(pi)->locked() )
+ {
+ // Workaround: Use a solver request instead of selecting the item.
+ // This will enable the solver to report the lock conflict, while
+ // selecting the item will silently remove the lock.
+ // Basically the right way but zypp solver job API needs polishing
+ // as ther are better jobs than 'addRequire'.
+ sat::Solvable solv( pi.satSolvable() );
+ Capability cap( solv.arch(), solv.name(), Rel::EQ, solv.edition(), solv.kind() );
+ zypp::getZYpp()->resolver()->addConflict( cap );
+ _conflicts.insert( cap );
+ addFeedback(Feedback::SET_TO_REMOVE, PackageSpec(), pi);
+ addFeedback(Feedback::INSTALLED_LOCKED, PackageSpec(), pi);
+ return;
+ }
pi.status().setToBeUninstalled(ResStatus::USER);
addFeedback(Feedback::SET_TO_REMOVE, PackageSpec(), pi);
_toremove.insert(pi);