12#ifndef ZYPP_REPOMANAGER_H
13#define ZYPP_REPOMANAGER_H
32#include <zypp-core/ui/ProgressData>
59 friend std::ostream &
operator<<( std::ostream &
str,
const RepoManager & obj );
84 RefreshIfNeededIgnoreDelay
96 RefreshService_restoreStatus = (1<<0),
97 RefreshService_forceRefresh = (1<<1),
112 bool repoEmpty()
const;
120 {
return std::list<RepoInfo>(repoBegin(),repoEnd()); }
123 RepoInfo getRepo(
const std::string & alias )
const;
126 {
return getRepo(
info_r.alias() ); }
129 bool hasRepo(
const std::string & alias )
const;
132 {
return hasRepo(
info_r.alias() ); }
137 static std::string makeStupidAlias(
const Url &
url_r =
Url() );
252 void refreshMetadata(
const RepoInfo &info,
264 void cleanMetadata(
const RepoInfo &info,
275 void cleanPackages(
const RepoInfo &info,
301 void buildCache(
const RepoInfo &info,
317 void cleanCache(
const RepoInfo &info,
325 bool isCached(
const RepoInfo &info )
const;
337 void loadFromCache(
const RepoInfo &info,
377 void addRepository(
const RepoInfo &info,
392 void addRepositories(
const Url &url,
399 void removeRepository(
const RepoInfo & info,
411 void modifyRepository(
const std::string &alias,
432 RepoInfo getRepositoryInfo(
const std::string &alias,
471 bool serviceEmpty()
const;
478 ServiceSizeType serviceSize()
const;
485 ServiceConstIterator serviceBegin()
const;
491 ServiceConstIterator serviceEnd()
const;
498 {
return std::list<ServiceInfo>(serviceBegin(),serviceEnd()); }
506 ServiceInfo getService(
const std::string & alias )
const;
509 bool hasService(
const std::string & alias )
const;
525 void addService(
const std::string & alias,
const Url& url );
544 void removeService(
const std::string & alias );
584 void modifyService(
const std::string & oldAlias,
const ServiceInfo & service );
587 { modifyService( service.
alias(), service ); }
604 {
return info.
service() == alias; }
643 template<
typename OutputIterator>
649 std::copy( boost::make_filter_iterator( filter, repoBegin(), repoEnd() ),
650 boost::make_filter_iterator( filter, repoEnd(), repoEnd() ),
RepoManager implementation.
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
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)
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Functor thats filter RepoInfo by service which it belongs to.
MatchServiceAlias(std::string alias_)
bool operator()(const RepoInfo &info) const
creates and provides information about known sources.
RefreshCheckStatus
Possibly return state of checkIfRefreshMEtadata function.
@ REFRESH_NEEDED
refresh is needed
@ REPO_UP_TO_DATE
repository not changed
RepoInfo getRepo(const RepoInfo &info_r) const
ServiceSet::const_iterator ServiceConstIterator
bool hasRepo(const RepoInfo &info_r) const
repo::ServiceType probeService(const Url &url) const
Probe the type or the service.
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
std::list< ServiceInfo > knownServices() const
List of known services.
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.
ServiceSet::size_type ServiceSizeType
void refreshService(const std::string &alias, const RefreshServiceOptions &options_r=RefreshServiceOptions())
Refresh specific service.
ServiceConstIterator serviceEnd() const
Iterator to place behind last service in internal storage.
RefreshServiceBit
Flags for tuning RefreshService.
ServiceConstIterator serviceBegin() const
Iterator to first service in internal storage.
void modifyService(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
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 refreshService(const ServiceInfo &service, const RefreshServiceOptions &options_r=RefreshServiceOptions())
void getRepositoriesInService(const std::string &alias, OutputIterator out) const
fill to output iterator repositories in service name.
RepoConstIterator repoEnd() const
RepoSet::const_iterator RepoConstIterator
repo::RepoType probe(const Url &url, const Pathname &path) const
Probe repo metadata type.
std::set< ServiceInfo > ServiceSet
ServiceInfo typedefs.
Repository type enumeration.
Service type enumeration.
Url::asString() view options.
#define ZYPP_DECLARE_OPERATORS_FOR_FLAGS(Name)