|
libzypp 17.38.3
|
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 = ContextRef |
| using | ContextType = Context |
| 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, ContextRef 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 |
| 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 > > | 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 () | |
The RepoManager class Provides knowledge and methods to maintain repo settings and metadata for a given context.
Depending on the ContextRef 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 240 of file repomanager.h.
| using zyppng::RepoManager::ContextRefType = ContextRef |
Definition at line 245 of file repomanager.h.
Definition at line 246 of file repomanager.h.
| using zyppng::RepoManager::RawMetadataRefreshPolicy = zypp::RepoManagerFlags::RawMetadataRefreshPolicy |
Definition at line 248 of file repomanager.h.
Definition at line 249 of file repomanager.h.
Definition at line 252 of file repomanager.h.
Flags for tuning RefreshService.
Definition at line 255 of file repomanager.h.
Definition at line 256 of file repomanager.h.
| using zyppng::RepoManager::ServiceSet = std::set<ServiceInfo> |
ServiceInfo typedefs.
Definition at line 284 of file repomanager.h.
| using zyppng::RepoManager::ServiceConstIterator = ServiceSet::const_iterator |
Definition at line 285 of file repomanager.h.
| using zyppng::RepoManager::ServiceSizeType = ServiceSet::size_type |
Definition at line 286 of file repomanager.h.
| using zyppng::RepoManager::RepoSet = std::set<RepoInfo> |
RepoInfo typedefs.
Definition at line 289 of file repomanager.h.
| using zyppng::RepoManager::RepoConstIterator = RepoSet::const_iterator |
Definition at line 290 of file repomanager.h.
| using zyppng::RepoManager::RepoSizeType = RepoSet::size_type |
Definition at line 291 of file repomanager.h.
|
virtual |
Definition at line 247 of file repomanager.cc.
|
private |
| zyppng::RepoManager::ZYPP_DECL_PRIVATE_CONSTR_ARGS | ( | RepoManager | , |
| ContextRef | zyppCtx, | ||
| RepoManagerOptions | opt ) |
|
inlinestatic |
Definition at line 262 of file repomanager.h.
| expected< void > zyppng::RepoManager::initialize | ( | ) |
Definition at line 292 of file repomanager.cc.
|
inline |
Definition at line 300 of file repomanager.h.
| const RepoManagerOptions & zyppng::RepoManager::options | ( | ) | const |
Definition at line 301 of file repomanager.cc.
|
inline |
Definition at line 306 of file repomanager.h.
|
inline |
Definition at line 307 of file repomanager.h.
|
inline |
Definition at line 308 of file repomanager.h.
|
inline |
Definition at line 309 of file repomanager.h.
|
inline |
Definition at line 311 of file repomanager.h.
|
inline |
Definition at line 314 of file repomanager.h.
|
inline |
Definition at line 321 of file repomanager.h.
|
inline |
Definition at line 324 of file repomanager.h.
|
static |
Definition at line 307 of file repomanager.cc.
| expected< RepoStatus > zyppng::RepoManager::metadataStatus | ( | const RepoInfo & | info | ) | const |
Definition at line 371 of file repomanager.cc.
| expected< void > zyppng::RepoManager::cleanMetadata | ( | const RepoInfo & | info, |
| ProgressObserverRef | myProgress = nullptr ) |
Definition at line 377 of file repomanager.cc.
| expected< void > zyppng::RepoManager::cleanPackages | ( | const RepoInfo & | info, |
| ProgressObserverRef | myProgress = nullptr, | ||
| bool | isAutoClean = false ) |
Definition at line 396 of file repomanager.cc.
|
static |
Probe Metadata in a local cache directory.
Definition at line 423 of file repomanager.cc.
| expected< void > zyppng::RepoManager::cleanCacheDirGarbage | ( | ProgressObserverRef | myProgress = nullptr | ) |
Definition at line 441 of file repomanager.cc.
| expected< void > zyppng::RepoManager::cleanCache | ( | const RepoInfo & | info, |
| ProgressObserverRef | myProgress = nullptr ) |
Definition at line 498 of file repomanager.cc.
Definition at line 340 of file repomanager.h.
|
inline |
Definition at line 347 of file repomanager.h.
|
inlinestatic |
Definition at line 350 of file repomanager.h.
| expected< void > zyppng::RepoManager::loadFromCache | ( | const RepoInfo & | info, |
| ProgressObserverRef | myProgress = nullptr ) |
Definition at line 518 of file repomanager.cc.
| expected< RepoInfo > zyppng::RepoManager::addProbedRepository | ( | RepoInfo | info, |
| zypp::repo::RepoType | probedType ) |
Definition at line 570 of file repomanager.cc.
| expected< void > zyppng::RepoManager::removeRepository | ( | const RepoInfo & | info, |
| ProgressObserverRef | myProgress = nullptr ) |
Definition at line 610 of file repomanager.cc.
| expected< RepoInfo > zyppng::RepoManager::modifyRepository | ( | const std::string & | alias, |
| const RepoInfo & | newinfo_r, | ||
| ProgressObserverRef | myProgress = nullptr ) |
Definition at line 699 of file repomanager.cc.
Definition at line 788 of file repomanager.cc.
| expected< RepoInfo > zyppng::RepoManager::getRepositoryInfo | ( | const zypp::Url & | url, |
| const zypp::url::ViewOption & | urlview ) |
Definition at line 804 of file repomanager.cc.
| expected< typename RepoManager::RefreshCheckStatus > zyppng::RepoManager::checkIfToRefreshMetadata | ( | const RepoInfo & | info, |
| const zypp::MirroredOrigin & | origin, | ||
| RawMetadataRefreshPolicy | policy ) |
Definition at line 826 of file repomanager.cc.
|
inline |
Definition at line 372 of file repomanager.h.
| expected< void > zyppng::RepoManager::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 842 of file repomanager.cc.
| std::vector< std::pair< RepoInfo, expected< void > > > zyppng::RepoManager::refreshMetadata | ( | std::vector< RepoInfo > | infos, |
| RawMetadataRefreshPolicy | policy, | ||
| ProgressObserverRef | myProgress = nullptr ) |
Definition at line 887 of file repomanager.cc.
| expected< zypp::repo::RepoType > zyppng::RepoManager::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 963 of file repomanager.cc.
| expected< void > zyppng::RepoManager::buildCache | ( | const RepoInfo & | info, |
| CacheBuildPolicy | policy, | ||
| ProgressObserverRef | myProgress = nullptr ) |
Definition at line 979 of file repomanager.cc.
| expected< RepoInfo > zyppng::RepoManager::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 992 of file repomanager.cc.
| expected< void > zyppng::RepoManager::addRepositories | ( | const zypp::Url & | url, |
| ProgressObserverRef | myProgress = nullptr ) |
Definition at line 998 of file repomanager.cc.
|
inline |
Definition at line 409 of file repomanager.h.
|
inline |
Definition at line 410 of file repomanager.h.
|
inline |
Definition at line 411 of file repomanager.h.
|
inline |
Definition at line 412 of file repomanager.h.
|
inline |
Definition at line 414 of file repomanager.h.
|
inline |
Definition at line 417 of file repomanager.h.
| expected< zypp::repo::ServiceType > zyppng::RepoManager::probeService | ( | const zypp::Url & | url | ) | const |
Definition at line 1005 of file repomanager.cc.
| expected< void > zyppng::RepoManager::addService | ( | const ServiceInfo & | service | ) |
Definition at line 1011 of file repomanager.cc.
|
inline |
Definition at line 428 of file repomanager.h.
| expected< void > zyppng::RepoManager::removeService | ( | const std::string & | alias | ) |
Definition at line 1071 of file repomanager.cc.
|
inline |
Definition at line 432 of file repomanager.h.
| expected< void > zyppng::RepoManager::refreshService | ( | const std::string & | alias, |
| const RefreshServiceOptions & | options_r ) |
Definition at line 1040 of file repomanager.cc.
|
inline |
Definition at line 436 of file repomanager.h.
| expected< void > zyppng::RepoManager::refreshServices | ( | const RefreshServiceOptions & | options_r | ) |
Definition at line 1049 of file repomanager.cc.
| expected< void > zyppng::RepoManager::modifyService | ( | const std::string & | oldAlias, |
| const ServiceInfo & | newService ) |
Definition at line 1133 of file repomanager.cc.
|
static |
|
inline |
Definition at line 445 of file repomanager.h.
| expected< void > zyppng::RepoManager::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 )
|
inline |
Definition at line 467 of file repomanager.h.
| zypp::Pathname zyppng::RepoManager::generateNonExistingName | ( | const zypp::Pathname & | dir, |
| const std::string & | basefilename ) const |
|
inline |
Definition at line 477 of file repomanager.h.
|
inline |
Definition at line 480 of file repomanager.h.
|
protected |
Definition at line 1216 of file repomanager.cc.
|
protected |
|
protected |
Definition at line 1399 of file repomanager.cc.
|
inline |
Definition at line 493 of file repomanager.h.
|
inline |
Definition at line 494 of file repomanager.h.
|
inline |
Definition at line 497 of file repomanager.h.
|
protected |
Definition at line 501 of file repomanager.h.
|
protected |
Definition at line 502 of file repomanager.h.
|
protected |
Definition at line 503 of file repomanager.h.
|
protected |
Definition at line 504 of file repomanager.h.
|
protected |
Definition at line 505 of file repomanager.h.
|
protected |
Definition at line 506 of file repomanager.h.