Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / zypp / RepoManager.h
index 5901b04..5653939 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "zypp/base/PtrTypes.h"
 #include "zypp/base/Iterator.h"
+#include "zypp/base/Flags.h"
 
 #include "zypp/Pathname.h"
 #include "zypp/ZConfig.h"
@@ -81,17 +82,13 @@ namespace zypp
     Pathname repoPackagesCachePath;
     Pathname knownReposPath;
     Pathname knownServicesPath;
-    Pathname servicePluginsPath;
+    Pathname pluginsPath;
     bool probe;
     /**
      * Target distro ID to be used when refreshing repo index services.
      * Repositories not maching this ID will be skipped/removed.
      *
-     * The value is initialized upon construction to
-     * \ref Target::targetDistribution() if the Target is already initialized,
-     * otherwise the value is initially empty.
-     *
-     * If empty, no repositories contained in the index will be skipped.
+     * If empty, \ref Target::targetDistribution() will be used instead.
      */
     std::string servicesTargetDistro;
 
@@ -141,10 +138,16 @@ namespace zypp
       BuildForced
     };
 
-    enum RepoRemovePolicy
+    /** Flags for tuning RefreshService */
+    enum RefreshServiceBit
     {
-
+      RefreshService_restoreStatus     = (1<<0)        ///< Force restoring repo enabled/disabled staus
     };
+    ZYPP_DECLARE_FLAGS(RefreshServiceFlags,RefreshServiceBit);
+
+    /** Options tuning RefreshService */
+    typedef RefreshServiceFlags RefreshServiceOptions;
+
 
     /** \name Known repositories.
      *
@@ -591,7 +594,7 @@ namespace zypp
      *
      * \see refreshService(ServiceInfo)
      */
-    void refreshServices();
+    void refreshServices( const RefreshServiceOptions & options_r = RefreshServiceOptions() );
 
     /**
      * Refresh specific service.
@@ -601,9 +604,9 @@ namespace zypp
      * \throws RepoException if service is not found.
      * \throws MediaException If there's a problem downloading the repo index file.
      */
-    void refreshService( const std::string & alias );
+    void refreshService( const std::string & alias, const RefreshServiceOptions & options_r = RefreshServiceOptions() );
     /** \overload Take alias from ServiceInfo */
-    void refreshService( const ServiceInfo & service );
+    void refreshService( const ServiceInfo & service, const RefreshServiceOptions & options_r = RefreshServiceOptions() );
 
     /**
      * Modifies service file (rewrites it with new values) and underlying
@@ -685,22 +688,11 @@ namespace zypp
                  out);
     }
 
-  protected:
-    RepoStatus rawMetadataStatus( const RepoInfo &info );
-    void setCacheStatus( const RepoInfo &info, const RepoStatus &status );
-
-    /**
-     * Update timestamp of repository index file for the specified repository \a info.
-     * Used in \ref checkIfToRefreshMetadata() for repo.refresh.delay feature.
-     */
-    void touchIndexFile(const RepoInfo & info);
-
-  public:
-
   private:
     /** Pointer to implementation */
     RWCOW_pointer<Impl> _pimpl;
   };
+  ZYPP_DECLARE_OPERATORS_FOR_FLAGS(RepoManager::RefreshServiceFlags);
   ///////////////////////////////////////////////////////////////////
 
   /** \relates RepoManager Stream output */