New solver.allowVendorChange option in zypp.conf
authorMichael Andres <ma@suse.de>
Wed, 27 May 2009 11:50:16 +0000 (13:50 +0200)
committerMichael Andres <ma@suse.de>
Wed, 27 May 2009 11:50:16 +0000 (13:50 +0200)
zypp.conf
zypp/ZConfig.cc
zypp/ZConfig.h

index f50ce90..e1c8920 100644 (file)
--- a/zypp.conf
+++ b/zypp.conf
 # solver.onlyRequires = false
 
 ##
+## EXPERTS ONLY: Per default the solver will not replace packages of
+## different vendors, unless you explicitly ask to do so. Setting this
+## option to TRUE will disable this vendor check (unless the application
+## explicitly re-enables it). Packages will then be considered based on
+## repository priority and version only. This may easily damage your system.
+##
+## CHANGING THE DEFAULT IS NOT RECOMMENDED.
+##
+## Valid values:  boolean
+## Default value: false
+##
+# solver.allowVendorChange = false
+
+##
 ## This file contains requirements/conflicts which fulfill the
 ## needs of a running system.
 ## For example the system would be broken if not glibc or kernel is
index ceab33f..7e17ad0 100644 (file)
@@ -208,7 +208,6 @@ namespace zypp
         , download_min_download_speed(0)
         , download_max_download_speed(0)
         , download_max_silent_tries(5)
-       , solver_onlyRequires           ( false )
         , apply_locks_file              ( true )
 
       {
@@ -329,7 +328,11 @@ namespace zypp
                 }
                 else if ( entry == "solver.onlyRequires" )
                 {
-                  solver_onlyRequires = str::strToBool( value, solver_onlyRequires );
+                  solver_onlyRequires.set( str::strToBool( value, solver_onlyRequires.get() ) );
+                }
+                else if ( entry == "solver.allowVendorChange" )
+                {
+                  solver_allowVendorChange.set( str::strToBool( value, solver_allowVendorChange.get() ) );
                 }
                 else if ( entry == "solver.checkSystemFile" )
                 {
@@ -441,7 +444,8 @@ namespace zypp
     int download_max_download_speed;
     int download_max_silent_tries;
 
-    bool solver_onlyRequires;
+    Option<bool,false> solver_onlyRequires;
+    Option<bool,false> solver_allowVendorChange;
     Pathname solver_checkSystemFile;
 
     std::set<IdString> multiversion;
@@ -646,7 +650,10 @@ namespace zypp
   { return _pimpl->download_max_silent_tries; }
 
   bool ZConfig::solver_onlyRequires() const
-  { return _pimpl->solver_onlyRequires; }
+  { return _pimpl->solver_onlyRequires.get(); }
+
+  bool ZConfig::solver_allowVendorChange() const
+  { return _pimpl->solver_allowVendorChange.get(); }
 
   Pathname ZConfig::solver_checkSystemFile() const
   { return ( _pimpl->solver_checkSystemFile.empty()
@@ -662,9 +669,7 @@ namespace zypp
   { return _pimpl->multiversion.erase(IdString(name)); }
 
   bool ZConfig::apply_locks_file() const
-  {
-    return _pimpl->apply_locks_file;
-  }
+  { return _pimpl->apply_locks_file; }
 
   Pathname ZConfig::update_dataPath() const
   {
index 42f602e..6d66838 100644 (file)
@@ -229,6 +229,11 @@ namespace zypp
       Pathname solver_checkSystemFile() const;
 
       /**
+       * Whether vendor check is by default enabled.
+       */
+      bool solver_allowVendorChange() const;
+
+      /**
        * Packages which can be installed parallel with different versions
        * Returning a set of package names (IdString)
        */