libzypp  17.32.5
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/zyppng/pipelines/AsyncResult>
13 #include <zypp-core/zyppng/pipelines/Expected>
14 #include <zypp-core/zyppng/base/Signals>
15 #include <zypp-core/fs/TmpPath.h>
16 
17 #include <zypp/RepoInfo.h>
20 
21 namespace zyppng {
23  ZYPP_FWD_DECL_TYPE_WITH_REFS( SyncContext );
24 }
25 
26 namespace zyppng::repo {
27 
28  ZYPP_FWD_DECL_TEMPL_TYPE_WITH_REFS_ARG1 (RefreshContext, ZyppContextRefType);
29 
31  {
35  };
36 
44  };
45 
52  template<typename ZyppContextRefType>
53  class RefreshContext : public Base {
55  public:
56  using ContextRefType = ZyppContextRefType;
57  using ContextType = typename ZyppContextRefType::element_type;
58  using ProvideType = typename ContextType::ProvideType;
59  using MediaHandle = typename ProvideType::MediaHandle;
61 
64 
65  ~RefreshContext() override;
66 
67  void saveToRawCache();
68 
69  const zypp::Pathname &rawCachePath() const;
70  zypp::Pathname targetDir() const;
71  const ZyppContextRefType &zyppContext () const;
72  const zypp::RepoInfo &repoInfo () const;
75 
78 
79  const std::optional<PluginRepoverification> &pluginRepoverification() const;
80 
81  void setPluginRepoverification( std::optional<PluginRepoverification> pluginRepoverification_r )
82  { _pluginRepoverification = std::move(pluginRepoverification_r); }
83 
85  { setPluginRepoverification( std::nullopt ); }
86 
87  void setProbedType( zypp::repo::RepoType rType );
88  const std::optional<zypp::repo::RepoType> &probedType() const;
90 
91  private:
92  ZyppContextRefType _zyppContext;
97  std::optional<PluginRepoverification> _pluginRepoverification;
99 
100  std::optional<zypp::repo::RepoType> _probedType;
102 
103  };
104 
109 
110 }
111 
112 
113 
114 #endif
refresh is delayed due to settings
Definition: refresh.h:43
Repository metadata verification beyond GPG.
zypp::Pathname targetDir() const
Definition: refresh.cc:83
RefreshCheckStatus
Possibly return state of checkIfRefreshMEtadata function.
Definition: refresh.h:40
ZYPP_FWD_DECL_TEMPL_TYPE_WITH_REFS_ARG1(RefreshContext, ZyppContextRefType)
void setPluginRepoverification(std::optional< PluginRepoverification > pluginRepoverification_r)
Definition: refresh.h:81
void setPolicy(repo::RawMetadataRefreshPolicy newPolicy)
Definition: refresh.cc:119
SignalProxy< void(zypp::repo::RepoType)> sigProbedTypeChanged()
Definition: refresh.cc:147
const ZyppContextRefType & zyppContext() const
Definition: refresh.cc:89
repository not changed
Definition: refresh.h:42
ZyppContextRefType ContextRefType
Definition: refresh.h:56
What is known about a repository.
Definition: RepoInfo.h:71
typename ProvideType::MediaHandle MediaHandle
Definition: refresh.h:59
static expected< repo::RefreshContextRef< ZyppContextRefType > > create(ZyppContextRefType zyppContext, zypp::RepoInfo info, zypp::RepoManagerOptions opts)
Definition: refresh.cc:28
std::optional< zypp::repo::RepoType > _probedType
Definition: refresh.h:100
const zypp::RepoInfo & repoInfo() const
Definition: refresh.cc:95
typename ZyppContextRefType::element_type ContextType
Definition: refresh.h:57
const zypp::RepoManagerOptions & repoManagerOptions() const
Definition: refresh.cc:107
zypp::RepoInfo _repoInfo
Definition: refresh.h:93
Repo manager settings.
const zypp::Pathname & rawCachePath() const
Definition: refresh.cc:77
refresh is needed
Definition: refresh.h:41
zypp::filesystem::TmpDir _tmpDir
Definition: refresh.h:95
std::optional< PluginRepoverification > _pluginRepoverification
Definition: refresh.h:97
ZYPP_FWD_DECL_TYPE_WITH_REFS(Context)
zypp::Pathname _rawCachePath
Definition: refresh.h:94
ZYPP_DECL_PRIVATE_CONSTR_ARGS(RefreshContext, ZyppContextRefType &&zyppContext, zypp::RepoInfo &&info, zypp::Pathname &&rawCachePath, zypp::filesystem::TmpDir &&tempDir, zypp::RepoManagerOptions &&opts)
Provide a new empty temporary directory and recursively delete it when no longer needed.
Definition: TmpPath.h:181
RawMetadataRefreshPolicy
Definition: refresh.h:30
repo::RawMetadataRefreshPolicy policy() const
Definition: refresh.cc:113
ZYPP_FWD_DECL_REFS(SyncDownloadContext)
typename ContextType::ProvideType ProvideType
Definition: refresh.h:58
Signal< void(zypp::repo::RepoType)> _sigProbedTypeChanged
Definition: refresh.h:101
const std::optional< zypp::repo::RepoType > & probedType() const
Definition: refresh.cc:141
void setProbedType(zypp::repo::RepoType rType)
Definition: refresh.cc:131
void setNoPluginRepoverification()
Definition: refresh.h:84
repo::RawMetadataRefreshPolicy _policy
Definition: refresh.h:96
zypp::RepoManagerOptions _repoManagerOptions
Definition: refresh.h:98
ZyppContextRefType _zyppContext
Definition: refresh.h:92
Repository type enumeration.
Definition: RepoType.h:27
const std::optional< PluginRepoverification > & pluginRepoverification() const
Definition: refresh.cc:125