Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / zypp / pool / PoolImpl.h
index 30e5059..24249bc 100644 (file)
@@ -17,7 +17,7 @@
 #include "zypp/base/Easy.h"
 #include "zypp/base/LogTools.h"
 #include "zypp/base/SerialNumber.h"
-#include "zypp/base/Deprecated.h"
+#include "zypp/APIConfig.h"
 
 #include "zypp/pool/PoolTraits.h"
 #include "zypp/ResPoolProxy.h"
@@ -179,9 +179,9 @@ namespace zypp
       public:
         /** \name Save and restore state. */
         //@{
-        void SaveState( const ResObject::Kind & kind_r );
+        void SaveState( const ResKind & kind_r );
 
-        void RestoreState( const ResObject::Kind & kind_r );
+        void RestoreState( const ResKind & kind_r );
         //@}
 
         ///////////////////////////////////////////////////////////////////
@@ -264,7 +264,7 @@ namespace zypp
           // Now diff to the pool collecting names only.
           // Thus added and removed locks are not necessarily
           // disjoint. Added locks win.
-          typedef std::tr1::unordered_set<IdString> IdentSet;
+          typedef std::unordered_set<IdString> IdentSet;
           IdentSet addedLocks;
           IdentSet removedLocks;
           for_( it, begin(), end() )
@@ -299,71 +299,6 @@ namespace zypp
        }
 
       public:
-        typedef PoolTraits::AutoSoftLocks          AutoSoftLocks;
-        typedef PoolTraits::autoSoftLocks_iterator autoSoftLocks_iterator;
-
-        const AutoSoftLocks & autoSoftLocks() const
-        { return _autoSoftLocks; }
-
-        bool autoSoftLockAppliesTo( sat::Solvable solv_r ) const
-        { return( _autoSoftLocks.find( solv_r.ident() ) != _autoSoftLocks.end() ); }
-
-        void setAutoSoftLocks( const AutoSoftLocks & newLocks_r )
-        {
-          MIL << "Apply " << newLocks_r.size() << " AutoSoftLocks: " << newLocks_r << endl;
-          _autoSoftLocks = newLocks_r;
-          // now adjust the pool status
-          for_( it, begin(), end() )
-          {
-            if ( ! it->status().isKept() )
-              continue;
-
-            if ( autoSoftLockAppliesTo( it->satSolvable() ) )
-              it->status().setSoftLock( ResStatus::USER );
-            else
-              it->status().resetTransact( ResStatus::USER );
-          }
-        }
-
-        void getActiveSoftLocks( AutoSoftLocks & activeLocks_r )
-        {
-          activeLocks_r = _autoSoftLocks; // current soft-locks
-          AutoSoftLocks todel;            // + names to be deleted
-          AutoSoftLocks toins;            // - names to be installed
-
-          for_( it, begin(), end() )
-          {
-            ResStatus & status( it->status() );
-            if ( ! ( status.isByUser() || status.isByApplLow() ) )
-              continue; // ignore non-user requests; ApplLow means selected
-                        // by solver, but on behalf of a user request.
-
-            switch ( status.getTransactValue() )
-            {
-              case ResStatus::KEEP_STATE:
-                // Filter only items included in the last recommended set.
-                if ( status.isRecommended() )
-                  activeLocks_r.insert( it->satSolvable().ident() );
-                break;
-              case ResStatus::LOCKED:
-                //  NOOP
-                break;
-              case ResStatus::TRANSACT:
-                (status.isInstalled() ? todel : toins).insert( it->satSolvable().ident() );
-                break;
-            }
-          }
-          for_( it, todel.begin(), todel.end() )
-          {
-            activeLocks_r.insert( *it );
-          }
-          for_( it, toins.begin(), toins.end() )
-          {
-            activeLocks_r.erase( *it );
-          }
-        }
-
-      public:
         const ContainerT & store() const
         {
           checkSerial();
@@ -373,10 +308,7 @@ namespace zypp
             bool addedItems = false;
             std::list<PoolItem> addedProducts;
 
-            if ( pool.capacity() != _store.capacity() )
-            {
-              _store.resize( pool.capacity() );
-            }
+           _store.resize( pool.capacity() );
 
             if ( pool.capacity() )
             {
@@ -396,11 +328,6 @@ namespace zypp
                   // remember products for buddy processing (requires clean store)
                   if ( s.isKind( ResKind::product ) )
                     addedProducts.push_back( pi );
-                  // and on the fly check for weak locks...
-                  if ( autoSoftLockAppliesTo( s ) )
-                  {
-                    pi.status().setSoftLock( ResStatus::USER );
-                  }
                   if ( !addedItems )
                     addedItems = true;
                 }
@@ -480,8 +407,6 @@ namespace zypp
         mutable shared_ptr<ResPoolProxy>      _poolProxy;
 
       private:
-        /** Set of solvable idents that should be soft locked per default. */
-        AutoSoftLocks                         _autoSoftLocks;
         /** Set of queries that define hardlocks. */
         HardLockQueries                       _hardLockQueries;
     };