- solutions: keep/lock will be done by APPL_HIGH. So they will not be
authorStefan Schubert <schubi@suse.de>
Thu, 30 Oct 2008 13:24:39 +0000 (13:24 +0000)
committerStefan Schubert <schubi@suse.de>
Thu, 30 Oct 2008 13:24:39 +0000 (13:24 +0000)
  saved in the lockfiles
- "keep obsolete" will be handled with lock by APPL_HIGH (bnc #439134)

zypp/ResStatus.h
zypp/solver/detail/SATResolver.cc
zypp/solver/detail/SolutionAction.cc
zypp/solver/detail/SolutionAction.h

index ca76654..760d83e 100644 (file)
@@ -365,7 +365,7 @@ namespace zypp
            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.
index e19c98f..a52bfff 100644 (file)
@@ -280,15 +280,15 @@ SATSolutionToPool (PoolItem item, const ResStatus & status, const ResStatus::Tra
     // 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;
@@ -1189,7 +1189,7 @@ SATResolver::problems ()
                        {
                            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);
index b307db5..c2498ea 100644 (file)
@@ -65,6 +65,7 @@ TransactionSolutionAction::dumpOn( ostream& os) const
        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;
@@ -132,7 +133,8 @@ TransactionSolutionAction::execute(Resolver & resolver) const
     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())
@@ -153,6 +155,11 @@ TransactionSolutionAction::execute(Resolver & resolver) const
            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;
index 9da7262..2b03a6c 100644 (file)
@@ -69,6 +69,7 @@ namespace zypp
            INSTALL,
            REMOVE,
            UNLOCK,
+           LOCK,
            REMOVE_EXTRA_REQUIRE,
            REMOVE_EXTRA_CONFLICT,
            ADD_SOLVE_QUEUE_ITEM,