libzypp 17.32.2
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
21namespace zyppng {
23 ZYPP_FWD_DECL_TYPE_WITH_REFS( SyncContext );
24}
25
26namespace zyppng::repo {
27
29
36
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
62 static expected<repo::RefreshContextRef<ZyppContextRefType>> create( ZyppContextRefType zyppContext, zypp::RepoInfo info, zypp::RepoManagerOptions opts );
64
65 ~RefreshContext() override;
66
67 void saveToRawCache();
68
69 const zypp::Pathname &rawCachePath() 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
86
88 const std::optional<zypp::repo::RepoType> &probedType() const;
89 SignalProxy<void(zypp::repo::RepoType)> sigProbedTypeChanged();
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
What is known about a repository.
Definition RepoInfo.h:72
Provide a new empty temporary directory and recursively delete it when no longer needed.
Definition TmpPath.h:178
Repository metadata verification beyond GPG.
zypp::RepoInfo _repoInfo
Definition refresh.h:93
typename ZyppContextRefType::element_type ContextType
Definition refresh.h:57
const zypp::RepoManagerOptions & repoManagerOptions() const
Definition refresh.cc:91
static expected< repo::RefreshContextRef< ZyppContextRefType > > create(ZyppContextRefType zyppContext, zypp::RepoInfo info, zypp::RepoManagerOptions opts)
Definition refresh.cc:28
void setProbedType(zypp::repo::RepoType rType)
Definition refresh.cc:115
const std::optional< zypp::repo::RepoType > & probedType() const
Definition refresh.cc:125
zypp::Pathname targetDir() const
Definition refresh.cc:67
std::optional< PluginRepoverification > _pluginRepoverification
Definition refresh.h:97
std::optional< zypp::repo::RepoType > _probedType
Definition refresh.h:100
zypp::filesystem::TmpDir _tmpDir
Definition refresh.h:95
repo::RawMetadataRefreshPolicy policy() const
Definition refresh.cc:97
typename ContextType::ProvideType ProvideType
Definition refresh.h:58
const std::optional< PluginRepoverification > & pluginRepoverification() const
Definition refresh.cc:109
void setPolicy(repo::RawMetadataRefreshPolicy newPolicy)
Definition refresh.cc:103
ZYPP_DECL_PRIVATE_CONSTR_ARGS(RefreshContext, ZyppContextRefType &&zyppContext, zypp::RepoInfo &&info, zypp::Pathname &&rawCachePath, zypp::filesystem::TmpDir &&tempDir, zypp::RepoManagerOptions &&opts)
void setPluginRepoverification(std::optional< PluginRepoverification > pluginRepoverification_r)
Definition refresh.h:81
const ZyppContextRefType & zyppContext() const
Definition refresh.cc:73
repo::RawMetadataRefreshPolicy _policy
Definition refresh.h:96
ZyppContextRefType _zyppContext
Definition refresh.h:92
const zypp::RepoInfo & repoInfo() const
Definition refresh.cc:79
const zypp::Pathname & rawCachePath() const
Definition refresh.cc:61
Signal< void(zypp::repo::RepoType)> _sigProbedTypeChanged
Definition refresh.h:101
zypp::Pathname _rawCachePath
Definition refresh.h:94
SignalProxy< void(zypp::repo::RepoType)> sigProbedTypeChanged()
Definition refresh.cc:131
zypp::RepoManagerOptions _repoManagerOptions
Definition refresh.h:98
typename ProvideType::MediaHandle MediaHandle
Definition refresh.h:59
ZyppContextRefType ContextRefType
Definition refresh.h:56
RefreshCheckStatus
Possibly return state of checkIfRefreshMEtadata function.
Definition refresh.h:40
@ REFRESH_NEEDED
refresh is needed
Definition refresh.h:41
@ REPO_CHECK_DELAYED
refresh is delayed due to settings
Definition refresh.h:43
@ REPO_UP_TO_DATE
repository not changed
Definition refresh.h:42
ZYPP_FWD_DECL_REFS(SyncDownloadContext)
RawMetadataRefreshPolicy
Definition refresh.h:31
@ RefreshForced
Definition refresh.h:33
@ RefreshIfNeededIgnoreDelay
Definition refresh.h:34
@ RefreshIfNeeded
Definition refresh.h:32
ZYPP_FWD_DECL_TEMPL_TYPE_WITH_REFS_ARG1(RefreshContext, ZyppContextRefType)
ZYPP_FWD_DECL_TYPE_WITH_REFS(Context)
Repo manager settings.
Repository type enumeration.
Definition RepoType.h:28