Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / zypp / sat / detail / PoolImpl.h
index 09ea430..8b4035a 100644 (file)
 #define ZYPP_SAT_DETAIL_POOLIMPL_H
 extern "C"
 {
-#include <satsolver/pool.h>
-#include <satsolver/repo.h>
-#include <satsolver/solvable.h>
-#include <satsolver/poolarch.h>
-#include <satsolver/repo_solv.h>
+#include <solv/pool.h>
+#include <solv/repo.h>
+#include <solv/solvable.h>
+#include <solv/poolarch.h>
+#include <solv/repo_solv.h>
 }
 #include <iosfwd>
 
@@ -25,6 +25,7 @@ extern "C"
 #include "zypp/base/NonCopyable.h"
 #include "zypp/base/SerialNumber.h"
 #include "zypp/sat/detail/PoolMember.h"
+#include "zypp/sat/Queue.h"
 #include "zypp/RepoInfo.h"
 #include "zypp/Locale.h"
 #include "zypp/Capability.h"
@@ -67,6 +68,8 @@ namespace zypp
            * \todo actually requires a watcher.
            */
           void prepare() const;
+         /** \ref prepare plus some expensive checks done before solving only. */
+         void prepareForSolving() const;
 
         private:
           /** Invalidate housekeeping data (e.g. whatprovides) if the
@@ -91,6 +94,22 @@ namespace zypp
           ::_Repo * systemRepo() const
           { return _pool->installed; }
 
+          /** Get rootdir (for file conflicts check) */
+         Pathname rootDir() const
+         {
+           const char * rd = ::pool_get_rootdir( _pool );
+           return( rd ? rd : "/" );
+         }
+
+         /** Set rootdir (for file conflicts check) */
+         void rootDir( const Pathname & root_r )
+         {
+           if ( root_r.empty() || root_r == "/" )
+             ::pool_set_rootdir( _pool, nullptr );
+           else
+             ::pool_set_rootdir( _pool, root_r.c_str() );
+         }
+
         public:
           /** \name Actions invalidating housekeeping data.
            *
@@ -245,22 +264,22 @@ namespace zypp
         public:
           /** \name Installed on behalf of a user request hint. */
           //@{
-          typedef IdStringSet OnSystemByUserList;
+          /** Get ident list of all autoinstalled solvables. */
+         StringQueue autoInstalled() const
+         { return _autoinstalled; }
 
-          const OnSystemByUserList & onSystemByUserList() const
-          {
-            if ( ! _onSystemByUserListPtr )
-             onSystemByUserListInit();
-           return *_onSystemByUserListPtr;
-          }
+         /** Set ident list of all autoinstalled solvables. */
+         void setAutoInstalled( const StringQueue & autoInstalled_r )
+         { _autoinstalled = autoInstalled_r; }
 
           bool isOnSystemByUser( IdString ident_r ) const
-          {
-            const OnSystemByUserList & l( onSystemByUserList() );
-            return l.find( ident_r ) != l.end();
-          }
+          { return !_autoinstalled.contains( ident_r.id() ); }
           //@}
 
+       public:
+         /** accessor for etc/sysconfig/storage reading file on demand */
+         const std::set<std::string> & requiredFilesystems() const;
+
         private:
           /** sat-pool. */
           ::_Pool * _pool;
@@ -281,8 +300,10 @@ namespace zypp
           mutable scoped_ptr<MultiversionList> _multiversionListPtr;
 
           /**  */
-          void onSystemByUserListInit() const;
-          mutable scoped_ptr<OnSystemByUserList> _onSystemByUserListPtr;
+         sat::StringQueue _autoinstalled;
+
+         /** filesystems mentioned in /etc/sysconfig/storage */
+         mutable scoped_ptr<std::set<std::string> > _requiredFilesystemsPtr;
       };
       ///////////////////////////////////////////////////////////////////