|
libzypp 17.38.15
|
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 |
| 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) |
| void | setData (uint32_t quark, zypp::AutoDispose< void * > data) |
| void * | data (uint32_t quark) |
| void | clearData (uint32_t quark) |
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 |
| zypp::DefaultIntegral< bool, false > | _poolIdsReserved |
| int | _poolSnapshotState = 0 |
| 0 unknown, 1 mapped, -1 unusable | |
| Protected Attributes inherited from zyppng::Base | |
| std::unique_ptr< BasePrivate > | d_ptr |
Private Member Functions | |
| ZYPP_ADD_PRIVATE_CONSTR_HELPER () | |
| void | reservePoolIds () |
| Peek at the solv files of all enabled repos and size the pool's id hashes once for their sum, before the first repo is loaded. | |
| std::string | poolSnapshotCookie () const |
| Cookie describing the enabled repos and their solv caches, empty if the pool snapshot cannot be used. | |
| bool | tryLoadPoolSnapshot () |
| Try to map the pool snapshot on the first loadFromCache, and arm writing a fresh one after a normal load. | |
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 251 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.
Definition at line 296 of file repomanager.cc.
|
inline |
Definition at line 300 of file repomanager.h.
| const RepoManagerOptions & zyppng::RepoManager::options | ( | ) | const |
Definition at line 305 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 311 of file repomanager.cc.
| expected< RepoStatus > zyppng::RepoManager::metadataStatus | ( | const RepoInfo & | info | ) | const |
Definition at line 375 of file repomanager.cc.
| expected< void > zyppng::RepoManager::cleanMetadata | ( | const RepoInfo & | info, |
| ProgressObserverRef | myProgress = nullptr ) |
Definition at line 381 of file repomanager.cc.
| expected< void > zyppng::RepoManager::cleanPackages | ( | const RepoInfo & | info, |
| ProgressObserverRef | myProgress = nullptr, | ||
| bool | isAutoClean = false ) |
Definition at line 400 of file repomanager.cc.
|
static |
Probe Metadata in a local cache directory.
Definition at line 427 of file repomanager.cc.
| expected< void > zyppng::RepoManager::cleanCacheDirGarbage | ( | ProgressObserverRef | myProgress = nullptr | ) |
Definition at line 445 of file repomanager.cc.
| expected< void > zyppng::RepoManager::cleanCache | ( | const RepoInfo & | info, |
| ProgressObserverRef | myProgress = nullptr ) |
Definition at line 502 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 637 of file repomanager.cc.
|
private |
Peek at the solv files of all enabled repos and size the pool's id hashes once for their sum, before the first repo is loaded.
Definition at line 603 of file repomanager.cc.
|
private |
Cookie describing the enabled repos and their solv caches, empty if the pool snapshot cannot be used.
Definition at line 531 of file repomanager.cc.
|
private |
Try to map the pool snapshot on the first loadFromCache, and arm writing a fresh one after a normal load.
Definition at line 579 of file repomanager.cc.
| expected< RepoInfo > zyppng::RepoManager::addProbedRepository | ( | RepoInfo | info, |
| zypp::repo::RepoType | probedType ) |
Definition at line 704 of file repomanager.cc.
| expected< void > zyppng::RepoManager::removeRepository | ( | const RepoInfo & | info, |
| ProgressObserverRef | myProgress = nullptr ) |
Definition at line 744 of file repomanager.cc.
| expected< RepoInfo > zyppng::RepoManager::modifyRepository | ( | const std::string & | alias, |
| const RepoInfo & | newinfo_r, | ||
| ProgressObserverRef | myProgress = nullptr ) |
Definition at line 833 of file repomanager.cc.
Definition at line 922 of file repomanager.cc.
| expected< RepoInfo > zyppng::RepoManager::getRepositoryInfo | ( | const zypp::Url & | url, |
| const zypp::url::ViewOption & | urlview ) |
Definition at line 938 of file repomanager.cc.
| expected< typename RepoManager::RefreshCheckStatus > zyppng::RepoManager::checkIfToRefreshMetadata | ( | const RepoInfo & | info, |
| const zypp::MirroredOrigin & | origin, | ||
| RawMetadataRefreshPolicy | policy ) |
Definition at line 960 of file repomanager.cc.
|
inline |
Definition at line 387 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 976 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 1021 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 1097 of file repomanager.cc.
| expected< void > zyppng::RepoManager::buildCache | ( | const RepoInfo & | info, |
| CacheBuildPolicy | policy, | ||
| ProgressObserverRef | myProgress = nullptr ) |
Definition at line 1113 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 1126 of file repomanager.cc.
| expected< void > zyppng::RepoManager::addRepositories | ( | const zypp::Url & | url, |
| ProgressObserverRef | myProgress = nullptr ) |
Definition at line 1132 of file repomanager.cc.
|
inline |
Definition at line 424 of file repomanager.h.
|
inline |
Definition at line 425 of file repomanager.h.
|
inline |
Definition at line 426 of file repomanager.h.
|
inline |
Definition at line 427 of file repomanager.h.
|
inline |
Definition at line 429 of file repomanager.h.
|
inline |
Definition at line 432 of file repomanager.h.
| expected< zypp::repo::ServiceType > zyppng::RepoManager::probeService | ( | const zypp::Url & | url | ) | const |
Definition at line 1139 of file repomanager.cc.
| expected< void > zyppng::RepoManager::addService | ( | const ServiceInfo & | service | ) |
Definition at line 1145 of file repomanager.cc.
|
inline |
Definition at line 443 of file repomanager.h.
Definition at line 1205 of file repomanager.cc.
|
inline |
Definition at line 447 of file repomanager.h.
| expected< void > zyppng::RepoManager::refreshService | ( | const std::string & | alias, |
| const RefreshServiceOptions & | options_r ) |
Definition at line 1174 of file repomanager.cc.
|
inline |
Definition at line 451 of file repomanager.h.
| expected< void > zyppng::RepoManager::refreshServices | ( | const RefreshServiceOptions & | options_r | ) |
Definition at line 1183 of file repomanager.cc.
| expected< void > zyppng::RepoManager::modifyService | ( | const std::string & | oldAlias, |
| const ServiceInfo & | newService ) |
Definition at line 1267 of file repomanager.cc.
|
static |
Definition at line 1407 of file repomanager.cc.
|
inline |
Definition at line 460 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 )
Definition at line 1448 of file repomanager.cc.
|
inline |
Definition at line 482 of file repomanager.h.
| zypp::Pathname zyppng::RepoManager::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 1393 of file repomanager.cc.
|
inline |
Definition at line 492 of file repomanager.h.
|
inline |
Definition at line 495 of file repomanager.h.
|
protected |
Definition at line 1350 of file repomanager.cc.
Definition at line 1453 of file repomanager.cc.
Definition at line 1459 of file repomanager.cc.
Definition at line 1533 of file repomanager.cc.
|
inline |
Definition at line 508 of file repomanager.h.
|
inline |
Definition at line 509 of file repomanager.h.
|
inline |
Definition at line 512 of file repomanager.h.
|
protected |
Definition at line 516 of file repomanager.h.
|
protected |
Definition at line 517 of file repomanager.h.
|
protected |
Definition at line 518 of file repomanager.h.
|
protected |
Definition at line 519 of file repomanager.h.
|
protected |
Definition at line 520 of file repomanager.h.
|
protected |
Definition at line 521 of file repomanager.h.
|
protected |
Definition at line 522 of file repomanager.h.
|
protected |
0 unknown, 1 mapped, -1 unusable
Definition at line 523 of file repomanager.h.