Avoid confusing solver decisions by not storing soft locks (bnc#863275)
authorMichael Andres <ma@suse.de>
Tue, 11 Feb 2014 22:51:34 +0000 (23:51 +0100)
committerMichael Andres <ma@suse.de>
Tue, 11 Feb 2014 22:51:34 +0000 (23:51 +0100)
zypp/ResPool.cc
zypp/ResPool.h
zypp/pool/PoolImpl.h
zypp/pool/PoolTraits.h
zypp/target/TargetImpl.cc

index dc84a24..de43071 100644 (file)
@@ -83,6 +83,7 @@ namespace zypp
   Repository ResPool::reposFind( const std::string & alias_r ) const
   { return _pimpl->reposFind( alias_r ); }
 
+#ifdef WITHSOFTLOCKS
   bool ResPool::autoSoftLocksEmpty() const
   { return _pimpl->autoSoftLocks().empty(); }
 
@@ -100,7 +101,7 @@ namespace zypp
 
   void ResPool::getActiveSoftLocks( AutoSoftLocks & activeLocks_r )
   { _pimpl->getActiveSoftLocks( activeLocks_r ); }
-
+#endif
 
   bool ResPool::hardLockQueriesEmpty() const
   { return _pimpl->hardLockQueries().empty(); }
index 162b281..a4f5032 100644 (file)
@@ -320,6 +320,7 @@ namespace zypp
       bool isAvailableLocale( const Locale & locale_r ) const;
       //@}
 
+#ifdef WITHSOFTLOCKS
     public:
       /** \name Handle automatic soft-locks.
        *
@@ -354,7 +355,7 @@ namespace zypp
       */
       void getActiveSoftLocks( AutoSoftLocks & activeLocks_r );
       //@}
-
+#endif
     public:
       /** \name Handle hard locks (e.g set from /etc/zypp/locks).
        *
index 6182024..de2a615 100644 (file)
@@ -298,6 +298,7 @@ namespace zypp
           return setChanged;
        }
 
+#ifdef WITHSOFTLOCKS
       public:
         typedef PoolTraits::AutoSoftLocks          AutoSoftLocks;
         typedef PoolTraits::autoSoftLocks_iterator autoSoftLocks_iterator;
@@ -362,7 +363,7 @@ namespace zypp
             activeLocks_r.erase( *it );
           }
         }
-
+#endif
       public:
         const ContainerT & store() const
         {
@@ -393,11 +394,13 @@ namespace zypp
                   // remember products for buddy processing (requires clean store)
                   if ( s.isKind( ResKind::product ) )
                     addedProducts.push_back( pi );
+#ifdef WITHSOFTLOCKS
                   // and on the fly check for weak locks...
                   if ( autoSoftLockAppliesTo( s ) )
                   {
                     pi.status().setSoftLock( ResStatus::USER );
                   }
+#endif
                   if ( !addedItems )
                     addedItems = true;
                 }
@@ -477,8 +480,10 @@ namespace zypp
         mutable shared_ptr<ResPoolProxy>      _poolProxy;
 
       private:
+#ifdef WITHSOFTLOCKS
         /** Set of solvable idents that should be soft locked per default. */
         AutoSoftLocks                         _autoSoftLocks;
+#endif
         /** Set of queries that define hardlocks. */
         HardLockQueries                       _hardLockQueries;
     };
index 5381327..3df8feb 100644 (file)
@@ -84,9 +84,11 @@ namespace zypp
       /** list of known Repositories */
       typedef sat::Pool::RepositoryIterator            repository_iterator;
 
+#ifdef WITHSOFTLOCKS
       /** soft locks */
       typedef std::tr1::unordered_set<IdString>                AutoSoftLocks;
       typedef AutoSoftLocks::const_iterator             autoSoftLocks_iterator;
+#endif
 
       /** hard locks from etc/zypp/locks */
       typedef std::list<PoolQuery>                     HardLockQueries;
index 81f764a..7fcbcf5 100644 (file)
@@ -1178,6 +1178,7 @@ namespace zypp
           satpool.setRequestedLocales( requestedLocales );
         }
       }
+#ifdef WITHSOFTLOCKS
       {
         SoftLocksFile::Data softLocks( _softLocksFile.data() );
         if ( ! softLocks.empty() )
@@ -1190,6 +1191,7 @@ namespace zypp
           ResPool::instance().setAutoSoftLocks( softLocks );
         }
       }
+#endif
       if ( ZConfig::instance().apply_locks_file() )
       {
         const HardLocksFile::Data & hardLocks( _hardLocksFile.data() );
@@ -1294,12 +1296,14 @@ namespace zypp
         filesystem::assert_dir( home() );
         // requested locales
         _requestedLocalesFile.setLocales( pool_r.getRequestedLocales() );
-        // weak locks
+#ifdef WITHSOFTLOCKS
+       // weak locks
         {
           SoftLocksFile::Data newdata;
           pool_r.getActiveSoftLocks( newdata );
           _softLocksFile.setData( newdata );
         }
+#endif
         // hard locks
         if ( ZConfig::instance().apply_locks_file() )
         {