libzypp 17.37.10

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