15#include <zypp-core/zyppng/pipelines/Lift>
21#undef ZYPP_BASE_LOGGER_LOGGROUP
22#define ZYPP_BASE_LOGGER_LOGGROUP "zypp::repomanager"
28#define OPT_PROGRESS const ProgressData::ReceiverFnc & = ProgressData::ReceiverFnc()
42 _ngMgr = zyppng::SyncRepoManager::create( std::move(
ctx), std::move(opt) ).unwrap();
72 {
return str <<
"RepoManager::Impl"; }
84 RepoManager::~RepoManager()
87 bool RepoManager::repoEmpty()
const
88 {
return _pimpl->ngMgr().repoEmpty(); }
91 {
return _pimpl->ngMgr().repoSize(); }
94 {
return _pimpl->ngMgr().repoBegin(); }
97 {
return _pimpl->ngMgr().repoEnd(); }
99 RepoInfo RepoManager::getRepo(
const std::string & alias )
const
100 {
return _pimpl->ngMgr().getRepo( alias ); }
102 bool RepoManager::hasRepo(
const std::string & alias )
const
103 {
return _pimpl->ngMgr().hasRepo( alias ); }
105 std::string RepoManager::makeStupidAlias(
const Url &
url_r )
107 std::string
ret(
url_r.getScheme() );
113 std::string host(
url_r.getHost() );
114 if ( ! host.empty() )
121 ret += Digest::digest( Digest::sha1(), str::hexstring( ++serial ) +
url_r.asCompleteString() ).substr(0,8);
126 {
return _pimpl->ngMgr().metadataStatus( info ).unwrap(); }
129 {
return _pimpl->ngMgr().checkIfToRefreshMetadata( info, url, policy ).unwrap(); }
132 {
return _pimpl->ngMgr().metadataPath( info ).unwrap(); }
135 {
return _pimpl->ngMgr().packagesPath( info ).unwrap(); }
141 return _pimpl->ngMgr().refreshMetadata( info, policy,
nullptr ).unwrap();
145 {
return _pimpl->ngMgr().cleanMetadata( info,
nullptr ).unwrap(); }
148 {
return _pimpl->ngMgr().cleanPackages( info,
nullptr ).unwrap(); }
151 {
return _pimpl->ngMgr().cacheStatus( info ).unwrap(); }
157 return _pimpl->ngMgr().buildCache( info, policy,
adapt.observer() ).unwrap();
161 {
return _pimpl->ngMgr().cleanCache( info,
nullptr ).unwrap(); }
163 bool RepoManager::isCached(
const RepoInfo &info )
const
164 {
return _pimpl->ngMgr().isCached( info ).unwrap(); }
167 {
return _pimpl->ngMgr().loadFromCache( info,
nullptr ).unwrap(); }
170 {
return _pimpl->ngMgr().cleanCacheDirGarbage(
nullptr ).unwrap(); }
173 {
return _pimpl->ngMgr().probe( url, path ).unwrap(); }
176 {
return _pimpl->ngMgr().probe( url ).unwrap(); }
193 {
return _pimpl->ngMgr().addRepositories( url,
nullptr ).unwrap(); }
199 return _pimpl->ngMgr().removeRepository( info,
adapt.observer() ).unwrap();
214 {
return _pimpl->ngMgr().getRepositoryInfo( alias ).unwrap(); }
217 {
return _pimpl->ngMgr().getRepositoryInfo( url,
urlview ).unwrap(); }
219 bool RepoManager::serviceEmpty()
const
220 {
return _pimpl->ngMgr().serviceEmpty(); }
223 {
return _pimpl->ngMgr().serviceSize(); }
226 {
return _pimpl->ngMgr().serviceBegin(); }
229 {
return _pimpl->ngMgr().serviceEnd(); }
231 ServiceInfo RepoManager::getService(
const std::string & alias )
const
232 {
return _pimpl->ngMgr().getService( alias ); }
234 bool RepoManager::hasService(
const std::string & alias )
const
235 {
return _pimpl->ngMgr().hasService( alias ); }
238 {
return _pimpl->ngMgr().probeService( url ).unwrap(); }
240 void RepoManager::addService(
const std::string & alias,
const Url& url )
241 {
return _pimpl->ngMgr().addService( alias, url ).unwrap(); }
244 {
return _pimpl->ngMgr().addService( service ).unwrap(); }
246 void RepoManager::removeService(
const std::string & alias )
247 {
return _pimpl->ngMgr().removeService( alias ).unwrap(); }
250 {
return _pimpl->ngMgr().removeService( service ).unwrap(); }
253 {
return _pimpl->ngMgr().refreshServices(
options_r ).unwrap(); }
256 {
return _pimpl->ngMgr().refreshService( alias,
options_r ).unwrap(); }
259 {
return _pimpl->ngMgr().refreshService( service,
options_r ).unwrap(); }
261 void RepoManager::modifyService(
const std::string & oldAlias,
const ServiceInfo & service )
262 {
return _pimpl->ngMgr().modifyService( oldAlias, service ).unwrap(); }
265 { (
void) _pimpl->ngMgr().refreshGeoIp( urls ); }
RepoManager implementation.
std::ostream & operator<<(std::ostream &str, const RepoManager::Impl &obj)
Stream output.
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
shared_ptr< Impl > _pimpl
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
What is known about a repository.
urls_size_type baseUrlsSize() const
number of repository urls
Track changing files or directories.
static SyncContextRef defaultContext()
String related utilities and Regular expression matching.
RefreshCheckStatus
Possibly return state of RepoManager::checkIfToRefreshMetadata function.
std::ostream & operator<<(std::ostream &str, const DeltaCandidates &obj)
Easy-to use interface to the ZYPP dependency resolver.
AsyncOpRef< expected< std::list< RepoInfo > > > readRepoFile(ContextRef ctx, zypp::Url repoFileUrl)
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.
RepoManagerRef< SyncContextRef > SyncRepoManagerRef
expected< zypp::Pathname > packagescache_path_for_repoinfo(const RepoManagerOptions &opt, const RepoInfo &info)
Calculates the packages cache path for a repository.
creates and provides information about known sources.
Impl * clone() const
clone for RWCOW_pointer
ServiceSet::const_iterator ServiceConstIterator
Impl & operator=(Impl &&)=delete
zyppng::SyncRepoManager & ngMgr()
Impl & operator=(const Impl &)=delete
const zyppng::SyncRepoManager & ngMgr() const
ServiceSet::size_type ServiceSizeType
Impl(zyppng::SyncContextRef &&ctx, RepoManagerOptions &&opt)
zyppng::SyncRepoManagerRef _ngMgr
RepoSet::size_type RepoSizeType
RepoManagerFlags::RefreshServiceFlags RefreshServiceOptions
Options tuning RefreshService.
RepoManager(RepoManagerOptions options=RepoManagerOptions())
Impl(const Impl &)=delete
RepoSet::const_iterator RepoConstIterator
Repository type enumeration.
Service type enumeration.
Url::asString() view options.