Mailinglist Archive: zypp-commit (325 mails)

< Previous Next >
[zypp-commit] r7132 - /trunk/libzypp/zypp/solver/detail/ResolverUpgrade.cc
  • From: schubi2@xxxxxxxxxxxxxxxx
  • Date: Thu, 06 Sep 2007 16:19:52 -0000
  • Message-id: <20070906161953.1E19E26BC6@xxxxxxxxxxxxxxxx>
Author: schubi2
Date: Thu Sep  6 18:19:52 2007
New Revision: 7132

URL: http://svn.opensuse.org/viewcvs/zypp?rev=7132&view=rev
Log:
if there is a candidate which is already selected for installation -->
take thatone #308082

Modified:
    trunk/libzypp/zypp/solver/detail/ResolverUpgrade.cc

Modified: trunk/libzypp/zypp/solver/detail/ResolverUpgrade.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/ResolverUpgrade.cc?rev=7132&r1=7131&r2=7132&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/ResolverUpgrade.cc (original)
+++ trunk/libzypp/zypp/solver/detail/ResolverUpgrade.cc Thu Sep  6 18:19:52 2007
@@ -226,13 +226,27 @@
            FindMap::iterator it = providers.find( provider->name() );
 
            if (it != providers.end()) {                                // provider with same name found
-               int cmp = it->second->arch().compare( provider->arch() );
-               if (cmp < 0) {                                               // new provider has better arch
-                   it->second = provider;
-               }
-               else if (cmp == 0) {                                    // new provider has equal arch
-                   if (it->second->edition().compare( provider->edition() ) < 0) {
-                       it->second = provider;                               // new provider has better edition
+               if (provider.status().isToBeInstalled()
+                   || it->second.status().isToBeInstalled()) {
+
+                   if (provider.status().isToBeInstalled()
+                       && it->second.status().isToBeInstalled()) {
+                       ERR << "only one should be set for installation: " << it->second << "; " << provider << endl;
+                   } else {
+                       if (provider.status().isToBeInstalled()) {
+                           it->second = provider; // take thatone which is already set for installation
+                       }
+                   }
+               } else {
+                   // not the same --> find better provider
+                   int cmp = it->second->arch().compare( provider->arch() );
+                   if (cmp < 0) {                                           // new provider has better arch
+                       it->second = provider;
+                   }
+                   else if (cmp == 0) {                                        // new provider has equal arch
+                       if (it->second->edition().compare( provider->edition() ) < 0) {
+                           it->second = provider;                           // new provider has better edition
+                       }
                    }
                }
            }

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages