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;
167 {
return std::list<RepoInfo>(repoBegin(),repoEnd()); }
170 RepoInfo getRepo(
const std::string & alias )
const;
173 {
return getRepo( info_r.
alias() ); }
176 bool hasRepo(
const std::string & alias )
const;
179 {
return hasRepo( info_r.
alias() ); }
184 static std::string makeStupidAlias(
const Url & url_r =
Url() );
269 Pathname metadataPath(
const RepoInfo &info )
const;
282 Pathname packagesPath(
const RepoInfo &info )
const;
299 void refreshMetadata(
const RepoInfo &info,
311 void cleanMetadata(
const RepoInfo &info,
322 void cleanPackages(
const RepoInfo &info,
348 void buildCache(
const RepoInfo &info,
364 void cleanCache(
const RepoInfo &info,
372 bool isCached(
const RepoInfo &info )
const;
384 void loadFromCache(
const RepoInfo &info,
424 void addRepository(
const RepoInfo &info,
439 void addRepositories(
const Url &
url,
446 void removeRepository(
const RepoInfo & info,
458 void modifyRepository(
const std::string &alias,
464 { modifyRepository( newinfo.
alias(), newinfo, progressrcv ); }
479 RepoInfo getRepositoryInfo(
const std::string &alias,
518 bool serviceEmpty()
const;
525 ServiceSizeType serviceSize()
const;
532 ServiceConstIterator serviceBegin()
const;
538 ServiceConstIterator serviceEnd()
const;
542 {
return std::list<ServiceInfo>(serviceBegin(),serviceEnd()); }
550 ServiceInfo getService(
const std::string & alias )
const;
553 bool hasService(
const std::string & alias )
const;
569 void addService(
const std::string & alias,
const Url& url );
588 void removeService(
const std::string & alias );
598 void refreshServices(
const RefreshServiceOptions & options_r = RefreshServiceOptions() );
608 void refreshService(
const std::string & alias,
const RefreshServiceOptions & options_r = RefreshServiceOptions() );
610 void refreshService(
const ServiceInfo & service,
const RefreshServiceOptions & options_r = RefreshServiceOptions() );
628 void modifyService(
const std::string & oldAlias,
const ServiceInfo & service );
631 { modifyService( service.
alias(), service ); }
642 {
return info.
service() == alias; }
681 template<
typename OutputIterator>
683 OutputIterator out )
const 687 std::copy( boost::make_filter_iterator( filter, repoBegin(), repoEnd() ),
688 boost::make_filter_iterator( filter, repoEnd(), repoEnd() ),
705 #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.
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.
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.