11#include <zypp/ng/Context>
18 template<
typename ZyppContextRefType>
20 : _zyppContext( std::move(zyppContext) )
21 , _repoManager( std::move(repoManager) )
22 , _repoInfo( std::move(info) )
23 , _rawCachePath( std::move(rawCachePath) )
24 , _tmpDir( std::move(tempDir) )
26 if ( _repoManager->pluginRepoverification().checkIfNeeded() )
27 _pluginRepoverification = _repoManager->pluginRepoverification();
30 template<
typename ZyppContextRefType>
35 using CtxRefType = RefreshContextRef<ZyppContextRefType>;
41 if( tmpdir.
path().
empty() && geteuid() != 0 ) {
48 MIL <<
"Creating RefreshContext " << std::endl;
59 template<
typename ZyppContextRefType>
62 MIL <<
"Deleting RefreshContext" << std::endl;
65 template<
typename ZyppContextRefType>
71 template<
typename ZyppContextRefType>
77 template<
typename ZyppContextRefType>
83 template<
typename ZyppContextRefType>
89 template<
typename ZyppContextRefType>
95 template<
typename ZyppContextRefType>
101 template<
typename ZyppContextRefType>
107 template<
typename ZyppContextRefType>
113 template<
typename ZyppContextRefType>
119 template<
typename ZyppContextRefType>
125 template<
typename ZyppContextRefType>
131 template<
typename ZyppContextRefType>
141 template<
typename ZyppContextRefType>
147 template<
typename ZyppContextRefType>
Base class for Exception.
What is known about a repository.
bool empty() const
Test for an empty path.
Provide a new empty temporary directory and recursively delete it when no longer needed.
static TmpDir makeSibling(const Pathname &sibling_r)
Provide a new empty temporary directory as sibling.
static expected success(ConsParams &&...params)
static expected error(ConsParams &&...params)
const zypp::RepoManagerOptions & repoManagerOptions() const
~RefreshContext() override
const RepoManagerRef< ZyppContextRefType > & repoManager() const
void setProbedType(zypp::repo::RepoType rType)
const std::optional< zypp::repo::RepoType > & probedType() const
zypp::Pathname targetDir() const
std::optional< PluginRepoverification > _pluginRepoverification
std::optional< zypp::repo::RepoType > _probedType
zypp::filesystem::TmpDir _tmpDir
RawMetadataRefreshPolicy policy() const
const std::optional< PluginRepoverification > & pluginRepoverification() const
static expected< repo::RefreshContextRef< ZyppContextRefType > > create(ZyppContextRefType zyppContext, zypp::RepoInfo info, RepoManagerRef< ContextRefType > repoManager)
void setPolicy(RawMetadataRefreshPolicy newPolicy)
const ZyppContextRefType & zyppContext() const
repo::RawMetadataRefreshPolicy _policy
ZyppContextRefType _zyppContext
const zypp::RepoInfo & repoInfo() const
RepoManagerRef< ContextRefType > _repoManager
const zypp::Pathname & rawCachePath() const
Signal< void(zypp::repo::RepoType)> _sigProbedTypeChanged
zypp::Pathname _rawCachePath
SignalProxy< void(zypp::repo::RepoType)> sigProbedTypeChanged()
int exchange(const Pathname &lpath, const Pathname &rpath)
Exchanges two files or directories.
auto and_then(Fun &&function)
zypp::RepoManagerFlags::RawMetadataRefreshPolicy RawMetadataRefreshPolicy
expected< zypp::Pathname > rawcache_path_for_repoinfo(const RepoManagerOptions &opt, const RepoInfo &info)
Calculates the raw cache path for a repository, this is usually /var/cache/zypp/alias.
Repository type enumeration.
#define ZYPP_EXCPT_PTR(EXCPT)
Drops a logline and returns Exception as a std::exception_ptr.