libzypp 17.35.13
|
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 |
![]() | |
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::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::Url &url, 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, ProgressObserverRef myProgress=nullptr) |
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 () |
![]() | |
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) |
![]() | |
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 () |
![]() | |
Base (BasePrivate &dd) | |
Protected Attributes | |
ContextRefType | _zyppContext |
RepoManagerOptions | _options |
RepoSet | _reposX |
ServiceSet | _services |
zypp_private::repo::PluginRepoverification | _pluginRepoverification |
zypp::DefaultIntegral< bool, false > | _reposDirty |
![]() | |
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 >)) | |
![]() | |
auto | makeReadyResult (T &&res) |
Additional Inherited Members | |
![]() | |
using | MaybeAsyncRef |
![]() | |
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.
using zyppng::RepoManager< T >::ContextRefType = ZyppContextRefType |
Definition at line 253 of file repomanager.h.
using zyppng::RepoManager< T >::ContextType = typename ZyppContextRefType::element_type |
Definition at line 254 of file repomanager.h.
using zyppng::RepoManager< T >::RawMetadataRefreshPolicy = zypp::RepoManagerFlags::RawMetadataRefreshPolicy |
Definition at line 256 of file repomanager.h.
using zyppng::RepoManager< T >::CacheBuildPolicy = zypp::RepoManagerFlags::CacheBuildPolicy |
Definition at line 257 of file repomanager.h.
using zyppng::RepoManager< T >::RefreshCheckStatus = zypp::RepoManagerFlags::RefreshCheckStatus |
Definition at line 260 of file repomanager.h.
using zyppng::RepoManager< T >::RefreshServiceBit = zypp::RepoManagerFlags::RefreshServiceBit |
Flags for tuning RefreshService.
Definition at line 263 of file repomanager.h.
using zyppng::RepoManager< T >::RefreshServiceOptions = zypp::RepoManagerFlags::RefreshServiceOptions |
Definition at line 264 of file repomanager.h.
using zyppng::RepoManager< T >::ServiceSet = std::set<ServiceInfo> |
ServiceInfo typedefs.
Definition at line 292 of file repomanager.h.
using zyppng::RepoManager< T >::ServiceConstIterator = ServiceSet::const_iterator |
Definition at line 293 of file repomanager.h.
using zyppng::RepoManager< T >::ServiceSizeType = ServiceSet::size_type |
Definition at line 294 of file repomanager.h.
using zyppng::RepoManager< T >::RepoSet = std::set<RepoInfo> |
RepoInfo typedefs.
Definition at line 297 of file repomanager.h.
using zyppng::RepoManager< T >::RepoConstIterator = RepoSet::const_iterator |
Definition at line 298 of file repomanager.h.
using zyppng::RepoManager< T >::RepoSizeType = RepoSet::size_type |
Definition at line 299 of file repomanager.h.
|
virtual |
Definition at line 249 of file repomanager.cc.
|
private |
|
private |
zyppng::RepoManager< T >::ZYPP_DECL_PRIVATE_CONSTR_ARGS | ( | RepoManager< T > | , |
ZyppContextRefType | zyppCtx, | ||
RepoManagerOptions | opt ) |
|
inlinestatic |
Definition at line 270 of file repomanager.h.
expected< void > zyppng::RepoManager< ZyppContextRefType >::initialize | ( | ) |
Definition at line 294 of file repomanager.cc.
|
inline |
Definition at line 308 of file repomanager.h.
const RepoManagerOptions & zyppng::RepoManager< ZyppContextRefType >::options | ( | ) | const |
Definition at line 303 of file repomanager.cc.
|
inline |
Definition at line 314 of file repomanager.h.
|
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 319 of file repomanager.h.
|
inline |
Definition at line 322 of file repomanager.h.
|
inline |
Definition at line 329 of file repomanager.h.
|
inline |
Definition at line 332 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 348 of file repomanager.h.
|
inline |
Definition at line 355 of file repomanager.h.
|
inlinestatic |
Definition at line 358 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::Url & | url, | ||
RawMetadataRefreshPolicy | policy ) |
Definition at line 828 of file repomanager.cc.
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 843 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 883 of file repomanager.cc.
expected< zypp::repo::RepoType > zyppng::RepoManager< ZyppContextRefType >::probe | ( | const zypp::Url & | url, |
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 959 of file repomanager.cc.
expected< void > zyppng::RepoManager< ZyppContextRefType >::buildCache | ( | const RepoInfo & | info, |
CacheBuildPolicy | policy, | ||
ProgressObserverRef | myProgress = nullptr ) |
Definition at line 971 of file repomanager.cc.
expected< RepoInfo > zyppng::RepoManager< ZyppContextRefType >::addRepository | ( | const RepoInfo & | info, |
ProgressObserverRef | myProgress = nullptr ) |
Adds the repository in info and returns the updated RepoInfo object.
Definition at line 984 of file repomanager.cc.
expected< void > zyppng::RepoManager< ZyppContextRefType >::addRepositories | ( | const zypp::Url & | url, |
ProgressObserverRef | myProgress = nullptr ) |
Definition at line 990 of file repomanager.cc.
|
inline |
Definition at line 413 of file repomanager.h.
|
inline |
Definition at line 414 of file repomanager.h.
|
inline |
Definition at line 415 of file repomanager.h.
|
inline |
Definition at line 416 of file repomanager.h.
|
inline |
Definition at line 418 of file repomanager.h.
|
inline |
Definition at line 421 of file repomanager.h.
expected< zypp::repo::ServiceType > zyppng::RepoManager< ZyppContextRefType >::probeService | ( | const zypp::Url & | url | ) | const |
Definition at line 997 of file repomanager.cc.
expected< void > zyppng::RepoManager< ZyppContextRefType >::addService | ( | const ServiceInfo & | service | ) |
Definition at line 1003 of file repomanager.cc.
|
inline |
Definition at line 432 of file repomanager.h.
expected< void > zyppng::RepoManager< ZyppContextRefType >::removeService | ( | const std::string & | alias | ) |
Definition at line 1063 of file repomanager.cc.
|
inline |
Definition at line 436 of file repomanager.h.
expected< void > zyppng::RepoManager< ZyppContextRefType >::refreshService | ( | const std::string & | alias, |
const RefreshServiceOptions & | options_r ) |
Definition at line 1032 of file repomanager.cc.
|
inline |
Definition at line 440 of file repomanager.h.
expected< void > zyppng::RepoManager< ZyppContextRefType >::refreshServices | ( | const RefreshServiceOptions & | options_r | ) |
Definition at line 1041 of file repomanager.cc.
expected< void > zyppng::RepoManager< ZyppContextRefType >::modifyService | ( | const std::string & | oldAlias, |
const ServiceInfo & | newService ) |
Definition at line 1125 of file repomanager.cc.
|
static |
Definition at line 1265 of file repomanager.cc.
|
inline |
Definition at line 449 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 1307 of file repomanager.cc.
|
inline |
Definition at line 471 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 1251 of file repomanager.cc.
|
inline |
Definition at line 481 of file repomanager.h.
|
inline |
Definition at line 484 of file repomanager.h.
|
protected |
Definition at line 1208 of file repomanager.cc.
|
protected |
Definition at line 1313 of file repomanager.cc.
|
protected |
Definition at line 1319 of file repomanager.cc.
|
protected |
Definition at line 1393 of file repomanager.cc.
|
inline |
Definition at line 497 of file repomanager.h.
|
inline |
Definition at line 498 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.