Use VendorAttr::equivalent to compare vendors (bnc #605380)
authorJán Kupec <jkupec@suse.cz>
Mon, 11 Oct 2010 11:47:21 +0000 (13:47 +0200)
committerJán Kupec <jkupec@suse.cz>
Mon, 11 Oct 2010 11:47:21 +0000 (13:47 +0200)
src/SolverRequester.cc
src/Summary.cc

index d4e1d85..dda49d8 100644 (file)
@@ -163,8 +163,10 @@ void SolverRequester::install(const PackageSpec & pkg)
                 || pkg.parsed_cap.detail().hasArch()
                 || !_opts.from_repos.empty()
                 || !pkg.repo_alias.empty();
+
             // check vendor (since PoolItemBest does not do it)
-            bool changes_vendor = instobj->vendor() != (*sit)->vendor();
+            bool changes_vendor = ! VendorAttr::instance().equivalent(
+                instobj->vendor(), (*sit)->vendor());
 
             PoolItem best;
             if (userconstraints)
@@ -536,7 +538,7 @@ void SolverRequester::updateTo(
     }
 
     // update candidate has different vendor
-    if (highest->vendor() != installed->vendor())
+    if (!VendorAttr::instance().equivalent(highest->vendor(), installed->vendor()))
     {
       addFeedback(Feedback::UPD_CANDIDATE_CHANGES_VENDOR, pkg, selected, installed);
       DBG << "Newer object with different vendor exists: " << highest
index 518df2c..1f44177 100644 (file)
@@ -169,7 +169,7 @@ void Summary::readPool(const zypp::ResPool & pool)
             toupgrade[res->kind()].insert(rp);
             if (res->arch() != (*rmit)->arch())
               tochangearch[res->kind()].insert(rp);
-            if (res->vendor() != (*rmit)->vendor())
+            if (!VendorAttr::instance().equivalent(res->vendor(), (*rmit)->vendor()))
               tochangevendor[res->kind()].insert(rp);
           }
           // reinstall
@@ -179,7 +179,7 @@ void Summary::readPool(const zypp::ResPool & pool)
               tochangearch[res->kind()].insert(rp);
             else
               toreinstall[res->kind()].insert(rp);
-            if (res->vendor() != (*rmit)->vendor())
+            if (!VendorAttr::instance().equivalent(res->vendor(), (*rmit)->vendor()))
               tochangevendor[res->kind()].insert(rp);
           }
           // downgrade
@@ -188,7 +188,7 @@ void Summary::readPool(const zypp::ResPool & pool)
             todowngrade[res->kind()].insert(rp);
             if (res->arch() != (*rmit)->arch())
               tochangearch[res->kind()].insert(rp);
-            if (res->vendor() != (*rmit)->vendor())
+            if (!VendorAttr::instance().equivalent(res->vendor(), (*rmit)->vendor()))
               tochangevendor[res->kind()].insert(rp);
           }
 
@@ -405,9 +405,8 @@ void Summary::writeResolvableList(ostream & out, const ResPairSet & resolvables)
     }
     if (_viewop & SHOW_VENDOR)
     {
-      if (resit->first && resit->first->vendor() != resit->second->vendor())
-        tr << resit->first->vendor() + " -> " +
-              resit->second->vendor();
+      if (resit->first && ! VendorAttr::instance().equivalent(resit->first->vendor(), resit->second->vendor()))
+        tr << resit->first->vendor() + " -> " + resit->second->vendor();
       else
         tr << resit->second->vendor();
     }