Go to the documentation of this file.
12 #ifndef ZYPP_REPOMANAGER_H
13 #define ZYPP_REPOMANAGER_H
177 bool hasRepo(
const std::string & alias )
const;
557 bool hasService(
const std::string & alias )
const;
685 template<
typename OutputIterator>
687 OutputIterator out )
const
717 #endif // ZYPP2_REPOMANAGER_H
Service type enumeration.
bool hasRepo(const RepoInfo &info_r) const
Track changing files or directories.
void buildCache(const RepoInfo &info, CacheBuildPolicy policy=BuildIfNeeded, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Refresh local cache.
Iterable< ServiceConstIterator > services() const
Iterate the known services.
Iterable< RepoConstIterator > repos() const
Iterate the known repositories.
void cleanPackages(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Clean local package cache.
ZYPP_DECLARE_FLAGS(RefreshServiceFlags, RefreshServiceBit)
@ RefreshService_forceRefresh
Force refresh even if TTL is not reached.
std::list< RepoInfo > readRepoFile(const Url &repo_file)
Parses repo_file and returns a list of RepoInfo objects corresponding to repositories found within th...
void refreshMetadata(const RepoInfo &info, RawMetadataRefreshPolicy policy=RefreshIfNeeded, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Refresh local raw cache.
void modifyService(const ServiceInfo &service)
Pathname rootDir
remembers root_r value for later use
Pathname packagesPath(const RepoInfo &info) const
Path where the rpm packages are downloaded and kept.
Pathname knownServicesPath
ServiceSet::const_iterator ServiceConstIterator
MatchServiceAlias(const std::string &alias_)
bool isCached(const RepoInfo &info) const
Whether a repository exists in cache.
What is known about a repository.
@ RefreshIfNeededIgnoreDelay
std::list< ServiceInfo > knownServices() const
List of known services.
void removeService(const std::string &alias)
Removes service specified by its name.
void cleanCacheDirGarbage(const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Remove any subdirectories of cache directories which no longer belong to any of known repositories.
RepoSet::const_iterator RepoConstIterator
void removeRepository(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Remove the best matching repository from known repos list.
@ REPO_UP_TO_DATE
repository not changed
Functor thats filter RepoInfo by service which it belongs to.
@ REFRESH_NEEDED
refresh is needed
bool operator()(const RepoInfo &info) const
RepoSet::size_type RepoSizeType
ServiceSet::size_type ServiceSizeType
void loadFromCache(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Load resolvables into the pool.
RepoInfo getRepositoryInfo(const std::string &alias, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Find a matching repository info.
RepoManager(const RepoManagerOptions &options=RepoManagerOptions())
ServiceSizeType serviceSize() const
Gets count of service in RepoManager (in specified location)
ServiceConstIterator serviceBegin() const
Iterator to first 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.
void modifyRepository(const RepoInfo &newinfo, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
RepoInfo getRepo(const std::string &alias) const
Find RepoInfo by alias or return RepoInfo::noRepo.
Pathname repoSolvCachePath
RefreshServiceBit
Flags for tuning RefreshService.
void cleanMetadata(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Clean local metadata.
std::string alias() const
unique identifier for this source.
Repository type enumeration.
RepoManagerOptions(const Pathname &root_r=Pathname())
Default ctor following ZConfig global settings.
ZYPP_DECLARE_OPERATORS_FOR_FLAGS(DiskUsageCounter::MountPoint::HintFlags)
void refreshService(const std::string &alias, const RefreshServiceOptions &options_r=RefreshServiceOptions())
Refresh specific service.
@ RefreshService_restoreStatus
Force restoring repo enabled/disabled status.
void addRepository(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Adds a repository to the list of known repositories.
Pathname metadataPath(const RepoInfo &info) const
Path where the metadata is downloaded and kept.
RepoConstIterator repoBegin() const
static const ViewOption DEFAULTS
Default combination of view options.
RefreshCheckStatus
Possibly return state of checkIfRefreshMEtadata function.
friend std::ostream & operator<<(std::ostream &str, const RepoManager &obj)
@ REPO_CHECK_DELAYED
refresh is delayed due to settings
Easy-to use interface to the ZYPP dependency resolver.
void getRepositoriesInService(const std::string &alias, OutputIterator out) const
fill to output iterator repositories in service name.
repo::RepoType probe(const Url &url, const Pathname &path) const
Probe repo metadata type.
static RepoManagerOptions makeTestSetup(const Pathname &root_r)
Test setup adjusting all paths to be located below one root_r directory.
ServiceConstIterator serviceEnd() const
Iterator to place behind last service in internal storage.
std::string servicesTargetDistro
Target distro ID to be used when refreshing repo index services.
RepoManager implementation.
RepoSizeType repoSize() const
RepoStatus metadataStatus(const RepoInfo &info) const
Status of local metadata.
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
RefreshServiceFlags RefreshServiceOptions
Options tuning RefreshService.
std::set< RepoInfo > RepoSet
RepoInfo typedefs.
repo::ServiceType probeService(const Url &url) const
Probe the type or the service.
RepoStatus cacheStatus(const RepoInfo &info) const
Status of metadata cache.
void cleanCache(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
clean local cache
bool hasService(const std::string &alias) const
Return whether there is a known service for alias.
std::ostream & operator<<(std::ostream &str, const Exception &obj)
Pathname repoRawCachePath
bool serviceEmpty() const
Gets true if no service is in RepoManager (so no one in specified location)
void addRepositories(const Url &url, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Adds repositores from a repo file to the list of known repositories.
std::ostream & copy(std::istream &from_r, std::ostream &to_r)
Copy istream to ostream.
void modifyRepository(const std::string &alias, const RepoInfo &newinfo, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Modify repository attributes.
std::set< ServiceInfo > ServiceSet
ServiceInfo typedefs.
std::string service() const
Gets name of the service to which this repository belongs or empty string if it has been added manual...
ServiceInfo getService(const std::string &alias) const
Finds ServiceInfo by alias or return ServiceInfo::noService.
String related utilities and Regular expression matching.
void addService(const std::string &alias, const Url &url)
Adds new service by it's alias and url.
Url::asString() view options.
std::list< RepoInfo > knownRepositories() const
List of known repositories.
bool hasRepo(const std::string &alias) const
Return whether there is a known repository for alias.
RefreshCheckStatus checkIfToRefreshMetadata(const RepoInfo &info, const Url &url, RawMetadataRefreshPolicy policy=RefreshIfNeeded)
Checks whether to refresh metadata for specified repository and url.
RepoInfo getRepo(const RepoInfo &info_r) const
Pathname repoPackagesCachePath
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
creates and provides information about known sources.
void refreshServices(const RefreshServiceOptions &options_r=RefreshServiceOptions())
Refreshes all enabled services.
void modifyService(const std::string &oldAlias, const ServiceInfo &service)
Modifies service file (rewrites it with new values) and underlying repositories if needed.
RepoConstIterator repoEnd() const