12 #ifndef ZYPP_REPOMANAGER_H
13 #define ZYPP_REPOMANAGER_H
172 bool hasRepo(
const std::string & alias )
const;
549 bool hasService(
const std::string & alias )
const;
565 void addService(
const std::string & alias,
const Url& url );
677 template<
typename OutputIterator>
679 OutputIterator out )
const
700 #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.
std::string alias() const
unique identifier for this source.
void modifyService(const ServiceInfo &service)
Pathname repoRawCachePath
void refreshServices()
Refreshes all enabled services.
bool serviceEmpty() const
Gets true if no service is in RepoManager (so no one in specified location)
void modifyService(const std::string &oldAlias, const ServiceInfo &service)
Modifies service file (rewrites it with new values) and underlying repositories if needed...
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...
RepoStatus metadataStatus(const RepoInfo &info) const
Status of local metadata.
RefreshCheckStatus
Possibly return state of checkIfRefreshMEtadata function.
Pathname metadataPath(const RepoInfo &info) const
Path where the metadata is downloaded and kept.
RepoSet::size_type RepoSizeType
void loadFromCache(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Load resolvables into the pool.
ServiceConstIterator serviceEnd() const
Iterator to place behind last service in internal storage.
repo::RepoType probe(const Url &url, const Pathname &path) const
Probe repo metadata type.
RepoConstIterator repoBegin() const
void refreshMetadata(const RepoInfo &info, RawMetadataRefreshPolicy policy=RefreshIfNeeded, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Refresh local raw cache.
Pathname packagesPath(const RepoInfo &info) const
Path where the rpm packages are downloaded and kept.
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
RepoSet::const_iterator RepoConstIterator
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
Url::asString() view options.
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
void refreshService(const std::string &alias)
Refresh specific service.
RepoSizeType repoSize() const
RepoManager implementation.
std::set< RepoInfo > RepoSet
RepoInfo typedefs.
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
RepoInfo getRepo(const RepoInfo &info_r) const
std::ostream & operator<<(std::ostream &str, const Exception &obj)
RepoConstIterator repoEnd() const
bool hasRepo(const RepoInfo &info_r) const
MatchServiceAlias(const std::string &alias_)
Service type enumeration.
ServiceSet::const_iterator ServiceConstIterator
repo::ServiceType probeService(const Url &url) const
Probe the type or the service.
std::string service() const
Gets name of the service to which this repository belongs or empty string if it has been added manual...
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
ServiceInfo getService(const std::string &alias) const
Finds ServiceInfo by alias or return ServiceInfo::noService.
std::ostream & copy(std::istream &from_r, std::ostream &to_r)
Copy istream to ostream.
bool hasRepo(const std::string &alias) const
Return whether there is a known repository for alias.
creates and provides information about known sources.
RepoStatus cacheStatus(const RepoInfo &info) const
Status of metadata cache.
bool operator()(const RepoInfo &info) const
std::list< RepoInfo > readRepoFile(const Url &repo_file)
Parses repo_file and returns a list of RepoInfo objects corresponding to repositories found within th...
RepoInfo getRepo(const std::string &alias) const
Find RepoInfo by alias or return RepoInfo::noRepo.
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())
std::list< RepoInfo > knownRepositories() const
List of known repositories.
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.
Functor thats filter RepoInfo by service which it belongs to.
bool isCached(const RepoInfo &info) const
Whether a repository exists in cache.
Pathname repoPackagesCachePath
bool hasService(const std::string &alias) const
Return whether there is a known service for alias.
static const ViewOption DEFAULTS
Default combination of view options.
friend std::ostream & operator<<(std::ostream &str, const RepoManager &obj)
ServiceSizeType serviceSize() const
Gets count of service in RepoManager (in specified location)
Local facts about a repository This class represents the status of a repository on the system...
void cleanPackages(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Clean local package cache.
ServiceConstIterator serviceBegin() const
Iterator to first service in internal storage.
std::list< ServiceInfo > knownServices() const
List of known services.
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.
RW_pointer supporting 'copy on write' functionality.
Repository type enumeration.