- Fix solvers inappropriate selection as byUSER (bnc 455965)
authorMichael Andres <ma@suse.de>
Fri, 5 Dec 2008 13:28:47 +0000 (13:28 +0000)
committerMichael Andres <ma@suse.de>
Fri, 5 Dec 2008 13:28:47 +0000 (13:28 +0000)
VERSION.cmake
devel/devel.ma/Test.cc
package/libzypp.changes
zypp/HistoryLog.cc
zypp/solver/detail/SATResolver.cc

index 3882ed2..2c67ede 100644 (file)
@@ -61,8 +61,8 @@
 SET(LIBZYPP_MAJOR "5")
 SET(LIBZYPP_COMPATMINOR "23")
 SET(LIBZYPP_MINOR "24")
-SET(LIBZYPP_PATCH "5")
+SET(LIBZYPP_PATCH "6")
 #
-# LAST RELEASED: 5.24.5 (23)
+# LAST RELEASED: 5.24.6 (23)
 # (The number in parenthesis is LIBZYPP_COMPATMINOR)
 #=======
index 82ed627..6960e05 100644 (file)
@@ -3,6 +3,22 @@
 
 #include <zypp/sat/LookupAttr.h>
 
+  static std::string pidAndAppname()
+  {
+    static std::string _val;
+    if ( _val.empty() )
+    {
+      pid_t mypid = getpid();
+      Pathname p( "/proc/"+str::numstring(mypid)+"/exe" );
+      Pathname myname( filesystem::readlink( p ) );
+
+      _val += str::numstring(mypid);
+      _val += ":";
+      _val += myname.basename();
+    }
+    return _val;
+  }
+
 /******************************************************************
 **
 **      FUNCTION NAME : main
@@ -12,6 +28,11 @@ int main( int argc, char * argv[] )
 {
   INT << "===[START]==========================================" << endl;
 
+  SEC << pidAndAppname() << endl;
+
+
+  INT << "===[END]============================================" << endl << endl;
+  return 0;
   Pathname mroot( "/tmp/Bb" );
   TestSetup test( mroot, Arch_x86_64 );
   test.loadRepo( "/Local/ROOT/cache/raw/11.1-update" );
@@ -36,6 +57,8 @@ int main( int argc, char * argv[] )
     MIL << it << endl;
   }
 
+
+
   INT << "===[END]============================================" << endl << endl;
   return 0;
 }
index 3e2913c..a281c7f 100644 (file)
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Fri Dec  5 14:22:11 CET 2008 - ma@suse.de
+
+- Fix solvers inappropriate selection as byUSER (bnc 455965)
+- revision 11891
+- version 5.24.6 (23)
+
+-------------------------------------------------------------------
 Thu Dec  4 11:10:35 CET 2008 - coolo@suse.de
 
 - fix %post script to not warn on fresh install
index 72df3b7..7982d35 100644 (file)
@@ -47,6 +47,22 @@ namespace
     }
     return result;
   }
+
+  static std::string pidAndAppname()
+  {
+    static std::string _val;
+    if ( _val.empty() )
+    {
+      pid_t mypid = getpid();
+      zypp::Pathname p( "/proc/"+zypp::str::numstring(mypid)+"/exe" );
+      zypp::Pathname myname( zypp::filesystem::readlink( p ) );
+
+      _val += zypp::str::numstring(mypid);
+      _val += ":";
+      _val += myname.basename();
+    }
+    return _val;
+  }
 }
 
 namespace zypp
@@ -239,10 +255,11 @@ namespace zypp
       << _sep << p->edition()                          // 4 evr
       << _sep << p->arch();                            // 5 arch
 
-    if (pi.status().isByUser())
+    // ApplLow is what the solver selected on behalf of the user.
+    if (pi.status().isByUser() || pi.status().isByApplLow() )
       _log << _sep << userAtHostname();                // 6 reqested by
-    //else if (pi.status().isByApplHigh() || pi.status().isByApplLow())
-    //  _log << _sep << "appl";
+    else if (pi.status().isByApplHigh())
+      _log << _sep << pidAndAppname();
     else
       _log << _sep;
 
@@ -269,10 +286,11 @@ namespace zypp
       << _sep << p->edition()                          // 4 evr
       << _sep << p->arch();                            // 5 arch
 
-    if (pi.status().isByUser())
+    // ApplLow is what the solver selected on behalf of the user.
+    if ( pi.status().isByUser() || pi.status().isByApplLow() )
       _log << _sep << userAtHostname();                // 6 reqested by
-    //else if (pi.status().isByApplHigh() || pi.status().isByApplLow())
-    //  _log << _sep << "appl";
+    else if (pi.status().isByApplHigh())
+      _log << _sep << pidAndAppname();
     else
       _log << _sep;
 
index 955e80d..848bd87 100644 (file)
@@ -584,17 +584,15 @@ SATResolver::solving(const CapabilitySet & requires_caps,
     }
 
     // Solvables which were selected due requirements which have been made by the user will
-    // be selected by USER.
-    // FIXME: The request queue should contains the TransactBy field
-    // ma: this is also deadly for the UI as it converts the requirement into a fix selection,
-    //     which will serve as user input on the next solver run.
+    // be selected by APPL_LOW. We can't use any higher level, because this setting must
+    // not serve as a request for the next solver run. APPL_LOW is reset before solving.
     for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
        sat::WhatProvides rpmProviders(*iter);
        for_( iter2, rpmProviders.begin(), rpmProviders.end() ) {
            PoolItem poolItem(*iter2);
            if (poolItem.status().isToBeInstalled()) {
                MIL << "User requirement " << *iter << " sets " << poolItem << endl;
-               poolItem.status().setTransactByValue (ResStatus::USER);
+               poolItem.status().setTransactByValue (ResStatus::APPL_LOW);
            }
        }
     }
@@ -604,7 +602,7 @@ SATResolver::solving(const CapabilitySet & requires_caps,
            PoolItem poolItem(*iter2);
            if (poolItem.status().isToBeUninstalled()) {
                MIL << "User conflict " << *iter << " sets " << poolItem << endl;
-               poolItem.status().setTransactByValue (ResStatus::USER);
+               poolItem.status().setTransactByValue (ResStatus::APPL_LOW);
            }
        }
     }