libzypp  17.5.0
zypp::RepoManager::Impl Class Reference

RepoManager implementation. More...

Public Member Functions

 Impl (const RepoManagerOptions &opt)
 
 ~Impl ()
 
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
 
Pathname metadataPath (const RepoInfo &info) const
 
Pathname packagesPath (const RepoInfo &info) const
 
RepoStatus metadataStatus (const RepoInfo &info) const
 
RefreshCheckStatus checkIfToRefreshMetadata (const RepoInfo &info, const Url &url, RawMetadataRefreshPolicy policy)
 
void refreshMetadata (const RepoInfo &info, RawMetadataRefreshPolicy policy, OPT_PROGRESS)
 
void cleanMetadata (const RepoInfo &info, OPT_PROGRESS)
 
void cleanPackages (const RepoInfo &info, OPT_PROGRESS)
 
void buildCache (const RepoInfo &info, CacheBuildPolicy policy, OPT_PROGRESS)
 
repo::RepoType probe (const Url &url, const Pathname &path=Pathname()) const
 Probe the metadata type of a repository located at url. More...
 
repo::RepoType probeCache (const Pathname &path_r) const
 Probe Metadata in a local cache directory. More...
 
void cleanCacheDirGarbage (OPT_PROGRESS)
 
void cleanCache (const RepoInfo &info, OPT_PROGRESS)
 
bool isCached (const RepoInfo &info) const
 
RepoStatus cacheStatus (const RepoInfo &info) const
 
void loadFromCache (const RepoInfo &info, OPT_PROGRESS)
 
void addRepository (const RepoInfo &info, OPT_PROGRESS)
 
void addRepositories (const Url &url, OPT_PROGRESS)
 
void removeRepository (const RepoInfo &info, OPT_PROGRESS)
 
void modifyRepository (const std::string &alias, const RepoInfo &newinfo_r, OPT_PROGRESS)
 
RepoInfo getRepositoryInfo (const std::string &alias, OPT_PROGRESS)
 
RepoInfo getRepositoryInfo (const Url &url, const url::ViewOption &urlview, OPT_PROGRESS)
 
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
 
void addService (const ServiceInfo &service)
 
void addService (const std::string &alias, const Url &url)
 
void removeService (const std::string &alias)
 
void removeService (const ServiceInfo &service)
 
void refreshServices (const RefreshServiceOptions &options_r)
 
void refreshService (const std::string &alias, const RefreshServiceOptions &options_r)
 
void refreshService (const ServiceInfo &service, const RefreshServiceOptions &options_r)
 
void modifyService (const std::string &oldAlias, const ServiceInfo &newService)
 
repo::ServiceType probeService (const Url &url) const
 

Private Member Functions

void saveService (ServiceInfo &service) const
 
Pathname generateNonExistingName (const Pathname &dir, const std::string &basefilename) const
 Generate a non existing filename in a directory, using a base name. More...
 
std::string generateFilename (const RepoInfo &info) const
 
std::string generateFilename (const ServiceInfo &info) const
 
void setCacheStatus (const RepoInfo &info, const RepoStatus &status)
 
void touchIndexFile (const RepoInfo &info)
 
template<typename OutputIterator >
void getRepositoriesInService (const std::string &alias, OutputIterator out) const
 
void init_knownServices ()
 
void init_knownRepositories ()
 
const RepoSetrepos () const
 
RepoSetreposManip ()
 
Implclone () const
 clone for RWCOW_pointer More...
 

Private Attributes

RepoManagerOptions _options
 
RepoSet _reposX
 
ServiceSet _services
 
DefaultIntegral< bool, false > _reposDirty
 

Friends

ImplrwcowClone (const Impl *rhs)
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const RepoManager::Impl &obj)
 

Detailed Description

RepoManager implementation.

Definition at line 520 of file RepoManager.cc.

Constructor & Destructor Documentation

◆ Impl()

zypp::RepoManager::Impl::Impl ( const RepoManagerOptions opt)
inline

Definition at line 523 of file RepoManager.cc.

◆ ~Impl()

zypp::RepoManager::Impl::~Impl ( )
inline

Definition at line 530 of file RepoManager.cc.

Member Function Documentation

◆ repoEmpty()

bool zypp::RepoManager::Impl::repoEmpty ( ) const
inline

Definition at line 575 of file RepoManager.cc.

◆ repoSize()

RepoSizeType zypp::RepoManager::Impl::repoSize ( ) const
inline

Definition at line 576 of file RepoManager.cc.

◆ repoBegin()

RepoConstIterator zypp::RepoManager::Impl::repoBegin ( ) const
inline

Definition at line 577 of file RepoManager.cc.

◆ repoEnd()

RepoConstIterator zypp::RepoManager::Impl::repoEnd ( ) const
inline

Definition at line 578 of file RepoManager.cc.

◆ hasRepo()

bool zypp::RepoManager::Impl::hasRepo ( const std::string &  alias) const
inline

Definition at line 580 of file RepoManager.cc.

◆ getRepo()

RepoInfo zypp::RepoManager::Impl::getRepo ( const std::string &  alias) const
inline

Definition at line 583 of file RepoManager.cc.

◆ metadataPath()

Pathname zypp::RepoManager::Impl::metadataPath ( const RepoInfo info) const
inline

Definition at line 590 of file RepoManager.cc.

◆ packagesPath()

Pathname zypp::RepoManager::Impl::packagesPath ( const RepoInfo info) const
inline

Definition at line 593 of file RepoManager.cc.

◆ metadataStatus()

RepoStatus zypp::RepoManager::Impl::metadataStatus ( const RepoInfo info) const

Definition at line 894 of file RepoManager.cc.

◆ checkIfToRefreshMetadata()

RepoManager::RefreshCheckStatus zypp::RepoManager::Impl::checkIfToRefreshMetadata ( const RepoInfo info,
const Url url,
RawMetadataRefreshPolicy  policy 
)

Definition at line 966 of file RepoManager.cc.

◆ refreshMetadata()

void zypp::RepoManager::Impl::refreshMetadata ( const RepoInfo info,
RawMetadataRefreshPolicy  policy,
OPT_PROGRESS   
)

Given a downloader, sets the other repos raw metadata path as cache paths for the fetcher, so if another repo has the same file, it will not download it but copy it from the other repository

Definition at line 1086 of file RepoManager.cc.

◆ cleanMetadata()

void zypp::RepoManager::Impl::cleanMetadata ( const RepoInfo info,
OPT_PROGRESS   
)

Definition at line 1224 of file RepoManager.cc.

◆ cleanPackages()

void zypp::RepoManager::Impl::cleanPackages ( const RepoInfo info,
OPT_PROGRESS   
)

Definition at line 1234 of file RepoManager.cc.

◆ buildCache()

void zypp::RepoManager::Impl::buildCache ( const RepoInfo info,
CacheBuildPolicy  policy,
OPT_PROGRESS   
)

Definition at line 1244 of file RepoManager.cc.

◆ probe()

repo::RepoType zypp::RepoManager::Impl::probe ( const Url url,
const Pathname path = Pathname() 
) const

Probe the metadata type of a repository located at url.

Urls here may be rewritten by MediaSetAccess to reflect the correct media number.

Note
Metadata in local cache directories must be probed using probeCache as a cache path must not be rewritten (bnc#946129)

Definition at line 1407 of file RepoManager.cc.

◆ probeCache()

repo::RepoType zypp::RepoManager::Impl::probeCache ( const Pathname path_r) const

Probe Metadata in a local cache directory.

Note
Metadata in local cache directories must not be probed using probe as a cache path must not be rewritten (bnc#946129)

Definition at line 1496 of file RepoManager.cc.

◆ cleanCacheDirGarbage()

void zypp::RepoManager::Impl::cleanCacheDirGarbage ( OPT_PROGRESS  )

Definition at line 1515 of file RepoManager.cc.

◆ cleanCache()

void zypp::RepoManager::Impl::cleanCache ( const RepoInfo info,
OPT_PROGRESS   
)

Definition at line 1562 of file RepoManager.cc.

◆ isCached()

bool zypp::RepoManager::Impl::isCached ( const RepoInfo info) const
inline

Definition at line 615 of file RepoManager.cc.

◆ cacheStatus()

RepoStatus zypp::RepoManager::Impl::cacheStatus ( const RepoInfo info) const
inline

Definition at line 618 of file RepoManager.cc.

◆ loadFromCache()

void zypp::RepoManager::Impl::loadFromCache ( const RepoInfo info,
OPT_PROGRESS   
)

Definition at line 1576 of file RepoManager.cc.

◆ addRepository()

void zypp::RepoManager::Impl::addRepository ( const RepoInfo info,
OPT_PROGRESS   
)

Definition at line 1610 of file RepoManager.cc.

◆ addRepositories()

void zypp::RepoManager::Impl::addRepositories ( const Url url,
OPT_PROGRESS   
)

Definition at line 1682 of file RepoManager.cc.

◆ removeRepository()

void zypp::RepoManager::Impl::removeRepository ( const RepoInfo info,
OPT_PROGRESS   
)

Definition at line 1741 of file RepoManager.cc.

◆ modifyRepository()

void zypp::RepoManager::Impl::modifyRepository ( const std::string &  alias,
const RepoInfo newinfo_r,
OPT_PROGRESS   
)

Definition at line 1830 of file RepoManager.cc.

◆ getRepositoryInfo() [1/2]

RepoInfo zypp::RepoManager::Impl::getRepositoryInfo ( const std::string &  alias,
OPT_PROGRESS   
)

◆ getRepositoryInfo() [2/2]

RepoInfo zypp::RepoManager::Impl::getRepositoryInfo ( const Url url,
const url::ViewOption urlview,
OPT_PROGRESS   
)

◆ serviceEmpty()

bool zypp::RepoManager::Impl::serviceEmpty ( ) const
inline

Definition at line 635 of file RepoManager.cc.

◆ serviceSize()

ServiceSizeType zypp::RepoManager::Impl::serviceSize ( ) const
inline

Definition at line 636 of file RepoManager.cc.

◆ serviceBegin()

ServiceConstIterator zypp::RepoManager::Impl::serviceBegin ( ) const
inline

Definition at line 637 of file RepoManager.cc.

◆ serviceEnd()

ServiceConstIterator zypp::RepoManager::Impl::serviceEnd ( ) const
inline

Definition at line 638 of file RepoManager.cc.

◆ hasService()

bool zypp::RepoManager::Impl::hasService ( const std::string &  alias) const
inline

Definition at line 640 of file RepoManager.cc.

◆ getService()

ServiceInfo zypp::RepoManager::Impl::getService ( const std::string &  alias) const
inline

Definition at line 643 of file RepoManager.cc.

◆ addService() [1/2]

void zypp::RepoManager::Impl::addService ( const ServiceInfo service)

Definition at line 1938 of file RepoManager.cc.

◆ addService() [2/2]

void zypp::RepoManager::Impl::addService ( const std::string &  alias,
const Url url 
)
inline

Definition at line 651 of file RepoManager.cc.

◆ removeService() [1/2]

void zypp::RepoManager::Impl::removeService ( const std::string &  alias)

Definition at line 1960 of file RepoManager.cc.

◆ removeService() [2/2]

void zypp::RepoManager::Impl::removeService ( const ServiceInfo service)
inline

Definition at line 655 of file RepoManager.cc.

◆ refreshServices()

void zypp::RepoManager::Impl::refreshServices ( const RefreshServiceOptions options_r)

Definition at line 2016 of file RepoManager.cc.

◆ refreshService() [1/2]

void zypp::RepoManager::Impl::refreshService ( const std::string &  alias,
const RefreshServiceOptions options_r 
)
Todo:
add callbacks for apps (start, end, repo removed, repo added, repo changed)?

Definition at line 2034 of file RepoManager.cc.

◆ refreshService() [2/2]

void zypp::RepoManager::Impl::refreshService ( const ServiceInfo service,
const RefreshServiceOptions options_r 
)
inline

Definition at line 661 of file RepoManager.cc.

◆ modifyService()

void zypp::RepoManager::Impl::modifyService ( const std::string &  oldAlias,
const ServiceInfo newService 
)
Todo:
refresh the service automatically if url is changed?

Definition at line 2401 of file RepoManager.cc.

◆ probeService()

repo::ServiceType zypp::RepoManager::Impl::probeService ( const Url url) const

Definition at line 2476 of file RepoManager.cc.

◆ saveService()

void zypp::RepoManager::Impl::saveService ( ServiceInfo service) const
private

Definition at line 725 of file RepoManager.cc.

◆ generateNonExistingName()

Pathname zypp::RepoManager::Impl::generateNonExistingName ( const Pathname dir,
const std::string &  basefilename 
) const
private

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"

Parameters
dirDirectory where the file needs to be unique
basefilenamestring to base the filename on.

Definition at line 759 of file RepoManager.cc.

◆ generateFilename() [1/2]

std::string zypp::RepoManager::Impl::generateFilename ( const RepoInfo info) const
inlineprivate

Definition at line 673 of file RepoManager.cc.

◆ generateFilename() [2/2]

std::string zypp::RepoManager::Impl::generateFilename ( const ServiceInfo info) const
inlineprivate

Definition at line 676 of file RepoManager.cc.

◆ setCacheStatus()

void zypp::RepoManager::Impl::setCacheStatus ( const RepoInfo info,
const RepoStatus status 
)
inlineprivate

Definition at line 679 of file RepoManager.cc.

◆ touchIndexFile()

void zypp::RepoManager::Impl::touchIndexFile ( const RepoInfo info)
private

Definition at line 929 of file RepoManager.cc.

◆ getRepositoriesInService()

template<typename OutputIterator >
void zypp::RepoManager::Impl::getRepositoriesInService ( const std::string &  alias,
OutputIterator  out 
) const
inlineprivate

Definition at line 689 of file RepoManager.cc.

◆ init_knownServices()

void zypp::RepoManager::Impl::init_knownServices ( )
private

Definition at line 774 of file RepoManager.cc.

◆ init_knownRepositories()

void zypp::RepoManager::Impl::init_knownRepositories ( )
private

Definition at line 827 of file RepoManager.cc.

◆ repos()

const RepoSet& zypp::RepoManager::Impl::repos ( ) const
inlineprivate

Definition at line 701 of file RepoManager.cc.

◆ reposManip()

RepoSet& zypp::RepoManager::Impl::reposManip ( )
inlineprivate

Definition at line 702 of file RepoManager.cc.

◆ clone()

Impl* zypp::RepoManager::Impl::clone ( ) const
inlineprivate

clone for RWCOW_pointer

Definition at line 714 of file RepoManager.cc.

Friends And Related Function Documentation

◆ rwcowClone

Impl* rwcowClone ( const Impl rhs)
friend

◆ operator<<()

std::ostream & operator<< ( std::ostream &  str,
const RepoManager::Impl obj 
)
related

Stream output

Definition at line 720 of file RepoManager.cc.

Member Data Documentation

◆ _options

RepoManagerOptions zypp::RepoManager::Impl::_options
private

Definition at line 705 of file RepoManager.cc.

◆ _reposX

RepoSet zypp::RepoManager::Impl::_reposX
private

Definition at line 706 of file RepoManager.cc.

◆ _services

ServiceSet zypp::RepoManager::Impl::_services
private

Definition at line 707 of file RepoManager.cc.

◆ _reposDirty

DefaultIntegral<bool,false> zypp::RepoManager::Impl::_reposDirty
private

Definition at line 709 of file RepoManager.cc.


The documentation for this class was generated from the following file: