libzypp 17.38.5

RepoManager.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12
13#include "RepoManager.h"
14
15#include <iostream>
16#include <zypp-core/Digest.h>
17#include <zypp-core/ng/pipelines/Lift>
18#include <zypp/ng/progressobserveradaptor.h>
19#include <zypp/ng/context.h>
20#include <zypp/ng/repo/refresh.h>
21#include <zypp/ng/repo/workflows/repomanagerwf.h>
22
23#undef ZYPP_BASE_LOGGER_LOGGROUP
24#define ZYPP_BASE_LOGGER_LOGGROUP "zypp::repomanager"
25
26 using std::endl;
27 using std::string;
28 using namespace zypp::repo;
29
30#define OPT_PROGRESS const ProgressData::ReceiverFnc & = ProgressData::ReceiverFnc()
31
33 namespace zypp
34{
40 struct ZYPP_LOCAL RepoManager::Impl
41 {
42 public:
43 Impl( zyppng::ContextRef &&ctx, RepoManagerOptions &&opt) {
44 _ngMgr = zyppng::RepoManager::create( std::move(ctx), std::move(opt) ).unwrap();
45 }
46
47 Impl(const Impl &) = delete;
48 Impl(Impl &&) = delete;
49 Impl &operator=(const Impl &) = delete;
50 Impl &operator=(Impl &&) = delete;
51
52 public:
53 const zyppng::RepoManager &ngMgr() const {
54 return *_ngMgr;
55 }
56
57 zyppng::RepoManager &ngMgr() {
58 return *_ngMgr;
59 }
60
61 private:
62 zyppng::RepoManagerRef _ngMgr;
63
64 private:
65 friend Impl * rwcowClone<Impl>( const Impl * rhs );
67 Impl * clone() const
68 { return new Impl( zyppng::ContextRef(_ngMgr->zyppContext()), RepoManagerOptions(_ngMgr->options()) ); }
69 };
70
71
73 inline std::ostream & operator<<( std::ostream & str, const RepoManager::Impl & obj )
74 { return str << "RepoManager::Impl"; }
75
77 //
78 // CLASS NAME : RepoManager
79 //
81
82 RepoManager::RepoManager( RepoManagerOptions opt )
83 : _pimpl( new Impl( zyppng::Context::defaultContext(), std::move(opt)) )
84 {}
85
86 RepoManager::~RepoManager()
87 {}
88
89 bool RepoManager::repoEmpty() const
90 { return _pimpl->ngMgr().repoEmpty(); }
91
92 RepoManager::RepoSizeType RepoManager::repoSize() const
93 { return _pimpl->ngMgr().repoSize(); }
94
95 RepoManager::RepoConstIterator RepoManager::repoBegin() const
96 { return _pimpl->ngMgr().repoBegin(); }
97
98 RepoManager::RepoConstIterator RepoManager::repoEnd() const
99 { return _pimpl->ngMgr().repoEnd(); }
100
101 RepoInfo RepoManager::getRepo( const std::string & alias ) const
102 { return _pimpl->ngMgr().getRepo( alias ); }
103
104 bool RepoManager::hasRepo( const std::string & alias ) const
105 { return _pimpl->ngMgr().hasRepo( alias ); }
106
107 std::string RepoManager::makeStupidAlias( const Url & url_r )
108 {
109 std::string ret( url_r.getScheme() );
110 if ( ret.empty() )
111 ret = "repo-";
112 else
113 ret += "-";
114
115 std::string host( url_r.getHost() );
116 if ( ! host.empty() )
117 {
118 ret += host;
119 ret += "-";
120 }
121
122 static Date::ValueType serial = Date::now();
123 ret += Digest::digest( Digest::sha1(), str::hexstring( ++serial ) +url_r.asCompleteString() ).substr(0,8);
124 return ret;
125 }
126
127 RepoStatus RepoManager::metadataStatus( const RepoInfo & info ) const
128 { return _pimpl->ngMgr().metadataStatus( info ).unwrap(); }
129
130 RepoManager::RefreshCheckStatus RepoManager::checkIfToRefreshMetadata(const RepoInfo &info, const zypp::MirroredOrigin &origin, RawMetadataRefreshPolicy policy)
131 { return _pimpl->ngMgr().checkIfToRefreshMetadata( info, origin, policy ).unwrap(); }
132
133 RepoManager::RefreshCheckStatus RepoManager::checkIfToRefreshMetadata( const RepoInfo &info, const Url &url, RawMetadataRefreshPolicy policy )
134 { return _pimpl->ngMgr().checkIfToRefreshMetadata( info, url, policy ).unwrap(); }
135
136 Pathname RepoManager::metadataPath( const RepoInfo &info ) const
137 { return _pimpl->ngMgr().metadataPath( info ).unwrap(); }
138
139 Pathname RepoManager::packagesPath( const RepoInfo &info ) const
140 { return _pimpl->ngMgr().packagesPath( info ).unwrap(); }
141
142 void RepoManager::refreshMetadata( const RepoInfo &info, RawMetadataRefreshPolicy policy, const ProgressData::ReceiverFnc & progressrcv )
143 {
144 // Suppress (interactive) media::MediaChangeReport if we have fallback URLs
145 zypp::media::ScopedDisableMediaChangeReport guard( info.repoOrigins().hasFallbackUrls() );
146 return _pimpl->ngMgr().refreshMetadata( info, policy, nullptr ).unwrap();
147 }
148
149 void RepoManager::cleanMetadata( const RepoInfo &info, const ProgressData::ReceiverFnc & progressrcv )
150 { return _pimpl->ngMgr().cleanMetadata( info, nullptr ).unwrap(); }
151
152 void RepoManager::cleanPackages( const RepoInfo &info, const ProgressData::ReceiverFnc & progressrcv )
153 { return _pimpl->ngMgr().cleanPackages( info, nullptr ).unwrap(); }
154
155 RepoStatus RepoManager::cacheStatus( const RepoInfo &info ) const
156 { return _pimpl->ngMgr().cacheStatus( info ).unwrap(); }
157
158 void RepoManager::buildCache( const RepoInfo &info, CacheBuildPolicy policy, const ProgressData::ReceiverFnc & progressrcv )
159 {
160 callback::SendReport<ProgressReport> report;
161 auto adapt = zyppng::ProgressObserverAdaptor( progressrcv, report );
162 return _pimpl->ngMgr().buildCache( info, policy, adapt.observer() ).unwrap();
163 }
164
165 void RepoManager::cleanCache( const RepoInfo &info, const ProgressData::ReceiverFnc & progressrcv )
166 { return _pimpl->ngMgr().cleanCache( info, nullptr ).unwrap(); }
167
168 bool RepoManager::isCached( const RepoInfo &info ) const
169 { return _pimpl->ngMgr().isCached( info ).unwrap(); }
170
171 void RepoManager::loadFromCache( const RepoInfo &info, const ProgressData::ReceiverFnc & progressrcv )
172 { return _pimpl->ngMgr().loadFromCache( info, nullptr ).unwrap(); }
173
174 void RepoManager::cleanCacheDirGarbage( const ProgressData::ReceiverFnc & progressrcv )
175 { return _pimpl->ngMgr().cleanCacheDirGarbage( nullptr ).unwrap(); }
176
177 repo::RepoType RepoManager::probe( const Url & url, const Pathname & path ) const
178 { return _pimpl->ngMgr().probe( {url}, path ).unwrap(); }
179
180 repo::RepoType RepoManager::probe( const Url & url ) const
181 { return _pimpl->ngMgr().probe( {url} ).unwrap(); }
182
183 void RepoManager::addRepository( const RepoInfo &info, const TriBool & forcedProbe, const ProgressData::ReceiverFnc & progressrcv )
184 {
185 callback::SendReport<ProgressReport> report;
186 auto adapt = zyppng::ProgressObserverAdaptor( progressrcv, report );
187 RepoInfo updatedRepo = _pimpl->ngMgr().addRepository( info, adapt.observer(), forcedProbe ).unwrap();
188
189 // We should fix the API as we must inject those paths
190 // into the repoinfo in order to keep it usable.
191 RepoInfo & oinfo( const_cast<RepoInfo &>(info) );
192 oinfo.setFilepath( updatedRepo.filepath() );
193 oinfo.setMetadataPath( zyppng::rawcache_path_for_repoinfo( _pimpl->ngMgr().options(), updatedRepo ).unwrap() );
194 oinfo.setPackagesPath( zyppng::packagescache_path_for_repoinfo( _pimpl->ngMgr().options(), updatedRepo ).unwrap() );
195 }
196
197 void RepoManager::addRepository( const RepoInfo &info, const ProgressData::ReceiverFnc & progressrcv )
198 { addRepository( info, indeterminate, progressrcv ); }
199
200 void RepoManager::addRepositories( const Url &url, const ProgressData::ReceiverFnc & progressrcv )
201 { return _pimpl->ngMgr().addRepositories( url, nullptr ).unwrap(); }
202
203 void RepoManager::removeRepository( const RepoInfo & info, const ProgressData::ReceiverFnc & progressrcv )
204 {
205 callback::SendReport<ProgressReport> report;
206 auto adapt = zyppng::ProgressObserverAdaptor( progressrcv, report );
207 return _pimpl->ngMgr().removeRepository( info, adapt.observer() ).unwrap();
208 }
209
210 void RepoManager::modifyRepository( const std::string &alias, const RepoInfo & newinfo, const ProgressData::ReceiverFnc & progressrcv )
211 {
212 RepoInfo updated = _pimpl->ngMgr().modifyRepository( alias, newinfo, nullptr ).unwrap();
213 // We should fix the API as we must inject those paths
214 // into the repoinfo in order to keep it usable.
215 RepoInfo & oinfo( const_cast<RepoInfo &>(newinfo) );
216 oinfo.setFilepath( updated.filepath());
217 oinfo.setMetadataPath( zyppng::rawcache_path_for_repoinfo( _pimpl->ngMgr().options(), updated ).unwrap() );
218 oinfo.setPackagesPath( zyppng::packagescache_path_for_repoinfo( _pimpl->ngMgr().options(), updated ).unwrap() );
219 }
220
221 RepoInfo RepoManager::getRepositoryInfo( const std::string &alias, const ProgressData::ReceiverFnc & progressrcv )
222 { return _pimpl->ngMgr().getRepositoryInfo( alias ).unwrap(); }
223
224 RepoInfo RepoManager::getRepositoryInfo( const Url & url, const url::ViewOption & urlview, const ProgressData::ReceiverFnc & progressrcv )
225 { return _pimpl->ngMgr().getRepositoryInfo( url, urlview ).unwrap(); }
226
227 bool RepoManager::serviceEmpty() const
228 { return _pimpl->ngMgr().serviceEmpty(); }
229
230 RepoManager::ServiceSizeType RepoManager::serviceSize() const
231 { return _pimpl->ngMgr().serviceSize(); }
232
233 RepoManager::ServiceConstIterator RepoManager::serviceBegin() const
234 { return _pimpl->ngMgr().serviceBegin(); }
235
236 RepoManager::ServiceConstIterator RepoManager::serviceEnd() const
237 { return _pimpl->ngMgr().serviceEnd(); }
238
239 ServiceInfo RepoManager::getService( const std::string & alias ) const
240 { return _pimpl->ngMgr().getService( alias ); }
241
242 bool RepoManager::hasService( const std::string & alias ) const
243 { return _pimpl->ngMgr().hasService( alias ); }
244
245 repo::ServiceType RepoManager::probeService( const Url &url ) const
246 { return _pimpl->ngMgr().probeService( url ).unwrap(); }
247
248 void RepoManager::addService( const std::string & alias, const Url& url )
249 { return _pimpl->ngMgr().addService( alias, url ).unwrap(); }
250
251 void RepoManager::addService( const ServiceInfo & service )
252 { return _pimpl->ngMgr().addService( service ).unwrap(); }
253
254 void RepoManager::removeService( const std::string & alias )
255 { return _pimpl->ngMgr().removeService( alias ).unwrap(); }
256
257 void RepoManager::removeService( const ServiceInfo & service )
258 { return _pimpl->ngMgr().removeService( service ).unwrap(); }
259
260 void RepoManager::refreshServices( const RefreshServiceOptions & options_r )
261 { return _pimpl->ngMgr().refreshServices( options_r ).unwrap(); }
262
263 void RepoManager::refreshService( const std::string & alias, const RefreshServiceOptions & options_r )
264 { return _pimpl->ngMgr().refreshService( alias, options_r ).unwrap(); }
265
266 void RepoManager::refreshService( const ServiceInfo & service, const RefreshServiceOptions & options_r )
267 { return _pimpl->ngMgr().refreshService( service, options_r ).unwrap(); }
268
269 void RepoManager::modifyService( const std::string & oldAlias, const ServiceInfo & service )
270 { return _pimpl->ngMgr().modifyService( oldAlias, service ).unwrap(); }
271
272 void RepoManager::refreshGeoIp (const RepoInfo::url_set &urls)
273 { (void) _pimpl->ngMgr().refreshGeoIp( urls ); }
274
276
277 std::ostream & operator<<( std::ostream & str, const RepoManager & obj )
278 { return str << *obj._pimpl; }
279
280 std::list<RepoInfo> readRepoFile(const Url &repo_file)
281 {
282 return zyppng::RepoManagerWorkflow::readRepoFile( zyppng::Context::defaultContext (), repo_file ).unwrap();
283 }
284
286} // namespace zypp
ZYPP_LOCAL
#define ZYPP_LOCAL
Definition Globals.h:71
RepoManager.h
zypp::Date::ValueType
time_t ValueType
Definition Date.h:38
zypp::Date::now
static Date now()
Return the current time.
Definition Date.h:78
zypp::Digest::digest
std::string digest()
get hex string representation of the digest
Definition Digest.cc:239
zypp::Digest::sha1
static const std::string & sha1()
sha1
Definition Digest.cc:45
zypp::MirroredOriginSet::hasFallbackUrls
bool hasFallbackUrls() const
Whether this set contains more than one Url in total (authorities or mirrors).
Definition MirroredOrigin.cc:418
zypp::MirroredOrigin
Manages a data source characterized by an authoritative URL and a list of mirror URLs.
Definition MirroredOrigin.h:170
zypp::ProgressData::ReceiverFnc
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
Definition progressdata.h:140
zypp::RepoInfo
What is known about a repository.
Definition RepoInfo.h:72
zypp::RepoInfo::repoOrigins
MirroredOriginSet repoOrigins() const
The repodata origins.
Definition RepoInfo.cc:733
zypp::RepoInfo::setPackagesPath
void setPackagesPath(const Pathname &path)
set the path where the local packages are stored
Definition RepoInfo.cc:756
zypp::RepoInfo::setMetadataPath
void setMetadataPath(const Pathname &path)
Set the path where the local metadata is stored.
Definition RepoInfo.cc:753
zypp::RepoInfo::url_set
std::list< Url > url_set
Definition RepoInfo.h:108
zypp::RepoManager::hasRepo
bool hasRepo(const std::string &alias) const
Return whether there is a known repository for alias.
Definition RepoManager.cc:104
zypp::RepoManager::cleanCacheDirGarbage
void cleanCacheDirGarbage(const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Remove any subdirectories of cache directories which no longer belong to any of known repositories.
Definition RepoManager.cc:174
zypp::RepoManager::operator<<
friend std::ostream & operator<<(std::ostream &str, const RepoManager &obj)
Definition RepoManager.cc:277
zypp::RepoManager::cleanMetadata
void cleanMetadata(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Clean local metadata.
Definition RepoManager.cc:149
zypp::RepoManager::~RepoManager
~RepoManager()
Dtor.
Definition RepoManager.cc:86
zypp::RepoManager::serviceEmpty
bool serviceEmpty() const
Gets true if no service is in RepoManager (so no one in specified location).
Definition RepoManager.cc:227
zypp::RepoManager::hasService
bool hasService(const std::string &alias) const
Return whether there is a known service for alias.
Definition RepoManager.cc:242
zypp::RepoManager::ServiceConstIterator
ServiceSet::const_iterator ServiceConstIterator
Definition RepoManager.h:69
zypp::RepoManager::addService
void addService(const std::string &alias, const Url &url)
Adds a new service by its alias and URL.
Definition RepoManager.cc:248
zypp::RepoManager::isCached
bool isCached(const RepoInfo &info) const
Whether a repository exists in cache.
Definition RepoManager.cc:168
zypp::RepoManager::removeService
void removeService(const std::string &alias)
Removes service specified by its name.
Definition RepoManager.cc:254
zypp::RepoManager::getRepo
RepoInfo getRepo(const std::string &alias) const
Find RepoInfo by alias or return RepoInfo::noRepo.
Definition RepoManager.cc:101
zypp::RepoManager::probeService
repo::ServiceType probeService(const Url &url) const
Probe the type or the service.
Definition RepoManager.cc:245
zypp::RepoManager::_pimpl
RWCOW_pointer< Impl > _pimpl
Pointer to implementation.
Definition RepoManager.h:663
zypp::RepoManager::RawMetadataRefreshPolicy
RepoManagerFlags::RawMetadataRefreshPolicy RawMetadataRefreshPolicy
Definition RepoManager.h:82
zypp::RepoManager::cleanCache
void cleanCache(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
clean local cache
Definition RepoManager.cc:165
zypp::RepoManager::refreshServices
void refreshServices(const RefreshServiceOptions &options_r=RefreshServiceOptions())
Refreshes all enabled services.
Definition RepoManager.cc:260
zypp::RepoManager::addRepository
void addRepository(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Adds a repository to the list of known repositories.
Definition RepoManager.cc:197
zypp::RepoManager::repoEmpty
bool repoEmpty() const
Definition RepoManager.cc:89
zypp::RepoManager::metadataPath
Pathname metadataPath(const RepoInfo &info) const
Path where the metadata is downloaded and kept.
Definition RepoManager.cc:136
zypp::RepoManager::ServiceSizeType
ServiceSet::size_type ServiceSizeType
Definition RepoManager.h:70
zypp::RepoManager::packagesPath
Pathname packagesPath(const RepoInfo &info) const
Path where the rpm packages are downloaded and kept.
Definition RepoManager.cc:139
zypp::RepoManager::cacheStatus
RepoStatus cacheStatus(const RepoInfo &info) const
Status of metadata cache.
Definition RepoManager.cc:155
zypp::RepoManager::addRepositories
void addRepositories(const Url &url, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Adds repositores from a repo file to the list of known repositories.
Definition RepoManager.cc:200
zypp::RepoManager::refreshMetadata
void refreshMetadata(const RepoInfo &info, RawMetadataRefreshPolicy policy=RefreshIfNeeded, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Refresh local raw cache.
Definition RepoManager.cc:142
zypp::RepoManager::refreshGeoIp
void refreshGeoIp(const RepoInfo::url_set &urls)
Definition RepoManager.cc:272
zypp::RepoManager::refreshService
void refreshService(const std::string &alias, const RefreshServiceOptions &options_r=RefreshServiceOptions())
Refresh specific service.
Definition RepoManager.cc:263
zypp::RepoManager::serviceEnd
ServiceConstIterator serviceEnd() const
Iterator to place behind last service in internal storage.
Definition RepoManager.cc:236
zypp::RepoManager::CacheBuildPolicy
RepoManagerFlags::CacheBuildPolicy CacheBuildPolicy
Definition RepoManager.h:87
zypp::RepoManager::serviceBegin
ServiceConstIterator serviceBegin() const
Iterator to first service in internal storage.
Definition RepoManager.cc:233
zypp::RepoManager::RefreshCheckStatus
RepoManagerFlags::RefreshCheckStatus RefreshCheckStatus
Definition RepoManager.h:141
zypp::RepoManager::repoSize
RepoSizeType repoSize() const
Definition RepoManager.cc:92
zypp::RepoManager::modifyRepository
void modifyRepository(const std::string &alias, const RepoInfo &newinfo, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Modify repository attributes.
Definition RepoManager.cc:210
zypp::RepoManager::removeRepository
void removeRepository(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Remove the best matching repository from known repos list.
Definition RepoManager.cc:203
zypp::RepoManager::getRepositoryInfo
RepoInfo getRepositoryInfo(const std::string &alias, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Find a matching repository info.
Definition RepoManager.cc:221
zypp::RepoManager::serviceSize
ServiceSizeType serviceSize() const
Gets count of service in RepoManager (in specified location).
Definition RepoManager.cc:230
zypp::RepoManager::getService
ServiceInfo getService(const std::string &alias) const
Finds ServiceInfo by alias or return ServiceInfo::noService.
Definition RepoManager.cc:239
zypp::RepoManager::checkIfToRefreshMetadata
RefreshCheckStatus checkIfToRefreshMetadata(const RepoInfo &info, const Url &url, RawMetadataRefreshPolicy policy=RefreshIfNeeded)
Checks whether to refresh metadata for specified repository and url.
Definition RepoManager.cc:133
zypp::RepoManager::RepoSizeType
RepoSet::size_type RepoSizeType
Definition RepoManager.h:75
zypp::RepoManager::repoBegin
RepoConstIterator repoBegin() const
Definition RepoManager.cc:95
zypp::RepoManager::buildCache
void buildCache(const RepoInfo &info, CacheBuildPolicy policy=BuildIfNeeded, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Refresh local cache.
Definition RepoManager.cc:158
zypp::RepoManager::RefreshServiceOptions
RepoManagerFlags::RefreshServiceFlags RefreshServiceOptions
Options tuning RefreshService.
Definition RepoManager.h:99
zypp::RepoManager::RepoManager
RepoManager(RepoManagerOptions options=RepoManagerOptions())
Definition repomanager.cc:238
zypp::RepoManager::loadFromCache
void loadFromCache(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Load resolvables into the pool.
Definition RepoManager.cc:171
zypp::RepoManager::cleanPackages
void cleanPackages(const RepoInfo &info, const ProgressData::ReceiverFnc &progressrcv=ProgressData::ReceiverFnc())
Clean local package cache.
Definition RepoManager.cc:152
zypp::RepoManager::repoEnd
RepoConstIterator repoEnd() const
Definition RepoManager.cc:98
zypp::RepoManager::metadataStatus
RepoStatus metadataStatus(const RepoInfo &info) const
Status of local metadata.
Definition RepoManager.cc:127
zypp::RepoManager::modifyService
void modifyService(const std::string &oldAlias, const ServiceInfo &service)
Modifies service file (rewrites it with new values) and underlying repositories if needed.
Definition RepoManager.cc:269
zypp::RepoManager::RepoConstIterator
RepoSet::const_iterator RepoConstIterator
Definition RepoManager.h:74
zypp::RepoManager::makeStupidAlias
static std::string makeStupidAlias(const Url &url_r=Url())
Some stupid string but suitable as alias for your url if nothing better is available.
Definition RepoManager.cc:107
zypp::RepoManager::probe
repo::RepoType probe(const Url &url, const Pathname &path) const
Probe repo metadata type.
Definition RepoManager.cc:177
zypp::RepoStatus
Track changing files or directories.
Definition RepoStatus.h:41
zypp::ServiceInfo
Service data.
Definition ServiceInfo.h:37
zypp::Url
Url manipulation class.
Definition Url.h:93
zypp::Url::getScheme
std::string getScheme() const
Returns the scheme name of the URL.
Definition Url.cc:560
zypp::Url::asCompleteString
std::string asCompleteString() const
Returns a complete string representation of the Url object.
Definition Url.cc:532
zypp::Url::getHost
std::string getHost(EEncoding eflag=zypp::url::E_DECODED) const
Returns the hostname or IP from the URL authority.
Definition Url.cc:615
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:48
zypp::repo::RepoInfoBase::setFilepath
void setFilepath(const Pathname &filename)
set the path to the .repo file
Definition RepoInfoBase.cc:101
zypp::repo::RepoInfoBase::filepath
Pathname filepath() const
File where this repo was read from.
Definition RepoInfoBase.cc:133
zyppng::Context::defaultContext
static ContextRef defaultContext()
Definition context.cc:26
zyppng::RepoManager
The RepoManager class Provides knowledge and methods to maintain repo settings and metadata for a giv...
Definition repomanager.h:241
zyppng::RepoManager::create
static expected< std::shared_ptr< RepoManager > > create(Args &&...args)
Definition repomanager.h:262
context.h
zypp::TriBool
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition String.h:31
std
Definition ansi.h:855
str
String related utilities and Regular expression matching.
zypp::repo
Definition DeltaCandidates.cc:30
zypp::str::hexstring
std::string hexstring(char n, int w=4)
Definition String.h:325
zypp::url
Url details namespace.
Definition UrlBase.cc:58
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::readRepoFile
std::list< RepoInfo > readRepoFile(const Url &repo_file)
Parses repo_file and returns a list of RepoInfo objects corresponding to repositories found within th...
Definition RepoManager.cc:280
zyppng::RepoManagerWorkflow::readRepoFile
MaybeAwaitable< expected< std::list< RepoInfo > > > readRepoFile(ContextRef ctx, zypp::Url repoFileUrl)
Definition repomanagerwf.cc:215
zyppng
Definition MediaNetworkRequestExecutor.h:16
zyppng::rawcache_path_for_repoinfo
expected< zypp::Pathname > rawcache_path_for_repoinfo(const RepoManagerOptions &opt, const RepoInfo &info)
Calculates the raw cache path for a repository, this is usually /var/cache/zypp/alias.
Definition repomanager.h:166
zyppng::packagescache_path_for_repoinfo
expected< zypp::Pathname > packagescache_path_for_repoinfo(const RepoManagerOptions &opt, const RepoInfo &info)
Calculates the packages cache path for a repository.
Definition repomanager.h:189
progressobserveradaptor.h
refresh.h
repomanagerwf.h
zypp::RepoManagerOptions
Repo manager settings.
Definition RepoManagerOptions.h:26
zypp::RepoManager::Impl
RepoManager implementation.
Definition RepoManager.cc:41
zypp::RepoManager::Impl::operator=
Impl & operator=(const Impl &)=delete
zypp::RepoManager::Impl::Impl
Impl(const Impl &)=delete
zypp::RepoManager::Impl::operator<<
std::ostream & operator<<(std::ostream &str, const RepoManager::Impl &obj)
Stream output.
Definition RepoManager.cc:73
zypp::RepoManager::Impl::rwcowClone
friend Impl * rwcowClone(const Impl *rhs)
zypp::RepoManager::Impl::ngMgr
zyppng::RepoManager & ngMgr()
Definition RepoManager.cc:57
zypp::RepoManager::Impl::Impl
Impl(Impl &&)=delete
zypp::RepoManager::Impl::clone
Impl * clone() const
clone for RWCOW_pointer
Definition RepoManager.cc:67
zypp::RepoManager::Impl::_ngMgr
zyppng::RepoManagerRef _ngMgr
Definition RepoManager.cc:62
zypp::RepoManager::Impl::ngMgr
const zyppng::RepoManager & ngMgr() const
Definition RepoManager.cc:53
zypp::RepoManager::Impl::Impl
Impl(zyppng::ContextRef &&ctx, RepoManagerOptions &&opt)
Definition RepoManager.cc:43
zypp::RepoManager::Impl::operator=
Impl & operator=(Impl &&)=delete
zypp::callback::SendReport
Definition Callback.h:237
zypp::media::ScopedDisableMediaChangeReport
Temporarily disable MediaChangeReport Sometimes helpful to suppress interactive messages connected to...
Definition ZYppCallbacks.h:354
zypp::repo::RepoType
Repository type enumeration.
Definition RepoType.h:29
zypp::repo::ServiceType
Service type enumeration.
Definition ServiceType.h:27
zypp::url::ViewOption
Url::asString() view options.
Definition UrlBase.h:41
zyppng::ProgressObserverAdaptor
Definition progressobserveradaptor.h:17
Digest.h