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