consider ZConfig::solver_allowVendorChange()
authorJán Kupec <jkupec@suse.cz>
Mon, 11 Oct 2010 12:20:22 +0000 (14:20 +0200)
committerJán Kupec <jkupec@suse.cz>
Mon, 11 Oct 2010 12:20:22 +0000 (14:20 +0200)
src/SolverRequester.cc
src/SolverRequester.h

index dda49d8..43526b3 100644 (file)
@@ -173,7 +173,7 @@ void SolverRequester::install(const PackageSpec & pkg)
               updateTo(pkg, *sit);
             else if ((best = s->updateCandidateObj()))
               updateTo(pkg, best);
-            else if (changes_vendor)
+            else if (changes_vendor && !_opts.allow_vendor_change)
               updateTo(pkg, instobj);
             else
               updateTo(pkg, *sit);
@@ -538,7 +538,8 @@ void SolverRequester::updateTo(
     }
 
     // update candidate has different vendor
-    if (!VendorAttr::instance().equivalent(highest->vendor(), installed->vendor()))
+    if (!VendorAttr::instance().equivalent(highest->vendor(), installed->vendor()) &&
+        !_opts.allow_vendor_change)
     {
       addFeedback(Feedback::UPD_CANDIDATE_CHANGES_VENDOR, pkg, selected, installed);
       DBG << "Newer object with different vendor exists: " << highest
index 22a698d..c269ca7 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <string>
 
+#include "zypp/ZConfig.h"
 #include "zypp/PoolItem.h"
 
 #include "Command.h"
@@ -39,6 +40,7 @@ public:
       , force_by_name(false)
       , best_effort(false)
       , skip_interactive(false)
+      , allow_vendor_change(zypp::ZConfig::instance().solver_allowVendorChange())
     {}
 
     void setForceByName(bool value = true);
@@ -76,6 +78,9 @@ public:
      */
     bool skip_interactive;
 
+    /** Whether to ignore vendor when selecting packages */
+    bool allow_vendor_change;
+
     /** Aliases of the repos from which the packages should be installed */
     std::list<std::string> from_repos;
   };