12 #ifndef ZYPP_REPOMANAGER_H 13 #define ZYPP_REPOMANAGER_H 132 RefreshIfNeededIgnoreDelay
144 RefreshService_restoreStatus = (1<<0),
145 RefreshService_forceRefresh = (1<<1),
160 bool repoEmpty()
const;
161 RepoSizeType repoSize()
const;
162 RepoConstIterator repoBegin()
const;
163 RepoConstIterator repoEnd()
const;
168 {
return std::list<RepoInfo>(repoBegin(),repoEnd()); }
171 RepoInfo getRepo(
const std::string & alias )
const;
174 {
return getRepo( info_r.
alias() ); }
177 bool hasRepo(
const std::string & alias )
const;
180 {
return hasRepo( info_r.
alias() ); }
185 static std::string makeStupidAlias(
const Url & url_r =
Url() );
270 Pathname metadataPath(
const RepoInfo &info )
const;
283 Pathname packagesPath(
const RepoInfo &info )
const;
300 void refreshMetadata(
const RepoInfo &info,
312 void cleanMetadata(
const RepoInfo &info,
323 void cleanPackages(
const RepoInfo &info,
349 void buildCache(
const RepoInfo &info,
365 void cleanCache(
const RepoInfo &info,
373 bool isCached(
const RepoInfo &info )
const;
385 void loadFromCache(
const RepoInfo &info,
425 void addRepository(
const RepoInfo &info,
440 void addRepositories(
const Url &
url,
447 void removeRepository(
const RepoInfo & info,
459 void modifyRepository(
const std::string &alias,
465 { modifyRepository( newinfo.
alias(), newinfo, progressrcv ); }
480 RepoInfo getRepositoryInfo(
const std::string &alias,
519 bool serviceEmpty()
const;
526 ServiceSizeType serviceSize()
const;
533 ServiceConstIterator serviceBegin()
const;
539 ServiceConstIterator serviceEnd()
const;
546 {
return std::list<ServiceInfo>(serviceBegin(),serviceEnd()); }
554 ServiceInfo getService(
const std::string & alias )
const;
557 bool hasService(
const std::string & alias )
const;
573 void addService(
const std::string & alias,
const Url& url );
592 void removeService(
const std::string & alias );
602 void refreshServices(
const RefreshServiceOptions & options_r = RefreshServiceOptions() );
612 void refreshService(
const std::string & alias,
const RefreshServiceOptions & options_r = RefreshServiceOptions() );
614 void refreshService(
const ServiceInfo & service,
const RefreshServiceOptions & options_r = RefreshServiceOptions() );
632 void modifyService(
const std::string & oldAlias,
const ServiceInfo & service );
635 { modifyService( service.
alias(), service ); }
646 {
return info.
service() == alias; }
685 template<
typename OutputIterator>
687 OutputIterator out )
const 691 std::copy( boost::make_filter_iterator( filter, repoBegin(), repoEnd() ),
692 boost::make_filter_iterator( filter, repoEnd(), repoEnd() ),
708 {
return makeIterable( repoBegin(), repoEnd() ); }
712 {
return makeIterable( serviceBegin(), serviceEnd() ); }
717 #endif // ZYPP2_REPOMANAGER_H
ZYPP_DECLARE_FLAGS(VendorSupportOptions, VendorSupportOption)
RepoManagerOptions(const Pathname &root_r=Pathname())
Default ctor following ZConfig global settings.
std::string alias() const
unique identifier for this source.
Iterable< ServiceConstIterator > services() const
Iterate the known services.
void modifyService(const ServiceInfo &service)
Pathname repoRawCachePath
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
RefreshCheckStatus
Possibly return state of checkIfRefreshMEtadata function.
RepoSet::size_type RepoSizeType
ZYPP_DECLARE_OPERATORS_FOR_FLAGS(DiskUsageCounter::MountPoint::HintFlags)
String related utilities and Regular expression matching.
Iterable< RepoConstIterator > repos() const
Iterate the known repositories.
RefreshServiceFlags RefreshServiceOptions
Options tuning RefreshService.
What is known about a repository.
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.
Pathname repoSolvCachePath
RefreshServiceBit
Flags for tuning RefreshService.
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)
bool hasRepo(const RepoInfo &info_r) const
MatchServiceAlias(const std::string &alias_)
Service type enumeration.
ServiceSet::const_iterator ServiceConstIterator
std::string service() const
Gets name of the service to which this repository belongs or empty string if it has been added manual...
ServiceSet::size_type ServiceSizeType
std::ostream & copy(std::istream &from_r, std::ostream &to_r)
Copy istream to ostream.
creates and provides information about known sources.
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...
void modifyRepository(const RepoInfo &newinfo, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
std::list< RepoInfo > knownRepositories() const
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.
Pathname repoPackagesCachePath
static const ViewOption DEFAULTS
Default combination of view options.
Track changing files or directories.
Easy-to use interface to the ZYPP dependency resolver.
std::list< ServiceInfo > knownServices() const
List of known services.
Repository type enumeration.