12#ifndef ZYPP_REPOMANAGER_H
13#define ZYPP_REPOMANAGER_H
18#include <zypp/base/PtrTypes.h>
19#include <zypp/base/Iterator.h>
20#include <zypp/base/Flags.h>
22#include <zypp/Pathname.h>
30#include <zypp-core/ui/ProgressData>
177 bool hasRepo(
const std::string & alias )
const;
691 template<
typename OutputIterator>
693 OutputIterator out )
const
RepoManager implementation.
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
What is known about a repository.
std::string service() const
Gets name of the service to which this repository belongs or empty string if it has been added manual...
Track changing files or directories.
std::string alias() const
unique identifier for this source.
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
std::list< RepoInfo > readRepoFile(const Url &repo_file)
Parses repo_file and returns a list of RepoInfo objects corresponding to repositories found within th...
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
RW_pointer supporting 'copy on write' functionality.
std::string servicesTargetDistro
Target distro ID to be used when refreshing repo index services.
static RepoManagerOptions makeTestSetup(const Pathname &root_r)
Test setup adjusting all paths to be located below one root_r directory.
Pathname repoSolvCachePath
Pathname rootDir
remembers root_r value for later use
Pathname knownServicesPath
Pathname repoRawCachePath
Pathname repoPackagesCachePath
Functor thats filter RepoInfo by service which it belongs to.
MatchServiceAlias(const std::string &alias_)
bool operator()(const RepoInfo &info) const
creates and provides information about known sources.
bool hasRepo(const std::string &alias) const
Return whether there is a known repository for alias.
ServiceSet::const_iterator ServiceConstIterator
friend std::ostream & operator<<(std::ostream &str, const RepoManager &obj)
bool serviceEmpty() const
Gets true if no service is in RepoManager (so no one in specified location)
bool hasService(const std::string &alias) const
Return whether there is a known service for alias.
RefreshCheckStatus
Possibly return state of checkIfRefreshMEtadata function.
@ REFRESH_NEEDED
refresh is needed
@ REPO_UP_TO_DATE
repository not changed
@ REPO_CHECK_DELAYED
refresh is delayed due to settings
RepoInfo getRepo(const RepoInfo &info_r) const
void addRepository(const RepoInfo &info, OPT_PROGRESS)
RepoSet::const_iterator RepoConstIterator
void addService(const std::string &alias, const Url &url)
Adds a new service by its alias and URL.
bool isCached(const RepoInfo &info) const
Whether a repository exists in cache.
void cleanPackages(const RepoInfo &info, OPT_PROGRESS, bool isAutoClean=false)
void modifyRepository(const std::string &alias, const RepoInfo &newinfo_r, OPT_PROGRESS)
ServiceSizeType serviceSize() const
Gets count of service in RepoManager (in specified location)
void loadFromCache(const RepoInfo &info, OPT_PROGRESS)
void refreshMetadata(const RepoInfo &info, RawMetadataRefreshPolicy policy, OPT_PROGRESS)
void removeService(const std::string &alias)
Removes service specified by its name.
bool hasRepo(const RepoInfo &info_r) const
@ RefreshIfNeededIgnoreDelay
void buildCache(const RepoInfo &info, CacheBuildPolicy policy, OPT_PROGRESS)
RepoInfo getRepo(const std::string &alias) const
Find RepoInfo by alias or return RepoInfo::noRepo.
repo::ServiceType probeService(const Url &url) const
Probe the type or the service.
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
RepoInfo getRepositoryInfo(const std::string &alias, OPT_PROGRESS)
std::list< ServiceInfo > knownServices() const
List of known services.
void cleanCacheDirGarbage(OPT_PROGRESS)
void addService(const ServiceInfo &service)
Adds new service.
RefreshCheckStatus checkIfToRefreshMetadata(const RepoInfo &info, const Url &url, RawMetadataRefreshPolicy policy=RefreshIfNeeded)
Checks whether to refresh metadata for specified repository and url.
void refreshServices(const RefreshServiceOptions &options_r=RefreshServiceOptions())
Refreshes all enabled services.
Pathname metadataPath(const RepoInfo &info) const
Path where the metadata is downloaded and kept.
ServiceSet::size_type ServiceSizeType
std::set< RepoInfo > RepoSet
RepoInfo typedefs.
Pathname packagesPath(const RepoInfo &info) const
Path where the rpm packages are downloaded and kept.
RepoStatus cacheStatus(const RepoInfo &info) const
Status of metadata cache.
void refreshGeoIp(const RepoInfo::url_set &urls)
void refreshService(const std::string &alias, const RefreshServiceOptions &options_r=RefreshServiceOptions())
Refresh specific service.
void modifyService(const std::string &oldAlias, const ServiceInfo &newService)
ServiceConstIterator serviceEnd() const
RepoConstIterator repoEnd() const
RefreshServiceBit
Flags for tuning RefreshService.
@ RefreshService_forceRefresh
Force refresh even if TTL is not reached.
@ RefreshService_restoreStatus
Force restoring repo enabled/disabled status.
ServiceConstIterator serviceBegin() const
void cleanCache(const RepoInfo &info, OPT_PROGRESS)
repo::RepoType probe(const Url &url, const Pathname &path=Pathname()) const
void removeRepository(const RepoInfo &info, OPT_PROGRESS)
void modifyService(const ServiceInfo &service)
void removeService(const ServiceInfo &service)
Iterable< ServiceConstIterator > services() const
Iterate the known services.
void modifyRepository(const RepoInfo &newinfo, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
ZYPP_DECLARE_FLAGS(RefreshServiceFlags, RefreshServiceBit)
RepoSet::size_type RepoSizeType
void addRepositories(const Url &url, OPT_PROGRESS)
void cleanMetadata(const RepoInfo &info, OPT_PROGRESS)
ServiceInfo getService(const std::string &alias) const
Finds ServiceInfo by alias or return ServiceInfo::noService.
std::list< RepoInfo > knownRepositories() const
List of known repositories.
RepoConstIterator repoBegin() const
const RepoSet & repos() const
Iterate the known repositories.
Iterable< RepoConstIterator > repos() const
void refreshService(const ServiceInfo &service, const RefreshServiceOptions &options_r=RefreshServiceOptions())
RepoSizeType repoSize() const
RefreshServiceFlags RefreshServiceOptions
Options tuning RefreshService.
void getRepositoriesInService(const std::string &alias, OutputIterator out) const
fill to output iterator repositories in service name.
RepoConstIterator repoBegin() const
std::set< ServiceInfo > ServiceSet
ServiceInfo typedefs.
ServiceConstIterator serviceBegin() const
Iterator to first service in internal storage.
RepoConstIterator repoEnd() const
RepoStatus metadataStatus(const RepoInfo &info) const
Status of local metadata.
void modifyService(const std::string &oldAlias, const ServiceInfo &service)
Modifies service file (rewrites it with new values) and underlying repositories if needed.
ServiceConstIterator serviceEnd() const
Iterator to place behind last service in internal storage.
static std::string makeStupidAlias(const Url &url_r=Url())
Some stupid string but suitable as alias for your url if nothing better is available.
repo::RepoType probe(const Url &url, const Pathname &path) const
Probe repo metadata type.
Repository type enumeration.
Service type enumeration.
Url::asString() view options.
static const ViewOption DEFAULTS
Default combination of view options.
#define ZYPP_DECLARE_OPERATORS_FOR_FLAGS(Name)