libzypp 17.38.15

Repository.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#include <climits>
13#include <iostream>
14#include <utility>
15
16#include <zypp-core/base/Logger.h>
17#include <zypp-core/base/Gettext.h>
18#include <zypp-core/base/Exception.h>
19#include <zypp-core/base/Xml.h>
20
21#include <zypp-core/AutoDispose.h>
22#include <zypp-core/Pathname.h>
23
24#include <zypp/sat/detail/PoolImpl.h>
25#include <zypp/Repository.h>
26#include <zypp/ResPool.h>
27#include <zypp/Product.h>
28#include <zypp/sat/Pool.h>
29
30 extern "C"
31{
32#include <solv/solv_xfopen.h>
33}
34
35 using std::endl;
36
38 namespace zypp
39{
40
41 const Repository Repository::noRepository;
42
43 const std::string & Repository::systemRepoAlias()
44 { return sat::detail::PoolImpl::systemRepoAlias(); }
45
47
48 sat::detail::CRepo * Repository::get() const
49 { return myPool().getRepo( _id ); }
50
51#define NO_REPOSITORY_RETURN( VAL ) \
52 sat::detail::CRepo * _repo( get() ); \
53 if ( ! _repo ) return VAL
54
55#define NO_REPOSITORY_THROW( VAL ) \
56 sat::detail::CRepo * _repo( get() ); \
57 if ( ! _repo ) ZYPP_THROW( VAL )
58
59 bool Repository::isSystemRepo() const
60 {
61 NO_REPOSITORY_RETURN( false );
62 return myPool().isSystemRepo( _repo );
63 }
64
65 std::string Repository::alias() const
66 {
67 NO_REPOSITORY_RETURN( std::string() );
68 if ( ! _repo->name )
69 return std::string();
70 return _repo->name;
71 }
72
73 std::string Repository::name() const
74 { return info().name(); }
75
76 std::string Repository::label() const
77 { return info().label(); }
78
79 int Repository::satInternalPriority() const
80 {
81 NO_REPOSITORY_RETURN( INT_MIN );
82 return _repo->priority;
83 }
84
85 int Repository::satInternalSubPriority() const
86 {
87 NO_REPOSITORY_RETURN( INT_MIN );
88 return _repo->subpriority;
89 }
90
91 Repository::ContentRevision Repository::contentRevision() const
92 {
93 NO_REPOSITORY_RETURN( ContentRevision() );
94 sat::LookupRepoAttr q( sat::SolvAttr::repositoryRevision, *this );
95 return q.empty() ? std::string() : q.begin().asString();
96 }
97
98 Repository::ContentIdentifier Repository::contentIdentifier() const
99 {
100 NO_REPOSITORY_RETURN( ContentIdentifier() );
101 sat::LookupRepoAttr q( sat::SolvAttr::repositoryRepoid, *this );
102 return q.empty() ? std::string() : q.begin().asString();
103 }
104
105 bool Repository::hasContentIdentifier( const ContentIdentifier & id_r ) const
106 {
107 NO_REPOSITORY_RETURN( false );
108 sat::LookupRepoAttr q( sat::SolvAttr::repositoryRepoid, *this );
109 for_( it, q.begin(), q.end() )
110 if ( it.asString() == id_r )
111 return true;
112 return false;
113 }
114
115 zypp::Date Repository::generatedTimestamp() const
116 {
117 NO_REPOSITORY_RETURN( 0 );
118 sat::LookupRepoAttr q( sat::SolvAttr::repositoryTimestamp, *this );
119 return( q.empty() ? 0 : q.begin().asUnsigned() );
120 }
121
122 zypp::Date Repository::suggestedExpirationTimestamp() const
123 {
124 NO_REPOSITORY_RETURN( 0 );
125 Date generated = generatedTimestamp();
126 if ( ! generated )
127 return 0; // do not calculate over a missing generated timestamp
128
129 sat::LookupRepoAttr q( sat::SolvAttr::repositoryExpire, *this );
130 if ( q.empty() )
131 return 0;
132
133 return generated + Date(q.begin().asUnsigned());
134 }
135
136 Repository::Keywords Repository::keywords() const
137 {
138 NO_REPOSITORY_RETURN( Keywords() );
139 return Keywords( sat::SolvAttr::repositoryKeywords, *this, sat::LookupAttr::REPO_ATTR );
140 }
141
142 bool Repository::hasKeyword( const std::string & val_r ) const
143 {
144 for ( const auto & val : keywords() )
145 if ( val == val_r )
146 return true;
147 return false;
148 }
149
150 bool Repository::maybeOutdated() const
151 {
152 NO_REPOSITORY_RETURN( false );
153 // system repo is not mirrored
154 if ( isSystemRepo() )
155 return false;
156
157 Date suggested = suggestedExpirationTimestamp();
158
159 // if no data, don't suggest
160 if ( ! suggested )
161 return false;
162
163 return suggestedExpirationTimestamp() < Date::now();
164 }
165
166 bool Repository::providesUpdatesFor( const CpeId & cpeid_r ) const
167 {
168 NO_REPOSITORY_RETURN( false );
169 if ( ! cpeid_r )
170 return false; // filter queries/products without CpeId, as an empty CpeId matches ANYthing.
171
172 // check in repository metadata
173 for_( it, updatesProductBegin(), updatesProductEnd() )
174 {
175 if ( compare( cpeid_r, it.cpeId(), SetRelation::subset ) )
176 return true;
177 }
178
179 // check whether known products refer to this as update repo
180 sat::LookupRepoAttr myIds( sat::SolvAttr::repositoryRepoid, *this ); // usually just one, but...
181 if ( ! myIds.empty() )
182 {
183 const ResPool & pool( ResPool::instance() );
184 for_( it, pool.byKindBegin<Product>(), pool.byKindEnd<Product>() )
185 {
186 Product::constPtr prod( (*it)->asKind<Product>() );
187 if ( compare( cpeid_r, prod->cpeId(), SetRelation::superset ) )
188 {
189 for_( myId, myIds.begin(), myIds.end() )
190 {
191 if ( prod->hasUpdateContentIdentifier( myId.asString() ) )
192 return true;
193 }
194 }
195 }
196 }
197 return false;
198 }
199
200 bool Repository::isUpdateRepo() const
201 {
202 NO_REPOSITORY_RETURN( false );
203
204 // check in repository metadata
205 if ( updatesProductBegin() != updatesProductEnd() )
206 return true;
207
208 // check whether known products refer to this as update repo
209 sat::LookupRepoAttr myIds( sat::SolvAttr::repositoryRepoid, *this ); // usually just one, but...
210 if ( ! myIds.empty() )
211 {
212 const ResPool & pool( ResPool::instance() );
213 for_( it, pool.byKindBegin<Product>(), pool.byKindEnd<Product>() )
214 {
215 for_( myId, myIds.begin(), myIds.end() )
216 {
217 if ( (*it)->asKind<Product>()->hasUpdateContentIdentifier( myId.asString() ) )
218 return true;
219 }
220 }
221 }
222 return false;
223 }
224
225 bool Repository::solvablesEmpty() const
226 {
227 NO_REPOSITORY_RETURN( true );
228 return !_repo->nsolvables;
229 }
230
231 Repository::size_type Repository::solvablesSize() const
232 {
233 NO_REPOSITORY_RETURN( 0 );
234 return _repo->nsolvables;
235 }
236
237 Repository::SolvableIterator Repository::solvablesBegin() const
238 {
239 NO_REPOSITORY_RETURN( make_filter_iterator( detail::ByRepository( *this ),
240 sat::detail::SolvableIterator(),
241 sat::detail::SolvableIterator() ) );
242 return make_filter_iterator( detail::ByRepository( *this ),
243 sat::detail::SolvableIterator(_repo->start),
244 sat::detail::SolvableIterator(_repo->end) );
245 }
246
247 Repository::SolvableIterator Repository::solvablesEnd() const
248 {
249 NO_REPOSITORY_RETURN( make_filter_iterator( detail::ByRepository( *this ),
250 sat::detail::SolvableIterator(),
251 sat::detail::SolvableIterator() ) );
252 return make_filter_iterator(detail::ByRepository( *this ),
253 sat::detail::SolvableIterator(_repo->end),
254 sat::detail::SolvableIterator(_repo->end) );
255 }
256
257 Repository::ProductInfoIterator Repository::compatibleWithProductBegin() const
258 {
259 NO_REPOSITORY_RETURN( ProductInfoIterator() );
260 return ProductInfoIterator( sat::SolvAttr::repositoryDistros, *this );
261 }
262
263 Repository::ProductInfoIterator Repository::compatibleWithProductEnd() const
264 {
265 return ProductInfoIterator();
266 }
267
268 Repository::ProductInfoIterator Repository::updatesProductBegin() const
269 {
270 NO_REPOSITORY_RETURN( ProductInfoIterator() );
271 return ProductInfoIterator( sat::SolvAttr::repositoryUpdates, *this );
272 }
273
274 Repository::ProductInfoIterator Repository::updatesProductEnd() const
275 {
276 return ProductInfoIterator();
277 }
278
279 RepoInfo Repository::info() const
280 {
281 NO_REPOSITORY_RETURN( RepoInfo() );
282 return myPool().repoInfo( _repo );
283 }
284
285 void Repository::setInfo( const RepoInfo & info_r )
286 {
287 NO_REPOSITORY_THROW( Exception( "Can't set RepoInfo for norepo." ) );
288 if ( info_r.alias() != alias() )
289 {
290 ZYPP_THROW( Exception( str::form( "RepoInfo alias (%s) does not match repository alias (%s)",
291 info_r.alias().c_str(), alias().c_str() ) ) );
292 }
293 myPool().setRepoInfo( _repo, info_r );
294 MIL << *this << endl;
295 }
296
297 void Repository::clearInfo()
298 {
299 NO_REPOSITORY_RETURN();
300 myPool().setRepoInfo( _repo, RepoInfo() );
301 }
302
303 void Repository::eraseFromPool()
304 {
305 NO_REPOSITORY_RETURN();
306 MIL << *this << " removed from pool" << endl;
307 myPool()._deleteRepo( _repo );
308 _id = sat::detail::noRepoId;
309 }
310
311 Repository Repository::nextInPool() const
312 {
313 NO_REPOSITORY_RETURN( noRepository );
314 for_( it, sat::Pool::instance().reposBegin(), sat::Pool::instance().reposEnd() )
315 {
316 if ( *it == *this )
317 {
318 if ( ++it != _for_end )
319 return *it;
320 break;
321 }
322 }
323 return noRepository;
324 }
325
326 void Repository::addSolv( const Pathname & file_r )
327 {
328 NO_REPOSITORY_THROW( Exception( "Can't add solvables to norepo." ) );
329
330 AutoDispose<FILE*> file( ::fopen( file_r.c_str(), "re" ), ::fclose );
331 if ( file == NULL )
332 {
333 file.resetDispose();
334 ZYPP_THROW( Exception( "Can't open solv-file: "+file_r.asString() ) );
335 }
336
337 if ( myPool()._addSolv( _repo, file ) != 0 )
338 {
339 ZYPP_THROW( Exception( "Error reading solv-file: "+file_r.asString() ) );
340 }
341
342 MIL << *this << " after adding " << file_r << endl;
343 }
344
345 void Repository::addHelix( const Pathname & file_r )
346 {
347 NO_REPOSITORY_THROW( Exception( "Can't add solvables to norepo." ) );
348
349 AutoDispose<FILE*> file( ::solv_xfopen( file_r.c_str(), "r" ), ::fclose );
350 if ( file == NULL )
351 {
352 file.resetDispose();
353 ZYPP_THROW( Exception( "Can't open helix-file: "+file_r.asString() ) );
354 }
355
356 if ( myPool()._addHelix( _repo, file ) != 0 )
357 {
358 ZYPP_THROW( Exception( "Error reading helix-file: "+file_r.asString() ) );
359 }
360
361 MIL << *this << " after adding " << file_r << endl;
362 }
363
364 void Repository::addTesttags( const Pathname & file_r )
365 {
366 NO_REPOSITORY_THROW( Exception( "Can't add solvables to norepo." ) );
367
368 AutoDispose<FILE*> file( ::solv_xfopen( file_r.c_str(), "r" ), ::fclose );
369 if ( file == NULL )
370 {
371 file.resetDispose();
372 ZYPP_THROW( Exception( "Can't open testtags-file: "+file_r.asString() ) );
373 }
374
375 if ( myPool()._addTesttags( _repo, file ) != 0 )
376 {
377 ZYPP_THROW( Exception( "Error reading testtags-file: "+file_r.asString() ) );
378 }
379
380 MIL << *this << " after adding " << file_r << endl;
381 }
382
383 sat::detail::SolvableIdType Repository::addSolvables( unsigned count_r )
384 {
385 NO_REPOSITORY_THROW( Exception( "Can't add solvables to norepo.") );
386 return myPool()._addSolvables( _repo, count_r );
387 }
388
389 /******************************************************************
390 **
391 ** FUNCTION NAME : operator<<
392 ** FUNCTION TYPE : std::ostream &
393 */
394 std::ostream & operator<<( std::ostream & str, const Repository & obj )
395 {
396 if ( ! obj )
397 return str << "noRepository";
398
399 return str << "sat::repo(" << obj.alias() << ")"
400 << "{"
401 << "prio " << obj.get()->priority << '.' << obj.get()->subpriority
402 << ", size " << obj.solvablesSize()
403 << "}";
404 }
405
406 std::ostream & dumpAsXmlOn( std::ostream & str, const Repository & obj )
407 {
408 return xmlout::node( str, "repository", {
409 { "name", obj.name() },
410 { "alias", obj.alias() }
411 } );
412 }
413
415 namespace detail
416 {
417 void RepositoryIterator::increment()
418 {
419 if ( base() )
420 {
421 sat::detail::CPool * satpool = sat::Pool::instance().get();
422 do {
423 ++base_reference();
424 } while ( base() < satpool->repos+satpool->nrepos && !*base() );
425 }
426 }
427 } // namespace detail
429
431 //
432 // Repository::ProductInfoIterator
433 //
435
436 Repository::ProductInfoIterator::ProductInfoIterator( sat::SolvAttr attr_r, Repository repo_r )
437 { base_reference() = sat::LookupRepoAttr( std::move(attr_r), repo_r ).begin(); }
438
439 std::string Repository::ProductInfoIterator::label() const
440 { return base_reference().subFind( sat::SolvAttr::repositoryProductLabel ).asString(); }
441
442 CpeId Repository::ProductInfoIterator::cpeId() const
443 { return CpeId( base_reference().subFind( sat::SolvAttr::repositoryProductCpeid ).asString(), CpeId::noThrow ); }
444
446} // namespace zypp
AutoDispose.h
for_
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition Easy.h:27
Exception.h
ZYPP_THROW
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
Definition Exception.h:459
Gettext.h
Logger.h
MIL
#define MIL
Definition Logger.h:130
Pathname.h
Pool.h
Product.h
NO_REPOSITORY_THROW
#define NO_REPOSITORY_THROW(VAL)
Definition Repository.cc:55
NO_REPOSITORY_RETURN
#define NO_REPOSITORY_RETURN(VAL)
Definition Repository.cc:51
Repository.h
ResPool.h
Xml.h
zypp::AutoDispose
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Definition AutoDispose.h:95
zypp::AutoDispose::resetDispose
void resetDispose()
Set no dispose function.
Definition AutoDispose.h:171
zypp::CpeId
Common Platform Enumearation (2.3) See http://cpe.mitre.org/ for more information on the Common Platf...
Definition CpeId.h:33
zypp::CpeId::noThrow
static constexpr NoThrowType noThrow
Indicator argument for non-trowing ctor.
Definition CpeId.h:63
zypp::CpeId::CpeId
CpeId()
Default ctor: ANY-Cpeid, all attribute values are ANY.
Definition CpeId.cc:375
zypp::Date
Store and operate on date (time_t).
Definition Date.h:33
zypp::Date::Date
Date()
Default ctor: 0.
Definition Date.h:57
zypp::Date::now
static Date now()
Return the current time.
Definition Date.h:78
zypp::Exception::Exception
Exception()
Default ctor.
Definition Exception.cc:94
zypp::Product
Product interface.
Definition Product.h:34
zypp::Product::hasUpdateContentIdentifier
bool hasUpdateContentIdentifier(const Repository::ContentIdentifier &cident_r) const
Whether cident_r is listed as required update repository.
Definition Product.cc:248
zypp::Product::constPtr
TraitsType::constPtrType constPtr
Definition Product.h:39
zypp::RepoInfo
What is known about a repository.
Definition RepoInfo.h:72
zypp::RepoInfo::RepoInfo
RepoInfo()
Definition RepoInfo.cc:593
zypp::Repository::ProductInfoIterator
Query class for Repository related products.
Definition Repository.h:383
zypp::Repository::ProductInfoIterator::label
std::string label() const
Product label.
Definition Repository.cc:439
zypp::Repository::ProductInfoIterator::ProductInfoIterator
ProductInfoIterator()
Definition Repository.h:385
zypp::Repository::ProductInfoIterator::cpeId
CpeId cpeId() const
The Common Platform Enumeration name for this product.
Definition Repository.cc:442
zypp::Repository::ProductInfoIterator::Repository
friend class Repository
Definition Repository.h:395
zypp::Repository
Definition Repository.h:40
zypp::Repository::nextInPool
Repository nextInPool() const
Return next Repository in Pool (or noRepository).
Definition Repository.cc:311
zypp::Repository::satInternalSubPriority
int satInternalSubPriority() const
Definition Repository.cc:85
zypp::Repository::noRepository
static const Repository noRepository
Represents no Repository.
Definition Repository.h:67
zypp::Repository::addHelix
void addHelix(const Pathname &file_r)
Load Solvables from a helix-file.
Definition Repository.cc:345
zypp::Repository::Repository
Repository()
Default ctor creates noRepository.
Definition Repository.h:53
zypp::Repository::hasKeyword
bool hasKeyword(const std::string &val_r) const
Whether val_r is present in keywords.
Definition Repository.cc:142
zypp::Repository::isUpdateRepo
bool isUpdateRepo() const
Hint whether the Repo may provide updates for a product.
Definition Repository.cc:200
zypp::Repository::keywords
Keywords keywords() const
repository keywords (tags)
Definition Repository.cc:136
zypp::Repository::get
sat::detail::CRepo * get() const
Expert backdoor.
Definition Repository.cc:48
zypp::Repository::solvablesEmpty
bool solvablesEmpty() const
Whether Repository contains solvables.
Definition Repository.cc:225
zypp::Repository::label
std::string label() const
Alias or name, according to ZConfig::repoLabelIsAlias.
Definition Repository.cc:76
zypp::Repository::suggestedExpirationTimestamp
Date suggestedExpirationTimestamp() const
Suggested expiration timestamp.
Definition Repository.cc:122
zypp::Repository::SolvableIterator
filter_iterator< detail::ByRepository, sat::detail::SolvableIterator > SolvableIterator
Definition Repository.h:42
zypp::Repository::solvablesEnd
SolvableIterator solvablesEnd() const
Iterator behind the last Solvable.
Definition Repository.cc:247
zypp::Repository::compatibleWithProductEnd
ProductInfoIterator compatibleWithProductEnd() const
Get an iterator to the end of the repository compatible distros.
Definition Repository.cc:263
zypp::Repository::satInternalPriority
int satInternalPriority() const
libsolv internal priorities.
Definition Repository.cc:79
zypp::Repository::clearInfo
void clearInfo()
Remove any RepoInfo set for this repository.
Definition Repository.cc:297
zypp::Repository::size_type
sat::detail::size_type size_type
Definition Repository.h:43
zypp::Repository::addSolvables
sat::Solvable::IdType addSolvables(unsigned count_r)
Add count_r new empty Solvable to this Repository.
Definition Repository.cc:383
zypp::Repository::providesUpdatesFor
bool providesUpdatesFor(const CpeId &cpeid_r) const
Hint whether the Repo may provide updates for a product identified by its CpeId.
Definition Repository.cc:166
zypp::Repository::solvablesBegin
SolvableIterator solvablesBegin() const
Iterator to the first Solvable.
Definition Repository.cc:237
zypp::Repository::ContentRevision
std::string ContentRevision
Definition Repository.h:48
zypp::Repository::addTesttags
void addTesttags(const Pathname &file_r)
Load Solvables from a libsolv testtags-file.
Definition Repository.cc:364
zypp::Repository::updatesProductEnd
ProductInfoIterator updatesProductEnd() const
Get an iterator to the end of distos the repository provides upadates for.
Definition Repository.cc:274
zypp::Repository::contentIdentifier
ContentIdentifier contentIdentifier() const
Unique string identifying a repositories content.
Definition Repository.cc:98
zypp::Repository::maybeOutdated
bool maybeOutdated() const
The suggested expiration date of this repository already passed.
Definition Repository.cc:150
zypp::Repository::compatibleWithProductBegin
ProductInfoIterator compatibleWithProductBegin() const
Get an iterator to the beginning of the repository compatible distros.
Definition Repository.cc:257
zypp::Repository::alias
std::string alias() const
Short unique string to identify a repo.
Definition Repository.cc:65
zypp::Repository::hasContentIdentifier
bool hasContentIdentifier(const ContentIdentifier &id_r) const
Whether id_r matches this repos content identifier.
Definition Repository.cc:105
zypp::Repository::solvablesSize
size_type solvablesSize() const
Number of solvables in Repository.
Definition Repository.cc:231
zypp::Repository::setInfo
void setInfo(const RepoInfo &info_r)
Set RepoInfo for this repository.
Definition Repository.cc:285
zypp::Repository::name
std::string name() const
Label to display for this repo.
Definition Repository.cc:73
zypp::Repository::addSolv
void addSolv(const Pathname &file_r)
Load Solvables from a solv-file.
Definition Repository.cc:326
zypp::Repository::contentRevision
ContentRevision contentRevision() const
Timestamp or arbitrary user supplied string.
Definition Repository.cc:91
zypp::Repository::Keywords
sat::ArrayAttr< std::string, std::string > Keywords
Definition Repository.h:46
zypp::Repository::generatedTimestamp
Date generatedTimestamp() const
Timestamp when this repository was generated.
Definition Repository.cc:115
zypp::Repository::updatesProductBegin
ProductInfoIterator updatesProductBegin() const
Get an iterator to the beginning of distos the repository provides upadates for.
Definition Repository.cc:268
zypp::Repository::ContentIdentifier
std::string ContentIdentifier
Definition Repository.h:49
zypp::Repository::systemRepoAlias
static const std::string & systemRepoAlias()
Reserved system repository alias @System .
Definition Repository.cc:43
zypp::Repository::info
RepoInfo info() const
Return any associated RepoInfo.
Definition Repository.cc:279
zypp::Repository::_id
IdType _id
Definition Repository.h:334
zypp::Repository::eraseFromPool
void eraseFromPool()
Remove this Repository from its Pool.
Definition Repository.cc:303
zypp::Repository::isSystemRepo
bool isSystemRepo() const
Return whether this is the system repository.
Definition Repository.cc:59
zypp::ResPool
Global ResObject pool.
Definition ResPool.h:62
zypp::ResPool::instance
static ResPool instance()
Singleton ctor.
Definition ResPool.cc:38
zypp::detail::RepositoryIterator::increment
void increment()
Definition Repository.cc:417
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:48
zypp::filesystem::Pathname::c_str
const char * c_str() const
String representation.
Definition Pathname.h:113
zypp::filesystem::Pathname::asString
const std::string & asString() const
String representation.
Definition Pathname.h:94
zypp::repo::RepoInfoBase::label
std::string label() const
Label for use in messages for the user interface.
Definition RepoInfoBase.cc:126
zypp::repo::RepoInfoBase::name
std::string name() const
Repository name.
Definition RepoInfoBase.cc:116
zypp::repo::RepoInfoBase::alias
std::string alias() const
unique identifier for this source.
Definition RepoInfoBase.cc:110
zypp::sat::LookupAttr::iterator::asUnsigned
unsigned asUnsigned() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition LookupAttr.cc:559
zypp::sat::LookupAttr::iterator::asString
std::string asString() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition LookupAttr.cc:611
zypp::sat::LookupAttr::iterator::subFind
iterator subFind(const SolvAttr &attr_r) const
Iterator pointing to the first occurance of SolvAttr attr_r in sub-structure.
Definition LookupAttr.cc:498
zypp::sat::LookupAttr::end
iterator end() const
Iterator behind the end of query results.
Definition LookupAttr.cc:240
zypp::sat::LookupAttr::empty
bool empty() const
Whether the query is empty.
Definition LookupAttr.cc:243
zypp::sat::LookupAttr::REPO_ATTR
@ REPO_ATTR
Search for repository attributes.
Definition LookupAttr.h:120
zypp::sat::LookupAttr::begin
iterator begin() const
Iterator to the begin of query results.
Definition LookupAttr.cc:237
zypp::sat::LookupRepoAttr
Lightweight repository attribute value lookup.
Definition LookupAttr.h:265
zypp::sat::Pool::instance
static Pool instance()
Singleton ctor.
Definition Pool.h:55
zypp::sat::Pool::get
detail::CPool * get() const
Expert backdoor.
Definition Pool.cc:49
zypp::sat::SolvAttr
Solvable attribute keys.
Definition SolvAttr.h:41
zypp::sat::SolvAttr::repositoryUpdates
static const SolvAttr repositoryUpdates
array of repositoryProductLabel repositoryProductCpeid pairs
Definition SolvAttr.h:186
zypp::sat::SolvAttr::repositoryRepoid
static const SolvAttr repositoryRepoid
Definition SolvAttr.h:190
zypp::sat::SolvAttr::repositoryRevision
static const SolvAttr repositoryRevision
Definition SolvAttr.h:192
zypp::sat::SolvAttr::repositoryProductLabel
static const SolvAttr repositoryProductLabel
Definition SolvAttr.h:188
zypp::sat::SolvAttr::repositoryTimestamp
static const SolvAttr repositoryTimestamp
Definition SolvAttr.h:184
zypp::sat::SolvAttr::repositoryExpire
static const SolvAttr repositoryExpire
Definition SolvAttr.h:185
zypp::sat::SolvAttr::repositoryProductCpeid
static const SolvAttr repositoryProductCpeid
Definition SolvAttr.h:189
zypp::sat::SolvAttr::repositoryDistros
static const SolvAttr repositoryDistros
array of repositoryProductLabel repositoryProductCpeid pairs
Definition SolvAttr.h:187
zypp::sat::SolvAttr::repositoryKeywords
static const SolvAttr repositoryKeywords
Definition SolvAttr.h:191
zypp::sat::detail::PoolImpl::isSystemRepo
bool isSystemRepo(CRepo *repo_r) const
Definition PoolImpl.h:105
zypp::sat::detail::PoolImpl::getRepo
CRepo * getRepo(RepoIdType id_r) const
Definition PoolImpl.h:180
zypp::sat::detail::PoolImpl::repoInfo
const RepoInfo & repoInfo(RepoIdType id_r)
Definition PoolImpl.h:223
zypp::sat::detail::PoolImpl::_deleteRepo
void _deleteRepo(CRepo *repo_r)
Delete repo repo_r from pool.
Definition PoolImpl.cc:323
zypp::sat::detail::PoolImpl::_addSolvables
detail::SolvableIdType _addSolvables(CRepo *repo_r, unsigned count_r)
Adding Solvables to a repo.
Definition PoolImpl.cc:410
zypp::sat::detail::PoolImpl::systemRepoAlias
static const std::string & systemRepoAlias()
Reserved system repository alias @System .
Definition PoolImpl.cc:102
zypp::sat::detail::PoolImpl::setRepoInfo
void setRepoInfo(RepoIdType id_r, const RepoInfo &info_r)
Also adjust repo priority and subpriority accordingly.
Definition PoolImpl.cc:416
zypp::sat::detail::SolvableIterator
Iterate over valid Solvables in the pool.
Definition Solvable.h:552
str
String related utilities and Regular expression matching.
zypp::base
Definition Random.cc:7
zypp::pool
Definition ByIdent.h:24
zypp::sat::detail::SolvableIdType
unsigned int SolvableIdType
Id type to connect Solvable and sat-solvable.
Definition PoolDefines.h:65
zypp::sat::detail::CRepo
::s_Repo CRepo
Wrapped libsolv C data type exposed as backdoor.
Definition PoolDefines.h:38
zypp::sat::detail::CPool
::s_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
Definition PoolDefines.h:36
zypp::str::form
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
Definition String.cc:39
zypp::xmlout::node
std::ostream & node(std::ostream &out_r, const std::string &name_r, const std::initializer_list< Node::Attr > &attrs_r={})
relates: Node Write a leaf node without PCDATA
Definition Xml.h:198
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::dumpAsXmlOn
std::ostream & dumpAsXmlOn(std::ostream &str, const Repository &obj)
relates: Repository XML output
Definition Repository.cc:406
zypp::asString
std::string asString(const Patch::Category &obj)
relates: Patch::Category string representation.
Definition Patch.cc:122
zypp::operator<<
std::ostream & operator<<(std::ostream &str, const Capabilities &obj)
relates: Capabilities Stream output
Definition Capabilities.cc:65
PoolImpl.h
zypp::detail::ByRepository
Functor filtering Solvable by Repository.
Definition Repository.h:490
zypp::sat::detail::PoolMember::myPool
static PoolImpl & myPool()
Definition PoolMember.cc:41