11#include <zypp/ng/Context>
19 template<
typename ZyppContextRefType>
21 : _zyppContext( std::move(zyppContext) )
22 , _repoManager( std::move(repoManager) )
23 , _repoInfo( std::move(info) )
24 , _rawCachePath( std::move(rawCachePath) )
25 , _tmpDir( std::move(tempDir) )
27 if ( _repoManager->pluginRepoverification().checkIfNeeded() )
28 _pluginRepoverification = _repoManager->pluginRepoverification();
31 template<
typename ZyppContextRefType>
36 using CtxRefType = RefreshContextRef<ZyppContextRefType>;
42 if( tmpdir.
path().
empty() && geteuid() != 0 ) {
49 MIL <<
"Creating RefreshContext " << std::endl;
60 template<
typename ZyppContextRefType>
63 MIL <<
"Deleting RefreshContext" << std::endl;
66 template<
typename ZyppContextRefType>
81 template<
typename ZyppContextRefType>
87 template<
typename ZyppContextRefType>
93 template<
typename ZyppContextRefType>
99 template<
typename ZyppContextRefType>
105 template<
typename ZyppContextRefType>
111 template<
typename ZyppContextRefType>
117 template<
typename ZyppContextRefType>
123 template<
typename ZyppContextRefType>
129 template<
typename ZyppContextRefType>
135 template<
typename ZyppContextRefType>
141 template<
typename ZyppContextRefType>
151 template<
typename ZyppContextRefType>
157 template<
typename ZyppContextRefType>
Base class for Exception.
What is known about a repository.
Wrapper class for stat/lstat.
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 constexpr const char * cookieFileName()
static constexpr const char * cacheFileName()
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 hardlinkCopy(const Pathname &oldpath, const Pathname &newpath)
Create newpath as hardlink or copy of oldpath.
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.