return true;
}
// Here: Lock status is to be changed:
- if ( causer_r != USER )
+ if ( causer_r != USER && causer_r != APPL_HIGH)
return false;
// Setting no transact removes an existing lock,
// or brings this into KEEP_STATE, and we apply the lock.
// installation/deletion
if (status.isToBeInstalled()) {
r = item.status().setToBeInstalled (causer);
- _XDEBUG("SATSolutionToPool(" << item << ", " << status << ") install !" << r);
+ _XDEBUG("SATSolutionToPool install returns " << item << ", " << r);
}
else if (status.isToBeUninstalledDueToUpgrade()) {
r = item.status().setToBeUninstalledDueToUpgrade (causer);
- _XDEBUG("SATSolutionToPool(" << item << ", " << status << ") upgrade !" << r);
+ _XDEBUG("SATSolutionToPool upgrade returns " << item << ", " << r);
}
else if (status.isToBeUninstalled()) {
r = item.status().setToBeUninstalled (causer);
- _XDEBUG("SATSolutionToPool(" << item << ", " << status << ") remove !" << r);
+ _XDEBUG("SATSolutionToPool remove returns " << item << ", " << r);
}
return;
{
PoolItem poolItem = _pool.find (s);
if (poolItem) {
- problemSolution->addSingleAction (poolItem, KEEP);
+ problemSolution->addSingleAction (poolItem, LOCK); // for solver reason: NOT weak lock.
string description = str::form (_("keep %s"), solvable2str(pool, s.get()));
MIL << description << endl;
problemSolution->addDescription (description);
case INSTALL: os << "Install " << _item; break;
case REMOVE: os << "Remove " << _item; break;
case UNLOCK: os << "Unlock " << _item; break;
+ case LOCK: os << "Lock " << _item; break;
case REMOVE_EXTRA_REQUIRE: os << "Remove require " << _capability; break;
case REMOVE_EXTRA_CONFLICT: os << "Remove conflict " << _capability; break;
case ADD_SOLVE_QUEUE_ITEM: os << "Add SolveQueueItem " << _solverQueueItem; break;
bool ret = true;
switch (action()) {
case KEEP:
- ret = _item.status().setTransact (false, ResStatus::USER);
+ _item.status().resetTransact (ResStatus::USER);
+ ret = _item.status().setTransact (false, ResStatus::APPL_HIGH); // APPL_HIGH: Locking should not be saved permanently
break;
case INSTALL:
if (_item.status().isToBeUninstalled())
ret = _item.status().setLock (false, ResStatus::USER);
if (!ret) ERR << "Cannot unlock " << _item << endl;
break;
+ case LOCK:
+ _item.status().resetTransact (ResStatus::USER);
+ ret = _item.status().setLock (true, ResStatus::APPL_HIGH); // APPL_HIGH: Locking should not be saved permanently
+ if (!ret) ERR << "Cannot lock " << _item << endl;
+ break;
case REMOVE_EXTRA_REQUIRE:
resolver.removeExtraRequire (_capability);
break;
INSTALL,
REMOVE,
UNLOCK,
+ LOCK,
REMOVE_EXTRA_REQUIRE,
REMOVE_EXTRA_CONFLICT,
ADD_SOLVE_QUEUE_ITEM,