Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / zypp / ui / SelectableImpl.h
index 6ae85c3..4bafbf0 100644 (file)
@@ -145,18 +145,14 @@ namespace zypp
       {
        PoolItem defaultCand( defaultCandidate() );
 
-       if ( multiversionInstall() )
-         return identicalInstalled( defaultCand ) ? PoolItem() : defaultCand;
+       // multiversionInstall: This returns the candidate for the last
+       // instance installed. Actually we'd need a list here.
 
         if ( installedEmpty() || ! defaultCand )
           return defaultCand;
         // Here: installed and defaultCand are non NULL and it's not a
         //       multiversion install.
 
-        // update candidate must come from the highest priority repo
-        if ( defaultCand->repoInfo().priority() != (*availableBegin())->repoInfo().priority() )
-          return PoolItem();
-
         PoolItem installed( installedObj() );
         // check vendor change
         if ( ! ( ResPool::instance().resolver().allowVendorChange()
@@ -189,11 +185,11 @@ namespace zypp
 
       /** \copydoc Selectable::identicalAvailable( const PoolItem & )const */
       bool identicalAvailable( const PoolItem & rhs ) const
-      { return identicalAvailableObj( rhs ); }
+      { return bool(identicalAvailableObj( rhs )); }
 
       /** \copydoc Selectable::identicalInstalled( const PoolItem & )const */
       bool identicalInstalled( const PoolItem & rhs ) const
-      { return identicalInstalledObj( rhs ); }
+      { return bool(identicalInstalledObj( rhs )); }
 
       /** \copydoc Selectable::identicalAvailableObj( const PoolItem & rhs ) const */
       PoolItem identicalAvailableObj( const PoolItem & rhs ) const
@@ -296,7 +292,7 @@ namespace zypp
       { return availableEmpty(); }
 
       bool multiversionInstall() const
-      { return theObj().satSolvable().multiversionInstall(); }
+      { return sat::Pool::instance().isMultiversion( ident() ); }
 
       bool pickInstall( const PoolItem & pi_r, ResStatus::TransactByValue causer_r, bool yesno_r );
 
@@ -363,7 +359,7 @@ namespace zypp
 
       PoolItem defaultCandidate() const
       {
-        if ( ! ( multiversionInstall() || installedEmpty() ) )
+        if ( ! installedEmpty() )
         {
           // prefer the installed objects arch and vendor
           bool solver_allowVendorChange( ResPool::instance().resolver().allowVendorChange() );