12#ifndef ZYPP_REPOMANAGER_H
13#define ZYPP_REPOMANAGER_H
33#include <zypp-core/ui/ProgressData>
119 RepoInfo getRepo(
const std::string & alias )
const;
125 bool hasRepo(
const std::string & alias )
const;
133 static std::string makeStupidAlias(
const Url & url_r =
Url() );
439 RepoInfo getRepositoryInfo(
const std::string &alias,
478 bool serviceEmpty()
const;
485 ServiceSizeType serviceSize()
const;
492 ServiceConstIterator serviceBegin()
const;
498 ServiceConstIterator serviceEnd()
const;
513 ServiceInfo getService(
const std::string & alias )
const;
516 bool hasService(
const std::string & alias )
const;
532 void addService(
const std::string & alias,
const Url&
url );
551 void removeService(
const std::string & alias );
561 void refreshServices(
const RefreshServiceOptions & options_r = RefreshServiceOptions() );
571 void refreshService(
const std::string & alias,
const RefreshServiceOptions & options_r = RefreshServiceOptions() );
573 void refreshService(
const ServiceInfo & service,
const RefreshServiceOptions & options_r = RefreshServiceOptions() );
591 void modifyService(
const std::string & oldAlias,
const ServiceInfo & service );
650 template<
typename OutputIterator>
652 OutputIterator out )
const
Iterable< TIterator > makeIterable(TIterator &&begin_r, TIterator &&end_r)
convenient construction.
Manages a data source characterized by an authoritative URL and a list of mirror URLs.
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...
creates and provides information about known sources.
bool hasRepo(const std::string &alias) const
Return whether there is a known repository for alias.
static constexpr RefreshCheckStatus REPO_UP_TO_DATE
repository not changed
void cleanCacheDirGarbage(const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Remove any subdirectories of cache directories which no longer belong to any of known repositories.
void cleanMetadata(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Clean local metadata.
static constexpr RawMetadataRefreshPolicy RefreshIfNeeded
RepoInfo getRepo(const RepoInfo &info_r) const
static constexpr RawMetadataRefreshPolicy RefreshIfNeededIgnoreDelay
ServiceSet::const_iterator ServiceConstIterator
static constexpr RefreshServiceBit RefreshService_restoreStatus
static constexpr CacheBuildPolicy BuildForced
bool isCached(const RepoInfo &info) const
Whether a repository exists in cache.
bool hasRepo(const RepoInfo &info_r) const
RepoInfo getRepo(const std::string &alias) const
Find RepoInfo by alias or return RepoInfo::noRepo.
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
std::list< ServiceInfo > knownServices() const
List of known services.
RepoManagerFlags::RawMetadataRefreshPolicy RawMetadataRefreshPolicy
void cleanCache(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
clean local cache
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.
static constexpr RefreshServiceBit RefreshService_forceRefresh
ServiceSet::size_type ServiceSizeType
RepoManagerFlags::RefreshServiceFlags RefreshServiceFlags
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 addRepositories(const Url &url, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Adds repositores from a repo file to the list of known repositories.
void refreshMetadata(const RepoInfo &info, RawMetadataRefreshPolicy policy=RefreshIfNeeded, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Refresh local raw cache.
static constexpr RefreshCheckStatus REFRESH_NEEDED
refresh is needed
ServiceConstIterator serviceEnd() const
Iterator to place behind last service in internal storage.
RepoManagerFlags::CacheBuildPolicy CacheBuildPolicy
static constexpr RefreshCheckStatus REPO_CHECK_DELAYED
refresh is delayed due to settings
static constexpr RawMetadataRefreshPolicy RefreshForced
ServiceConstIterator serviceBegin() const
Iterator to first service in internal storage.
RepoManagerFlags::RefreshCheckStatus RefreshCheckStatus
void modifyService(const ServiceInfo &service)
RepoSizeType repoSize() const
void modifyRepository(const std::string &alias, const RepoInfo &newinfo, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Modify repository attributes.
Iterable< ServiceConstIterator > services() const
Iterate the known services.
void removeRepository(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Remove the best matching repository from known repos list.
void modifyRepository(const RepoInfo &newinfo, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
static constexpr CacheBuildPolicy BuildIfNeeded
RepoManagerFlags::RefreshServiceBit RefreshServiceBit
Flags for tuning RefreshService.
RefreshCheckStatus checkIfToRefreshMetadata(const RepoInfo &info, const Url &url, RawMetadataRefreshPolicy policy=RefreshIfNeeded)
Checks whether to refresh metadata for specified repository and url.
RepoSet::size_type RepoSizeType
std::list< RepoInfo > knownRepositories() const
List of known repositories.
RepoConstIterator repoBegin() const
std::set< RepoInfo > RepoSet
RepoInfo typedefs.
Iterable< RepoConstIterator > repos() const
Iterate the known repositories.
void buildCache(const RepoInfo &info, CacheBuildPolicy policy=BuildIfNeeded, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Refresh local cache.
RepoManagerFlags::RefreshServiceFlags RefreshServiceOptions
Options tuning RefreshService.
RepoManager(RepoManagerOptions options=RepoManagerOptions())
void getRepositoriesInService(const std::string &alias, OutputIterator out) const
fill to output iterator repositories in service name.
void loadFromCache(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Load resolvables into the pool.
void cleanPackages(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Clean local package cache.
RepoConstIterator repoEnd() const
void modifyService(const std::string &oldAlias, const ServiceInfo &service)
Modifies service file (rewrites it with new values) and underlying repositories if needed.
RepoSet::const_iterator RepoConstIterator
repo::RepoType probe(const Url &url, const Pathname &path) const
Probe repo metadata type.
std::set< ServiceInfo > ServiceSet
ServiceInfo typedefs.
Track changing files or directories.
std::string alias() const
unique identifier for this source.
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
String related utilities and Regular expression matching.
RefreshCheckStatus
Possibly return state of RepoManager::checkIfToRefreshMetadata function.
@ RefreshIfNeededIgnoreDelay
RefreshServiceBit
Flags for tuning RefreshService.
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)
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
RW_pointer supporting 'copy on write' functionality.
RepoManager implementation.
Functor thats filter RepoInfo by service which it belongs to.
MatchServiceAlias(std::string alias_)
bool operator()(const RepoInfo &info) const
Repository type enumeration.
Service type enumeration.
Url::asString() view options.