libzypp  17.38.7
refresh.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
9 #ifndef ZYPP_NG_REPO_REFRESH_INCLUDED
10 #define ZYPP_NG_REPO_REFRESH_INCLUDED
11 
12 #include <zypp-core/ng/async/task.h>
13 #include <zypp-core/ng/pipelines/Expected>
14 #include <zypp-core/ng/base/Signals>
15 #include <zypp-core/fs/TmpPath.h>
16 
17 #include <zypp/RepoInfo.h>
19 #include <zypp/RepoManagerFlags.h>
20 #include <zypp/ng/repomanager.h>
22 
23 
24 namespace zyppng {
26  ZYPP_FWD_DECL_TYPE_WITH_REFS( SyncContext );
27 }
28 
29 namespace zyppng::repo {
30 
31  ZYPP_FWD_DECL_TYPE_WITH_REFS (RefreshContext);
32 
35 
42  class RefreshContext : public Base {
44  public:
47 
48  static expected<repo::RefreshContextRef> create( ContextRef zyppContext, zypp::RepoInfo info, RepoManagerRef repoManager );
50 
51  ~RefreshContext() override;
52 
58  void saveToRawCache();
59 
63  const zypp::Pathname &rawCachePath() const;
64 
70  zypp::Pathname targetDir() const;
71 
76  const ContextRef &zyppContext () const;
77 
83  const zypp::RepoInfo &repoInfo () const;
85 
89  const RepoManagerRef &repoManager() const;
91 
96  void setPolicy(RawMetadataRefreshPolicy newPolicy);
97 
101  const std::optional<PluginRepoverification> &pluginRepoverification() const;
102 
103  void setPluginRepoverification( std::optional<PluginRepoverification> pluginRepoverification_r )
104  { _pluginRepoverification = std::move(pluginRepoverification_r); }
105 
110  { setPluginRepoverification( std::nullopt ); }
111 
116  void setProbedType( zypp::repo::RepoType rType );
117  const std::optional<zypp::repo::RepoType> &probedType() const;
119 
120  private:
121  ContextRef _zyppContext;
122  RepoManagerRef _repoManager;
127  std::optional<PluginRepoverification> _pluginRepoverification;
128 
129  std::optional<zypp::repo::RepoType> _probedType;
131 
132  };
133 }
134 #endif
std::optional< PluginRepoverification > _pluginRepoverification
Definition: refresh.h:127
Provide ProvideType
Definition: context.h:34
Repository metadata verification beyond GPG.
zypp::RepoInfo _repoInfo
Definition: refresh.h:123
zypp::Pathname _rawCachePath
Definition: refresh.h:124
void setProbedType(zypp::repo::RepoType rType)
Definition: refresh.cc:141
What is known about a repository.
Definition: RepoInfo.h:71
ZYPP_DECL_PRIVATE_CONSTR_ARGS(RefreshContext, ContextRef &&zyppContext, zypp::RepoInfo &&info, zypp::Pathname &&rawCachePath, zypp::filesystem::TmpDir &&tempDir, RepoManagerRef &&repoManager)
repo::RawMetadataRefreshPolicy _policy
Definition: refresh.h:126
Repo manager settings.
Signal< void(zypp::repo::RepoType)> _sigProbedTypeChanged
Definition: refresh.h:130
SignalProxy< void(zypp::repo::RepoType)> sigProbedTypeChanged()
Definition: refresh.cc:157
zypp::Pathname targetDir() const
Definition: refresh.cc:87
std::optional< zypp::repo::RepoType > _probedType
Definition: refresh.h:129
Provide a new empty temporary directory and recursively delete it when no longer needed.
Definition: TmpPath.h:172
typename Context::ProvideType ProvideType
Definition: refresh.h:45
static expected< repo::RefreshContextRef > create(ContextRef zyppContext, zypp::RepoInfo info, RepoManagerRef repoManager)
Definition: refresh.cc:31
zypp::filesystem::TmpDir _tmpDir
Definition: refresh.h:125
const std::optional< PluginRepoverification > & pluginRepoverification() const
Definition: refresh.cc:135
void setPolicy(RawMetadataRefreshPolicy newPolicy)
Definition: refresh.cc:129
zypp_private::repo::PluginRepoverification PluginRepoverification
Definition: repomanager.h:43
ZYPP_FWD_DECL_TYPE_WITH_REFS(DownloadContext)
ZYPP_FWD_DECL_TYPE_WITH_REFS(EventDispatcher)
RepoManagerRef _repoManager
Definition: refresh.h:122
const RepoManagerRef & repoManager() const
Definition: refresh.cc:111
RawMetadataRefreshPolicy policy() const
Definition: refresh.cc:123
const ContextRef & zyppContext() const
Definition: refresh.cc:93
RefreshCheckStatus
Possibly return state of RepoManager::checkIfToRefreshMetadata function.
const std::optional< zypp::repo::RepoType > & probedType() const
Definition: refresh.cc:151
const zypp::RepoManagerOptions & repoManagerOptions() const
Definition: refresh.cc:117
void setPluginRepoverification(std::optional< PluginRepoverification > pluginRepoverification_r)
Definition: refresh.h:103
const zypp::RepoInfo & repoInfo() const
Definition: refresh.cc:99
const zypp::Pathname & rawCachePath() const
Definition: refresh.cc:81
Repository type enumeration.
Definition: RepoType.h:28