11#include <zypp/ng/Context>
19 RefreshContext::RefreshContext( private_constr_t, ContextRef &&zyppContext, zypp::RepoInfo &&info, zypp::Pathname &&rawCachePath, zypp::filesystem::TmpDir &&tempDir, RepoManagerRef &&repoManager )
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();
35 using CtxRefType = RefreshContextRef;
41 if( tmpdir.
path().
empty() && geteuid() != 0 ) {
48 MIL <<
"Creating RefreshContext " << std::endl;
62 MIL <<
"Deleting RefreshContext" << std::endl;
#define ZYPP_EXCPT_PTR(EXCPT)
Drops a logline and returns Exception as a std::exception_ptr.
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)
void setPolicy(RawMetadataRefreshPolicy newPolicy)
RepoManagerRef _repoManager
const zypp::Pathname & rawCachePath() const
zypp::Pathname targetDir() const
zypp::Pathname _rawCachePath
const zypp::RepoInfo & repoInfo() const
RawMetadataRefreshPolicy policy() const
const std::optional< PluginRepoverification > & pluginRepoverification() const
repo::RawMetadataRefreshPolicy _policy
std::optional< zypp::repo::RepoType > _probedType
const RepoManagerRef & repoManager() const
std::optional< PluginRepoverification > _pluginRepoverification
SignalProxy< void(zypp::repo::RepoType)> sigProbedTypeChanged()
static expected< repo::RefreshContextRef > create(ContextRef zyppContext, zypp::RepoInfo info, RepoManagerRef repoManager)
zypp::filesystem::TmpDir _tmpDir
const zypp::RepoManagerOptions & repoManagerOptions() const
void setProbedType(zypp::repo::RepoType rType)
Signal< void(zypp::repo::RepoType)> _sigProbedTypeChanged
const ContextRef & zyppContext() const
const std::optional< zypp::repo::RepoType > & probedType() const
~RefreshContext() override
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.