libzypp 17.37.17
|
The RepoManager class Provides knowledge and methods to maintain repo settings and metadata for a given context. More...
#include <zypp/ng/repomanager.h>
Classes | |
struct | MatchServiceAlias |
Functor thats filter RepoInfo by service which it belongs to. More... |
Public Types | |
using | ContextRefType = ZyppContextRefType |
using | ContextType = typename ZyppContextRefType::element_type |
using | RawMetadataRefreshPolicy = zypp::RepoManagerFlags::RawMetadataRefreshPolicy |
using | CacheBuildPolicy = zypp::RepoManagerFlags::CacheBuildPolicy |
using | RefreshCheckStatus = zypp::RepoManagerFlags::RefreshCheckStatus |
using | RefreshServiceBit = zypp::RepoManagerFlags::RefreshServiceBit |
Flags for tuning RefreshService. | |
using | RefreshServiceOptions = zypp::RepoManagerFlags::RefreshServiceOptions |
using | ServiceSet = std::set<ServiceInfo> |
ServiceInfo typedefs. | |
using | ServiceConstIterator = ServiceSet::const_iterator |
using | ServiceSizeType = ServiceSet::size_type |
using | RepoSet = std::set<RepoInfo> |
RepoInfo typedefs. | |
using | RepoConstIterator = RepoSet::const_iterator |
using | RepoSizeType = RepoSet::size_type |
Public Types inherited from zyppng::Base | |
using | Ptr = std::shared_ptr<Base> |
using | WeakPtr = std::weak_ptr<Base> |
Public Member Functions | |
ZYPP_DECL_PRIVATE_CONSTR_ARGS (RepoManager, ZyppContextRefType zyppCtx, RepoManagerOptions opt) | |
virtual | ~RepoManager () |
expected< void > | initialize () |
ContextRefType | zyppContext () const |
const RepoManagerOptions & | options () const |
bool | repoEmpty () const |
RepoSizeType | repoSize () const |
RepoConstIterator | repoBegin () const |
RepoConstIterator | repoEnd () const |
bool | hasRepo (const std::string &alias) const |
RepoInfo | getRepo (const std::string &alias) const |
expected< zypp::Pathname > | metadataPath (const RepoInfo &info) const |
expected< zypp::Pathname > | packagesPath (const RepoInfo &info) const |
expected< RepoStatus > | metadataStatus (const RepoInfo &info) const |
expected< void > | cleanMetadata (const RepoInfo &info, ProgressObserverRef myProgress=nullptr) |
expected< void > | cleanPackages (const RepoInfo &info, ProgressObserverRef myProgress=nullptr, bool isAutoClean=false) |
expected< void > | cleanCacheDirGarbage (ProgressObserverRef myProgress=nullptr) |
expected< void > | cleanCache (const RepoInfo &info, ProgressObserverRef myProgress=nullptr) |
expected< bool > | isCached (const RepoInfo &info) const |
expected< RepoStatus > | cacheStatus (const RepoInfo &info) const |
expected< void > | loadFromCache (const RepoInfo &info, ProgressObserverRef myProgress=nullptr) |
expected< RepoInfo > | addProbedRepository (RepoInfo info, zypp::repo::RepoType probedType) |
expected< void > | removeRepository (const RepoInfo &info, ProgressObserverRef myProgress=nullptr) |
expected< RepoInfo > | modifyRepository (const std::string &alias, const RepoInfo &newinfo_r, ProgressObserverRef myProgress=nullptr) |
expected< RepoInfo > | getRepositoryInfo (const std::string &alias) |
expected< RepoInfo > | getRepositoryInfo (const zypp::Url &url, const zypp::url::ViewOption &urlview) |
expected< RefreshCheckStatus > | checkIfToRefreshMetadata (const RepoInfo &info, const zypp::MirroredOrigin &origin, RawMetadataRefreshPolicy policy) |
expected< RefreshCheckStatus > | checkIfToRefreshMetadata (const RepoInfo &info, const zypp::Url &url, RawMetadataRefreshPolicy policy) |
expected< void > | refreshMetadata (const RepoInfo &info, RawMetadataRefreshPolicy policy, ProgressObserverRef myProgress=nullptr) |
Refresh local raw cache. | |
std::vector< std::pair< RepoInfo, expected< void > > > | refreshMetadata (std::vector< RepoInfo > infos, RawMetadataRefreshPolicy policy, ProgressObserverRef myProgress=nullptr) |
expected< zypp::repo::RepoType > | probe (const zypp::MirroredOrigin &origin, const zypp::Pathname &path=zypp::Pathname()) const |
Probe the metadata type of a repository located at url . | |
expected< void > | buildCache (const RepoInfo &info, CacheBuildPolicy policy, ProgressObserverRef myProgress=nullptr) |
expected< RepoInfo > | addRepository (const RepoInfo &info, const ProgressObserverRef myProgress=nullptr, const zypp::TriBool &forcedProbe=zypp::indeterminate) |
expected< void > | addRepositories (const zypp::Url &url, ProgressObserverRef myProgress=nullptr) |
bool | serviceEmpty () const |
ServiceSizeType | serviceSize () const |
ServiceConstIterator | serviceBegin () const |
ServiceConstIterator | serviceEnd () const |
bool | hasService (const std::string &alias) const |
ServiceInfo | getService (const std::string &alias) const |
expected< zypp::repo::ServiceType > | probeService (const zypp::Url &url) const |
expected< void > | addService (const ServiceInfo &service) |
expected< void > | addService (const std::string &alias, const zypp::Url &url) |
expected< void > | removeService (const std::string &alias) |
expected< void > | removeService (const ServiceInfo &service) |
expected< void > | refreshService (const std::string &alias, const RefreshServiceOptions &options_r) |
expected< void > | refreshService (const ServiceInfo &service, const RefreshServiceOptions &options_r) |
expected< void > | refreshServices (const RefreshServiceOptions &options_r) |
expected< void > | modifyService (const std::string &oldAlias, const ServiceInfo &newService) |
expected< void > | setCacheStatus (const RepoInfo &info, const RepoStatus &status) |
expected< void > | refreshGeoIp (const RepoInfo::url_set &urls) |
template<typename OutputIterator> | |
void | getRepositoriesInService (const std::string &alias, OutputIterator out) const |
zypp::Pathname | generateNonExistingName (const zypp::Pathname &dir, const std::string &basefilename) const |
Generate a non existing filename in a directory, using a base name. | |
std::string | generateFilename (const RepoInfo &info) const |
std::string | generateFilename (const ServiceInfo &info) const |
const RepoSet & | repos () const |
RepoSet & | reposManip () |
PluginRepoverification | pluginRepoverification () const |
Public Member Functions inherited from zyppng::Base | |
Base () | |
virtual | ~Base () |
WeakPtr | parent () const |
void | addChild (const Base::Ptr &child) |
void | removeChild (const Ptr &child) |
const std::unordered_set< Ptr > & | children () const |
std::thread::id | threadId () const |
template<typename T> | |
std::vector< std::weak_ptr< T > > | findChildren () const |
template<typename T> | |
std::shared_ptr< T > | shared_this () const |
template<typename T> | |
std::shared_ptr< T > | shared_this () |
template<typename T> | |
std::weak_ptr< T > | weak_this () const |
template<typename T> | |
std::weak_ptr< T > | weak_this () |
template<typename SenderFunc, typename ReceiverFunc> | |
auto | connect (SenderFunc &&sFun, typename internal::MemberFunction< ReceiverFunc >::ClassType &recv, ReceiverFunc &&rFunc) |
template<typename SenderFunc, typename ReceiverFunc, typename ... Tracker> | |
std::enable_if_t< std::is_member_function_pointer_v< SenderFunc >, connection > | connectFunc (SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers) |
Static Public Member Functions | |
template<typename ... Args> | |
static expected< std::shared_ptr< RepoManager< ZyppContextRefType > > > | create (Args &&...args) |
static expected< RepoStatus > | metadataStatus (const RepoInfo &info, const RepoManagerOptions &options) |
static zypp::repo::RepoType | probeCache (const zypp::Pathname &path_r) |
Probe Metadata in a local cache directory. | |
static expected< RepoStatus > | cacheStatus (const RepoInfo &info, const RepoManagerOptions &options) |
static expected< void > | touchIndexFile (const RepoInfo &info, const RepoManagerOptions &options) |
Static Public Member Functions inherited from zyppng::Base | |
template<typename Obj, typename Functor> | |
static decltype(auto) | make_base_slot (Obj *o, Functor &&f) |
template<typename SenderFunc, typename ReceiverFunc> | |
static auto | connect (typename internal::MemberFunction< SenderFunc >::ClassType &s, SenderFunc &&sFun, typename internal::MemberFunction< ReceiverFunc >::ClassType &recv, ReceiverFunc &&rFunc) |
template<typename SenderFunc, typename ReceiverFunc, typename ... Tracker> | |
static auto | connectFunc (typename internal::MemberFunction< SenderFunc >::ClassType &s, SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers) |
Protected Member Functions | |
expected< void > | saveService (ServiceInfo &service) const |
expected< void > | touchIndexFile (const RepoInfo &info) |
expected< void > | init_knownServices () |
expected< void > | init_knownRepositories () |
Protected Member Functions inherited from zyppng::Base | |
Base (BasePrivate &dd) |
Protected Attributes | |
ContextRefType | _zyppContext |
RepoManagerOptions | _options |
RepoSet | _reposX |
ServiceSet | _services |
PluginRepoverification | _pluginRepoverification |
zypp::DefaultIntegral< bool, false > | _reposDirty |
Protected Attributes inherited from zyppng::Base | |
std::unique_ptr< BasePrivate > | d_ptr |
Private Member Functions | |
ZYPP_ADD_PRIVATE_CONSTR_HELPER () | |
ZYPP_ENABLE_MAYBE_ASYNC_MIXIN ((std::is_same_v< ZyppContextRefType, ContextRef >)) | |
Private Member Functions inherited from zyppng::MaybeAsyncMixin< std::is_same_v< ZyppContextRefType, ContextRef > > | |
auto | makeReadyResult (T &&res) |
Additional Inherited Members | |
Private Types inherited from zyppng::MaybeAsyncMixin< std::is_same_v< ZyppContextRefType, ContextRef > > | |
using | MaybeAsyncRef |
Static Private Attributes inherited from zyppng::MaybeAsyncMixin< std::is_same_v< ZyppContextRefType, ContextRef > > | |
static constexpr bool | is_async |
The RepoManager class Provides knowledge and methods to maintain repo settings and metadata for a given context.
Depending on the ZyppContextRefType the convenienve functions execute the workflows in a sync or async way. In sync mode libzypp's legacy reports are executed. Otherwise progress report is only provided via the ProgressObserver classes.
Definition at line 247 of file repomanager.h.
using zyppng::RepoManager< ZyppContextRefType >::ContextRefType = ZyppContextRefType |
Definition at line 254 of file repomanager.h.
using zyppng::RepoManager< ZyppContextRefType >::ContextType = typename ZyppContextRefType::element_type |
Definition at line 255 of file repomanager.h.
using zyppng::RepoManager< ZyppContextRefType >::RawMetadataRefreshPolicy = zypp::RepoManagerFlags::RawMetadataRefreshPolicy |
Definition at line 257 of file repomanager.h.
using zyppng::RepoManager< ZyppContextRefType >::CacheBuildPolicy = zypp::RepoManagerFlags::CacheBuildPolicy |
Definition at line 258 of file repomanager.h.
using zyppng::RepoManager< ZyppContextRefType >::RefreshCheckStatus = zypp::RepoManagerFlags::RefreshCheckStatus |
Definition at line 261 of file repomanager.h.
using zyppng::RepoManager< ZyppContextRefType >::RefreshServiceBit = zypp::RepoManagerFlags::RefreshServiceBit |
Flags for tuning RefreshService.
Definition at line 264 of file repomanager.h.
using zyppng::RepoManager< ZyppContextRefType >::RefreshServiceOptions = zypp::RepoManagerFlags::RefreshServiceOptions |
Definition at line 265 of file repomanager.h.
using zyppng::RepoManager< ZyppContextRefType >::ServiceSet = std::set<ServiceInfo> |
ServiceInfo typedefs.
Definition at line 293 of file repomanager.h.
using zyppng::RepoManager< ZyppContextRefType >::ServiceConstIterator = ServiceSet::const_iterator |
Definition at line 294 of file repomanager.h.
using zyppng::RepoManager< ZyppContextRefType >::ServiceSizeType = ServiceSet::size_type |
Definition at line 295 of file repomanager.h.
using zyppng::RepoManager< ZyppContextRefType >::RepoSet = std::set<RepoInfo> |
RepoInfo typedefs.
Definition at line 298 of file repomanager.h.
using zyppng::RepoManager< ZyppContextRefType >::RepoConstIterator = RepoSet::const_iterator |
Definition at line 299 of file repomanager.h.
using zyppng::RepoManager< ZyppContextRefType >::RepoSizeType = RepoSet::size_type |
Definition at line 300 of file repomanager.h.
|
virtual |
Definition at line 249 of file repomanager.cc.
|
private |
|
private |
zyppng::RepoManager< ZyppContextRefType >::ZYPP_DECL_PRIVATE_CONSTR_ARGS | ( | RepoManager< ZyppContextRefType > | , |
ZyppContextRefType | zyppCtx, | ||
RepoManagerOptions | opt ) |
|
inlinestatic |
Definition at line 271 of file repomanager.h.
expected< void > zyppng::RepoManager< ZyppContextRefType >::initialize | ( | ) |
Definition at line 294 of file repomanager.cc.
|
inline |
Definition at line 309 of file repomanager.h.
const RepoManagerOptions & zyppng::RepoManager< ZyppContextRefType >::options | ( | ) | const |
Definition at line 303 of file repomanager.cc.
|
inline |
Definition at line 315 of file repomanager.h.
|
inline |
Definition at line 316 of file repomanager.h.
|
inline |
Definition at line 317 of file repomanager.h.
|
inline |
Definition at line 318 of file repomanager.h.
|
inline |
Definition at line 320 of file repomanager.h.
|
inline |
Definition at line 323 of file repomanager.h.
|
inline |
Definition at line 330 of file repomanager.h.
|
inline |
Definition at line 333 of file repomanager.h.
|
static |
Definition at line 309 of file repomanager.cc.
expected< RepoStatus > zyppng::RepoManager< ZyppContextRefType >::metadataStatus | ( | const RepoInfo & | info | ) | const |
Definition at line 373 of file repomanager.cc.
expected< void > zyppng::RepoManager< ZyppContextRefType >::cleanMetadata | ( | const RepoInfo & | info, |
ProgressObserverRef | myProgress = nullptr ) |
Definition at line 379 of file repomanager.cc.
expected< void > zyppng::RepoManager< ZyppContextRefType >::cleanPackages | ( | const RepoInfo & | info, |
ProgressObserverRef | myProgress = nullptr, | ||
bool | isAutoClean = false ) |
Definition at line 398 of file repomanager.cc.
|
static |
Probe Metadata in a local cache directory.
Definition at line 425 of file repomanager.cc.
expected< void > zyppng::RepoManager< ZyppContextRefType >::cleanCacheDirGarbage | ( | ProgressObserverRef | myProgress = nullptr | ) |
Definition at line 443 of file repomanager.cc.
expected< void > zyppng::RepoManager< ZyppContextRefType >::cleanCache | ( | const RepoInfo & | info, |
ProgressObserverRef | myProgress = nullptr ) |
Definition at line 500 of file repomanager.cc.
|
inline |
Definition at line 349 of file repomanager.h.
|
inline |
Definition at line 356 of file repomanager.h.
|
inlinestatic |
Definition at line 359 of file repomanager.h.
expected< void > zyppng::RepoManager< ZyppContextRefType >::loadFromCache | ( | const RepoInfo & | info, |
ProgressObserverRef | myProgress = nullptr ) |
Definition at line 520 of file repomanager.cc.
expected< RepoInfo > zyppng::RepoManager< ZyppContextRefType >::addProbedRepository | ( | RepoInfo | info, |
zypp::repo::RepoType | probedType ) |
Definition at line 572 of file repomanager.cc.
expected< void > zyppng::RepoManager< ZyppContextRefType >::removeRepository | ( | const RepoInfo & | info, |
ProgressObserverRef | myProgress = nullptr ) |
Definition at line 612 of file repomanager.cc.
expected< RepoInfo > zyppng::RepoManager< ZyppContextRefType >::modifyRepository | ( | const std::string & | alias, |
const RepoInfo & | newinfo_r, | ||
ProgressObserverRef | myProgress = nullptr ) |
Definition at line 701 of file repomanager.cc.
expected< RepoInfo > zyppng::RepoManager< ZyppContextRefType >::getRepositoryInfo | ( | const std::string & | alias | ) |
Definition at line 790 of file repomanager.cc.
expected< RepoInfo > zyppng::RepoManager< ZyppContextRefType >::getRepositoryInfo | ( | const zypp::Url & | url, |
const zypp::url::ViewOption & | urlview ) |
Definition at line 806 of file repomanager.cc.
expected< typename RepoManager< ZyppContextRefType >::RefreshCheckStatus > zyppng::RepoManager< ZyppContextRefType >::checkIfToRefreshMetadata | ( | const RepoInfo & | info, |
const zypp::MirroredOrigin & | origin, | ||
RawMetadataRefreshPolicy | policy ) |
Definition at line 828 of file repomanager.cc.
|
inline |
Definition at line 381 of file repomanager.h.
expected< void > zyppng::RepoManager< ZyppContextRefType >::refreshMetadata | ( | const RepoInfo & | info, |
RawMetadataRefreshPolicy | policy, | ||
ProgressObserverRef | myProgress = nullptr ) |
Refresh local raw cache.
Will try to download the metadata
In case of failure the metadata remains as it was before.
The returned expected can contain one of the following errors: repo::RepoNoUrlException if no urls are available. repo::RepoNoAliasException if can't figure an alias repo::RepoUnknownTypeException if the metadata is unknown repo::RepoException if the repository is invalid (no valid metadata found at any of baseurls)
Definition at line 844 of file repomanager.cc.
std::vector< std::pair< RepoInfo, expected< void > > > zyppng::RepoManager< ZyppContextRefType >::refreshMetadata | ( | std::vector< RepoInfo > | infos, |
RawMetadataRefreshPolicy | policy, | ||
ProgressObserverRef | myProgress = nullptr ) |
Definition at line 889 of file repomanager.cc.
expected< zypp::repo::RepoType > zyppng::RepoManager< ZyppContextRefType >::probe | ( | const zypp::MirroredOrigin & | origin, |
const zypp::Pathname & | path = zypp::Pathname() ) const |
Probe the metadata type of a repository located at url
.
Urls here may be rewritten by MediaSetAccess or zyppng::Provide to reflect the correct media number.
Definition at line 965 of file repomanager.cc.
expected< void > zyppng::RepoManager< ZyppContextRefType >::buildCache | ( | const RepoInfo & | info, |
CacheBuildPolicy | policy, | ||
ProgressObserverRef | myProgress = nullptr ) |
Definition at line 981 of file repomanager.cc.
expected< RepoInfo > zyppng::RepoManager< ZyppContextRefType >::addRepository | ( | const RepoInfo & | info, |
const ProgressObserverRef | myProgress = nullptr, | ||
const zypp::TriBool & | forcedProbe = zypp::indeterminate ) |
Adds the repository in info and returns the updated RepoInfo object.
Definition at line 994 of file repomanager.cc.
expected< void > zyppng::RepoManager< ZyppContextRefType >::addRepositories | ( | const zypp::Url & | url, |
ProgressObserverRef | myProgress = nullptr ) |
Definition at line 1000 of file repomanager.cc.
|
inline |
Definition at line 418 of file repomanager.h.
|
inline |
Definition at line 419 of file repomanager.h.
|
inline |
Definition at line 420 of file repomanager.h.
|
inline |
Definition at line 421 of file repomanager.h.
|
inline |
Definition at line 423 of file repomanager.h.
|
inline |
Definition at line 426 of file repomanager.h.
expected< zypp::repo::ServiceType > zyppng::RepoManager< ZyppContextRefType >::probeService | ( | const zypp::Url & | url | ) | const |
Definition at line 1007 of file repomanager.cc.
expected< void > zyppng::RepoManager< ZyppContextRefType >::addService | ( | const ServiceInfo & | service | ) |
Definition at line 1013 of file repomanager.cc.
|
inline |
Definition at line 437 of file repomanager.h.
expected< void > zyppng::RepoManager< ZyppContextRefType >::removeService | ( | const std::string & | alias | ) |
Definition at line 1073 of file repomanager.cc.
|
inline |
Definition at line 441 of file repomanager.h.
expected< void > zyppng::RepoManager< ZyppContextRefType >::refreshService | ( | const std::string & | alias, |
const RefreshServiceOptions & | options_r ) |
Definition at line 1042 of file repomanager.cc.
|
inline |
Definition at line 445 of file repomanager.h.
expected< void > zyppng::RepoManager< ZyppContextRefType >::refreshServices | ( | const RefreshServiceOptions & | options_r | ) |
Definition at line 1051 of file repomanager.cc.
expected< void > zyppng::RepoManager< ZyppContextRefType >::modifyService | ( | const std::string & | oldAlias, |
const ServiceInfo & | newService ) |
Definition at line 1135 of file repomanager.cc.
|
static |
Definition at line 1275 of file repomanager.cc.
|
inline |
Definition at line 454 of file repomanager.h.
expected< void > zyppng::RepoManager< ZyppContextRefType >::refreshGeoIp | ( | const RepoInfo::url_set & | urls | ) |
Checks for any of the given urls if there is no geoip data available, caches the results in the metadata cache for 24hrs. The given urls need to be configured as valid geoIP targets ( usually download.opensuse.org )
Definition at line 1317 of file repomanager.cc.
|
inline |
Definition at line 476 of file repomanager.h.
zypp::Pathname zyppng::RepoManager< ZyppContextRefType >::generateNonExistingName | ( | const zypp::Pathname & | dir, |
const std::string & | basefilename ) const |
Generate a non existing filename in a directory, using a base name.
For example if a directory contains 3 files
|– bar |– foo `– moo
If you try to generate a unique filename for this directory, based on "ruu" you will get "ruu", but if you use the base "foo" you will get "foo_1"
dir | Directory where the file needs to be unique |
basefilename | string to base the filename on. |
Definition at line 1261 of file repomanager.cc.
|
inline |
Definition at line 486 of file repomanager.h.
|
inline |
Definition at line 489 of file repomanager.h.
|
protected |
Definition at line 1218 of file repomanager.cc.
|
protected |
Definition at line 1323 of file repomanager.cc.
|
protected |
Definition at line 1329 of file repomanager.cc.
|
protected |
Definition at line 1403 of file repomanager.cc.
|
inline |
Definition at line 502 of file repomanager.h.
|
inline |
Definition at line 503 of file repomanager.h.
|
inline |
Definition at line 506 of file repomanager.h.
|
protected |
Definition at line 510 of file repomanager.h.
|
protected |
Definition at line 511 of file repomanager.h.
|
protected |
Definition at line 512 of file repomanager.h.
|
protected |
Definition at line 513 of file repomanager.h.
|
protected |
Definition at line 514 of file repomanager.h.
|
protected |
Definition at line 515 of file repomanager.h.