libzypp 17.38.6
PoolImpl.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#include <iostream>
13#include <fstream>
14#include <boost/mpl/int.hpp>
15#include <boost/mpl/assert.hpp>
16
17#include <zypp-core/base/Easy.h>
21#include <zypp/base/Measure.h>
22#include <zypp-core/fs/WatchFile>
23#include <zypp-core/parser/Sysconfig>
25
26#include <zypp/ZConfig.h>
27
31#include <zypp/sat/Pool.h>
32#include <zypp/Capability.h>
33#include <zypp/Locale.h>
34#include <zypp/PoolItem.h>
35
38
39extern "C"
40{
41// Workaround libsolv project not providing a common include
42// directory. (the -devel package does, but the git repo doesn't).
43// #include <solv/repo_helix.h>
44// #include <solv/testcase.h>
45int repo_add_helix( ::Repo *repo, FILE *fp, int flags );
46int testcase_add_testtags(Repo *repo, FILE *fp, int flags);
47}
48
49using std::endl;
50
51#undef ZYPP_BASE_LOGGER_LOGGROUP
52#define ZYPP_BASE_LOGGER_LOGGROUP "zypp::satpool"
53
54// ///////////////////////////////////////////////////////////////////
55namespace zypp
56{
58 namespace env
59 {
61 inline int LIBSOLV_DEBUGMASK()
62 {
63 const char * envp = getenv("LIBSOLV_DEBUGMASK");
64 return envp ? str::strtonum<int>( envp ) : 0;
65 }
66 } // namespace env
68 namespace sat
69 {
70
72 namespace detail
73 {
74
75 // MPL checks for satlib constants we redefine to avoid
76 // includes and defines.
77 BOOST_MPL_ASSERT_RELATION( noId, ==, STRID_NULL );
79
82
83 BOOST_MPL_ASSERT_RELATION( solvablePrereqMarker, ==, SOLVABLE_PREREQMARKER );
84 BOOST_MPL_ASSERT_RELATION( solvableFileMarker, ==, SOLVABLE_FILEMARKER );
85
95
96 BOOST_MPL_ASSERT_RELATION( namespaceModalias, ==, NAMESPACE_MODALIAS );
97 BOOST_MPL_ASSERT_RELATION( namespaceLanguage, ==, NAMESPACE_LANGUAGE );
98 BOOST_MPL_ASSERT_RELATION( namespaceFilesystem, ==, NAMESPACE_FILESYSTEM );
99
101
102 const std::string & PoolImpl::systemRepoAlias()
103 {
104 static const std::string _val( "@System" );
105 return _val;
106 }
107
109 {
110 static const Pathname _val( "/etc/sysconfig/storage" );
111 return _val;
112 }
113
115
116 static void logSat( CPool *, void *data, int type, const char *logString )
117 {
118 // "1234567890123456789012345678901234567890
119 if ( 0 == strncmp( logString, "job: drop orphaned", 18 ) )
120 return;
121 if ( 0 == strncmp( logString, "job: user installed", 19 ) )
122 return;
123 if ( 0 == strncmp( logString, "job: multiversion", 17 ) )
124 return;
125 if ( 0 == strncmp( logString, " - no rule created", 19 ) )
126 return;
127 if ( 0 == strncmp( logString, " next rules: 0 0", 19 ) )
128 return;
129
130 if ( type & (SOLV_FATAL|SOLV_ERROR) ) {
131 L_ERR("libsolv") << logString;
132 } else if ( type & SOLV_DEBUG_STATS ) {
133 L_DBG("libsolv") << logString;
134 } else {
135 L_MIL("libsolv") << logString;
136 }
137 }
138
140 {
141 // lhs: the namespace identifier, e.g. NAMESPACE:MODALIAS
142 // rhs: the value, e.g. pci:v0000104Cd0000840[01]sv*sd*bc*sc*i*
143 // return: 0 if not supportded
144 // 1 if supported by the system
145 // -1 AFAIK it's also possible to return a list of solvables that support it, but don't know how.
146
147 static const detail::IdType RET_unsupported = 0;
148 static const detail::IdType RET_systemProperty = 1;
149 switch ( lhs )
150 {
151 case NAMESPACE_LANGUAGE:
152 {
153 const TrackedLocaleIds & localeIds( reinterpret_cast<PoolImpl*>(data)->trackedLocaleIds() );
154 return localeIds.contains( IdString(rhs) ) ? RET_systemProperty : RET_unsupported;
155 }
156 break;
157
158 case NAMESPACE_MODALIAS:
159 {
160 // modalias strings in capability may be hexencoded because rpm does not allow
161 // ',', ' ' or other special chars.
162 return target::Modalias::instance().query( str::hexdecode( IdString(rhs).c_str() ) )
163 ? RET_systemProperty
164 : RET_unsupported;
165 }
166 break;
167
168 case NAMESPACE_FILESYSTEM:
169 {
170 const std::set<std::string> & requiredFilesystems( reinterpret_cast<PoolImpl*>(data)->requiredFilesystems() );
171 return requiredFilesystems.find( IdString(rhs).asString() ) != requiredFilesystems.end() ? RET_systemProperty : RET_unsupported;
172 }
173 break;
174
175 }
176
177 WAR << "Unhandled " << Capability( lhs ) << " vs. " << Capability( rhs ) << endl;
178 return RET_unsupported;
179 }
180
182 //
183 // METHOD NAME : PoolImpl::PoolImpl
184 // METHOD TYPE : Ctor
185 //
187 : _pool( zyppng::sat::StringPool::instance().getPool() )
188 {
189 // by now we support only a RPM backend
190 ::pool_setdisttype(_pool, DISTTYPE_RPM );
191
192 // initialialize logging
194 {
195 ::pool_setdebugmask(_pool, env::LIBSOLV_DEBUGMASK() );
196 }
197 else
198 {
199 if ( getenv("ZYPP_LIBSOLV_FULLLOG") || getenv("ZYPP_LIBSAT_FULLLOG") )
200 ::pool_setdebuglevel( _pool, 3 );
201 else if ( getenv("ZYPP_FULLLOG") )
202 ::pool_setdebuglevel( _pool, 2 );
203 else
204 ::pool_setdebugmask(_pool, SOLV_DEBUG_JOB|SOLV_DEBUG_STATS );
205 }
206
207 ::pool_setdebugcallback( _pool, logSat, NULL );
208
209 // set namespace callback
210 _pool->nscallback = &nsCallback;
211 _pool->nscallbackdata = (void*)this;
212
213 // CAVEAT: We'd like to do it here, but in side the Pool ctor we can not
214 // yet use IdString types. We do in setDirty, when the 1st
215 // _retractedSpec.addProvides( Capability( Solvable::retractedToken.id() ) );
216 // _ptfMasterSpec.addProvides( Capability( Solvable::ptfMasterToken.id() ) );
217 // _ptfPackageSpec.addProvides( Capability( Solvable::ptfPackageToken.id() ) );
218 _retractedSpec.addIdenticalInstalledToo( true ); // retracted indicator is not part of the package!
219 }
220
222 //
223 // METHOD NAME : PoolImpl::~PoolImpl
224 // METHOD TYPE : Dtor
225 //
227 {
228 }
229
231
232 void PoolImpl::setDirty( const char * a1, const char * a2, const char * a3 )
233 {
234 if ( _retractedSpec.empty() ) {
235 // lazy init IdString types we can not use inside the ctor
239 }
240
241 if ( a1 )
242 {
243 if ( a3 ) MIL << a1 << " " << a2 << " " << a3 << endl;
244 else if ( a2 ) MIL << a1 << " " << a2 << endl;
245 else MIL << a1 << endl;
246 }
247 _serial.setDirty(); // pool content change
248 _availableLocalesPtr.reset(); // available locales may change
249 _multiversionListPtr.reset(); // re-evaluate ZConfig::multiversionSpec.
250 _needrebootSpec.setDirty(); // re-evaluate needrebootSpec
251
252 _retractedSpec.setDirty(); // re-evaluate blacklisted spec
253 _ptfMasterSpec.setDirty(); // --"--
254 _ptfPackageSpec.setDirty(); // --"--
255
256 depSetDirty(); // invaldate dependency/namespace related indices
257 }
258
259 void PoolImpl::localeSetDirty( const char * a1, const char * a2, const char * a3 )
260 {
261 if ( a1 )
262 {
263 if ( a3 ) MIL << a1 << " " << a2 << " " << a3 << endl;
264 else if ( a2 ) MIL << a1 << " " << a2 << endl;
265 else MIL << a1 << endl;
266 }
267 _trackedLocaleIdsPtr.reset(); // requested locales changed
268 depSetDirty(); // invaldate dependency/namespace related indices
269 }
270
271 void PoolImpl::depSetDirty( const char * a1, const char * a2, const char * a3 )
272 {
273 if ( a1 )
274 {
275 if ( a3 ) MIL << a1 << " " << a2 << " " << a3 << endl;
276 else if ( a2 ) MIL << a1 << " " << a2 << endl;
277 else MIL << a1 << endl;
278 }
279 ::pool_freewhatprovides( _pool );
280 }
281
282 void PoolImpl::prepare() const
283 {
284 // additional /etc/sysconfig/storage check:
285 static WatchFile sysconfigFile( sysconfigStoragePath(), WatchFile::NO_INIT );
286 if ( sysconfigFile.hasChanged() )
287 {
288 _requiredFilesystemsPtr.reset(); // recreated on demand
289 const_cast<PoolImpl*>(this)->depSetDirty( "/etc/sysconfig/storage change" );
290 }
291 if ( _watcher.remember( _serial ) )
292 {
293 // After repo/solvable add/remove:
294 // set pool architecture
295 ::pool_setarch( _pool, ZConfig::instance().systemArchitecture().asString().c_str() );
296 }
297 if ( ! _pool->whatprovides )
298 {
299 MIL << "pool_createwhatprovides..." << endl;
300
301 ::pool_addfileprovides( _pool );
302 ::pool_createwhatprovides( _pool );
303 }
304 if ( ! _pool->languages )
305 {
306 // initial seting
307 const_cast<PoolImpl*>(this)->setTextLocale( ZConfig::instance().textLocale() );
308 }
309 }
310
312
313 CRepo * PoolImpl::_createRepo( const std::string & name_r )
314 {
315 setDirty(__FUNCTION__, name_r.c_str() );
316 CRepo * ret = ::repo_create( _pool, name_r.c_str() );
317 if ( ret && name_r == systemRepoAlias() )
318 ::pool_set_installed( _pool, ret );
319 return ret;
320 }
321
323 {
324 setDirty(__FUNCTION__, repo_r->name );
325 if ( isSystemRepo( repo_r ) )
326 _autoinstalled.clear();
327 eraseRepoInfo( repo_r );
328 ::repo_free( repo_r, /*resusePoolIDs*/false );
329 // If the last repo is removed clear the pool to actually reuse all IDs.
330 // NOTE: the explicit ::repo_free above asserts all solvables are memset(0)!
331 if ( !_pool->urepos )
332 {
333 _serialIDs.setDirty(); // Indicate resusePoolIDs - ResPool must also invalidate its PoolItems
334 ::pool_freeallrepos( _pool, /*resusePoolIDs*/true );
335 }
336 }
337
338 int PoolImpl::_addSolv( CRepo * repo_r, FILE * file_r )
339 {
340 setDirty(__FUNCTION__, repo_r->name );
341 int ret = ::repo_add_solv( repo_r, file_r, 0 );
342 if ( ret == 0 )
343 _postRepoAdd( repo_r );
344 return ret;
345 }
346
347 int PoolImpl::_addHelix( CRepo * repo_r, FILE * file_r )
348 {
349 setDirty(__FUNCTION__, repo_r->name );
350 int ret = ::repo_add_helix( repo_r, file_r, 0 );
351 if ( ret == 0 )
352 _postRepoAdd( repo_r );
353 return 0;
354 }
355
356 int PoolImpl::_addTesttags(CRepo *repo_r, FILE *file_r)
357 {
358 setDirty(__FUNCTION__, repo_r->name );
359 int ret = ::testcase_add_testtags( repo_r, file_r, 0 );
360 if ( ret == 0 )
361 _postRepoAdd( repo_r );
362 return 0;
363 }
364
366 {
367 if ( ! isSystemRepo( repo_r ) )
368 {
369 // Filter out unwanted archs
370 std::set<detail::IdType> sysids;
371 {
372 Arch::CompatSet sysarchs( Arch::compatSet( ZConfig::instance().systemArchitecture() ) );
373 for_( it, sysarchs.begin(), sysarchs.end() )
374 sysids.insert( it->id() );
375
376 // unfortunately libsolv treats src/nosrc as architecture:
377 sysids.insert( ARCH_SRC );
378 sysids.insert( ARCH_NOSRC );
379 }
380
381 detail::IdType blockBegin = 0;
382 unsigned blockSize = 0;
383 for ( detail::IdType i = repo_r->start; i < repo_r->end; ++i )
384 {
385 CSolvable * s( _pool->solvables + i );
386 if ( s->repo == repo_r && sysids.find( s->arch ) == sysids.end() )
387 {
388 // Remember an unwanted arch entry:
389 if ( ! blockBegin )
390 blockBegin = i;
391 ++blockSize;
392 }
393 else if ( blockSize )
394 {
395 // Free remembered entries
396 ::repo_free_solvable_block( repo_r, blockBegin, blockSize, /*resusePoolIDs*/false );
397 blockBegin = blockSize = 0;
398 }
399 }
400 if ( blockSize )
401 {
402 // Free remembered entries
403 ::repo_free_solvable_block( repo_r, blockBegin, blockSize, /*resusePoolIDs*/false );
404 blockBegin = blockSize = 0;
405 }
406 }
407 }
408
410 {
411 setDirty(__FUNCTION__, repo_r->name );
412 return ::repo_add_solvable_block( repo_r, count_r );
413 }
414
415 void PoolImpl::setRepoInfo( RepoIdType id_r, const RepoInfo & info_r )
416 {
417 CRepo * repo( getRepo( id_r ) );
418 if ( repo )
419 {
420 bool dirty = false;
421
422 // libsolv priority is based on '<', while yum's repoinfo
423 // uses 1(highest)->99(lowest). Thus we use -info_r.priority.
424 if ( repo->priority != int(-info_r.priority()) )
425 {
426 repo->priority = -info_r.priority();
427 dirty = true;
428 }
429
430 // subpriority is used to e.g. prefer http over dvd iff
431 // both have same priority.
432 int mediaPriority( media::MediaPriority( info_r.url() ) );
433 if ( repo->subpriority != mediaPriority )
434 {
435 repo->subpriority = mediaPriority;
436 dirty = true;
437 }
438
439 if ( dirty )
440 setDirty(__FUNCTION__, info_r.alias().c_str() );
441 }
442 _repoinfos[id_r] = info_r;
443 }
444
446
447 void PoolImpl::setTextLocale( const Locale & locale_r )
448 {
449 if ( ! locale_r )
450 {
451 // We need one, so "en" is the last resort
452 const char *needone[] { "en" };
453 ::pool_set_languages( _pool, needone, 1 );
454 return;
455 }
456
457 std::vector<std::string> fallbacklist;
458 for ( Locale l( locale_r ); l; l = l.fallback() )
459 {
460 fallbacklist.push_back( l.code() );
461 }
462 dumpRangeLine( MIL << "pool_set_languages: ", fallbacklist.begin(), fallbacklist.end() ) << endl;
463
464 std::vector<const char *> fallbacklist_cstr;
465 for_( it, fallbacklist.begin(), fallbacklist.end() )
466 {
467 fallbacklist_cstr.push_back( it->c_str() );
468 }
469 ::pool_set_languages( _pool, &fallbacklist_cstr.front(), fallbacklist_cstr.size() );
470 }
471
473 {
474 if ( _requestedLocalesTracker.setInitial( locales_r ) )
475 {
476 localeSetDirty( "initRequestedLocales" );
477 MIL << "Init RequestedLocales: " << _requestedLocalesTracker << " =" << locales_r << endl;
478 }
479 }
480
481 void PoolImpl::setRequestedLocales( const LocaleSet & locales_r )
482 {
483 if ( _requestedLocalesTracker.set( locales_r ) )
484 {
485 localeSetDirty( "setRequestedLocales" );
486 MIL << "New RequestedLocales: " << _requestedLocalesTracker << " =" << locales_r << endl;
487 }
488 }
489
490 bool PoolImpl::addRequestedLocale( const Locale & locale_r )
491 {
492 bool done = _requestedLocalesTracker.add( locale_r );
493 if ( done )
494 {
495 localeSetDirty( "addRequestedLocale", locale_r.code().c_str() );
496 MIL << "New RequestedLocales: " << _requestedLocalesTracker << " +" << locale_r << endl;
497 }
498 return done;
499 }
500
501 bool PoolImpl::eraseRequestedLocale( const Locale & locale_r )
502 {
503 bool done = _requestedLocalesTracker.remove( locale_r );
504 if ( done )
505 {
506 localeSetDirty( "eraseRequestedLocale", locale_r.code().c_str() );
507 MIL << "New RequestedLocales: " << _requestedLocalesTracker << " -" << locale_r << endl;
508 }
509 return done;
510 }
511
512
514 {
515 if ( ! _trackedLocaleIdsPtr )
516 {
518
521
522 // Add current locales+fallback except for added ones
523 for ( Locale lang: localesTracker.current() )
524 {
525 if ( localesTracker.wasAdded( lang ) )
526 continue;
527 for ( ; lang; lang = lang.fallback() )
528 { localeIds.current().insert( IdString(lang) ); }
529 }
530
531 // Add added locales+fallback except they are already in current
532 for ( Locale lang: localesTracker.added() )
533 {
534 for ( ; lang && localeIds.current().insert( IdString(lang) ).second; lang = lang.fallback() )
535 { localeIds.added().insert( IdString(lang) ); }
536 }
537
538 // Add removed locales+fallback except they are still in current
539 for ( Locale lang: localesTracker.removed() )
540 {
541 for ( ; lang && ! localeIds.current().count( IdString(lang) ); lang = lang.fallback() )
542 { localeIds.removed().insert( IdString(lang) ); }
543 }
544
545 // bsc#1155678: We try to differ between an empty RequestedLocales
546 // and one containing 'en' (explicit or as fallback). An empty RequestedLocales
547 // should not even drag in recommended 'en' packages. So we no longer enforce
548 // 'en' being in the set.
549 }
550 return *_trackedLocaleIdsPtr;
551 }
552
553
554 static void _getLocaleDeps( const Capability & cap_r, LocaleSet & store_r )
555 {
556 // Collect locales from any 'namespace:language(lang)' dependency
557 CapDetail detail( cap_r );
558 if ( detail.kind() == CapDetail::EXPRESSION )
559 {
560 switch ( detail.capRel() )
561 {
564 // expand
565 _getLocaleDeps( detail.lhs(), store_r );
566 _getLocaleDeps( detail.rhs(), store_r );
567 break;
568
570 if ( detail.lhs().id() == NAMESPACE_LANGUAGE )
571 {
572 store_r.insert( Locale( IdString(detail.rhs().id()) ) );
573 }
574 break;
575
576 default:
577 break; // unwanted
578 }
579 }
580 }
581
583 {
585 {
586 _availableLocalesPtr.reset( new LocaleSet );
587 LocaleSet & localeSet( *_availableLocalesPtr );
588
589 for ( const Solvable & pi : Pool::instance().solvables() )
590 {
591 for ( const Capability & cap : pi.dep_supplements() )
592 {
593 _getLocaleDeps( cap, localeSet );
594 }
595 }
596 }
597 return *_availableLocalesPtr;
598 }
599
601
603 {
606
608 for ( const std::string & spec : ZConfig::instance().multiversionSpec() )
609 {
610 static const std::string prefix( "provides:" );
611 bool provides = str::hasPrefix( spec, prefix );
612
613 for ( Solvable solv : WhatProvides( Capability( provides ? spec.c_str() + prefix.size() : spec.c_str() ) ) )
614 {
615 if ( provides || solv.ident() == spec )
616 multiversionList.insert( solv );
617 }
618
620 MIL << "Multiversion install " << spec << ": " << (nsize-size) << " matches" << endl;
621 size = nsize;
622 }
623 }
624
627
634
635 bool PoolImpl::isMultiversion( const Solvable & solv_r ) const
636 { return multiversionList().contains( solv_r ); }
637
639
640 const std::set<std::string> & PoolImpl::requiredFilesystems() const
641 {
643 {
644 _requiredFilesystemsPtr.reset( new std::set<std::string> );
645 std::set<std::string> & requiredFilesystems( *_requiredFilesystemsPtr );
647 std::inserter( requiredFilesystems, requiredFilesystems.end() ) );
648 }
650 }
651
653 } // namespace detail
654
656 } // namespace sat
659} // namespace zypp
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition Easy.h:27
#define L_ERR(GROUP)
Definition Logger.h:114
#define MIL
Definition Logger.h:103
#define WAR
Definition Logger.h:104
#define L_MIL(GROUP)
Definition Logger.h:112
#define L_DBG(GROUP)
Definition Logger.h:111
static CompatSet compatSet(const Arch &targetArch_r)
Return a set of all Arch's compatibleWith a targetArch_r.
Definition Arch.cc:793
std::set< Arch, CompareByGT< Arch > > CompatSet
Reversed arch order, best Arch first.
Definition Arch.h:122
Helper providing more detailed information about a Capability.
Definition Capability.h:366
A sat capability.
Definition Capability.h:63
@ CAP_WITHOUT
without
Definition Capability.h:161
@ CAP_ARCH
Used internally.
Definition Capability.h:164
Access to the sat-pools string space.
Definition IdString.h:55
'Language[_Country]' codes.
Definition Locale.h:51
Locale fallback() const
Return the fallback locale for this locale, if no fallback exists the empty Locale::noCode.
Definition Locale.cc:211
std::string code() const
Return the locale code asString.
Definition Locale.h:89
What is known about a repository.
Definition RepoInfo.h:72
Url url() const
Pars pro toto: The first repository url, this is either baseUrls().front() or if no baseUrl is define...
Definition RepoInfo.cc:854
unsigned priority() const
Repository priority for solver.
Definition RepoInfo.cc:555
Remember a files attributes to detect content changes.
Definition watchfile.h:50
bool hasChanged()
Definition watchfile.h:80
static ZConfig & instance()
Singleton ctor.
Definition ZConfig.cc:756
Derive a numeric priority from Url scheme according to zypp.conf(download.media_preference).
std::string alias() const
unique identifier for this source.
static Pool instance()
Singleton ctor.
Definition Pool.h:55
Container::size_type size_type
Definition SolvableSet.h:42
bool contains(const TSolv &solv_r) const
Definition SolvableSet.h:68
A Solvable object within the sat Pool.
Definition Solvable.h:54
static const IdString ptfMasterToken
Indicator provides ptf().
Definition Solvable.h:62
static const IdString ptfPackageToken
Indicator provides ptf-package().
Definition Solvable.h:63
static const IdString retractedToken
Indicator provides retracted-patch-package().
Definition Solvable.h:61
Container of Solvable providing a Capability (read only).
sat::SolvableSpec _needrebootSpec
Solvables which should trigger the reboot-needed hint if installed/updated.
Definition PoolImpl.h:389
scoped_ptr< TrackedLocaleIds > _trackedLocaleIdsPtr
Definition PoolImpl.h:377
base::SetTracker< IdStringSet > TrackedLocaleIds
Definition PoolImpl.h:294
CPool * getPool() const
Definition PoolImpl.h:176
sat::SolvableSpec _retractedSpec
Blacklisted specs:
Definition PoolImpl.h:392
scoped_ptr< LocaleSet > _availableLocalesPtr
Definition PoolImpl.h:379
scoped_ptr< MultiversionList > _multiversionListPtr
Definition PoolImpl.h:383
bool isSystemRepo(CRepo *repo_r) const
Definition PoolImpl.h:105
static detail::IdType nsCallback(CPool *, void *data, detail::IdType lhs, detail::IdType rhs)
Callback to resolve namespace dependencies (language, modalias, filesystem, etc.).
Definition PoolImpl.cc:139
CRepo * getRepo(RepoIdType id_r) const
Definition PoolImpl.h:180
void setTextLocale(const Locale &locale_r)
Definition PoolImpl.cc:447
void initRequestedLocales(const LocaleSet &locales_r)
Start tracking changes based on this locales_r.
Definition PoolImpl.cc:472
sat::StringQueue _autoinstalled
Definition PoolImpl.h:386
int _addTesttags(CRepo *repo_r, FILE *file_r)
Adding testtags file to a repo.
Definition PoolImpl.cc:356
void multiversionListInit() const
Definition PoolImpl.cc:602
const LocaleSet & getAvailableLocales() const
All Locales occurring in any repo.
Definition PoolImpl.cc:582
std::map< RepoIdType, RepoInfo > _repoinfos
Additional RepoInfo.
Definition PoolImpl.h:372
void _deleteRepo(CRepo *repo_r)
Delete repo repo_r from pool.
Definition PoolImpl.cc:322
bool eraseRequestedLocale(const Locale &locale_r)
User change (tracked).
Definition PoolImpl.cc:501
sat::SolvableSpec _ptfMasterSpec
Definition PoolImpl.h:393
void eraseRepoInfo(RepoIdType id_r)
Definition PoolImpl.h:228
const TrackedLocaleIds & trackedLocaleIds() const
Expanded _requestedLocalesTracker for solver.
Definition PoolImpl.cc:513
void localeSetDirty(const char *a1=0, const char *a2=0, const char *a3=0)
Invalidate locale related housekeeping data.
Definition PoolImpl.cc:259
scoped_ptr< std::set< std::string > > _requiredFilesystemsPtr
filesystems mentioned in /etc/sysconfig/storage
Definition PoolImpl.h:397
base::SetTracker< LocaleSet > _requestedLocalesTracker
Definition PoolImpl.h:376
void setRequestedLocales(const LocaleSet &locales_r)
User change (tracked).
Definition PoolImpl.cc:481
const MultiversionList & multiversionList() const
Definition PoolImpl.cc:628
CRepo * _createRepo(const std::string &name_r)
Creating a new repo named name_r.
Definition PoolImpl.cc:313
SerialNumberWatcher _watcher
Watch serial number.
Definition PoolImpl.h:368
SerialNumber _serial
Serial number - changes with each Pool content change.
Definition PoolImpl.h:364
const std::set< std::string > & requiredFilesystems() const
accessor for etc/sysconfig/storage reading file on demand
Definition PoolImpl.cc:640
void _postRepoAdd(CRepo *repo_r)
Helper postprocessing the repo after adding solv or helix files.
Definition PoolImpl.cc:365
bool addRequestedLocale(const Locale &locale_r)
User change (tracked).
Definition PoolImpl.cc:490
int _addSolv(CRepo *repo_r, FILE *file_r)
Adding solv file to a repo.
Definition PoolImpl.cc:338
int _addHelix(CRepo *repo_r, FILE *file_r)
Adding helix file to a repo.
Definition PoolImpl.cc:347
sat::SolvableSpec _ptfPackageSpec
Definition PoolImpl.h:394
detail::SolvableIdType _addSolvables(CRepo *repo_r, unsigned count_r)
Adding Solvables to a repo.
Definition PoolImpl.cc:409
SerialNumber _serialIDs
Serial number of IDs - changes whenever resusePoolIDs==true - ResPool must also invalidate its PoolIt...
Definition PoolImpl.h:366
bool isMultiversion(const Solvable &solv_r) const
Definition PoolImpl.cc:635
void prepare() const
Update housekeeping data (e.g.
Definition PoolImpl.cc:282
static const std::string & systemRepoAlias()
Reserved system repository alias @System .
Definition PoolImpl.cc:102
CPool * _pool
sat-pool.
Definition PoolImpl.h:362
void setRepoInfo(RepoIdType id_r, const RepoInfo &info_r)
Also adjust repo priority and subpriority accordingly.
Definition PoolImpl.cc:415
void setDirty(const char *a1=0, const char *a2=0, const char *a3=0)
Invalidate housekeeping data (e.g.
Definition PoolImpl.cc:232
void depSetDirty(const char *a1=0, const char *a2=0, const char *a3=0)
Invalidate housekeeping data (e.g.
Definition PoolImpl.cc:271
bool query(IdString cap_r) const
Checks if a device on the system matches a modalias pattern.
Definition Modalias.h:70
static Modalias & instance()
Singleton access.
Definition Modalias.cc:223
Singleton manager for the underlying libsolv string pool.
Definition stringpool.h:35
std::map< std::string, std::string > read(const Pathname &_path)
Read sysconfig file path_r and return (key,valye) pairs.
Definition sysconfig.cc:34
int LIBSOLV_DEBUGMASK()
Definition PoolImpl.cc:61
static const IdType namespaceLanguage(20)
static const IdType solvablePrereqMarker(15)
Internal ids satlib includes in dependencies.
static void _getLocaleDeps(const Capability &cap_r, LocaleSet &store_r)
Definition PoolImpl.cc:554
static const IdType solvableFileMarker(16)
static const IdType emptyId(1)
unsigned int SolvableIdType
Id type to connect Solvable and sat-solvable.
Definition PoolDefines.h:63
static const IdType namespaceModalias(18)
static const IdType namespaceFilesystem(21)
::s_Repo CRepo
Wrapped libsolv C data type exposed as backdoor.
Definition PoolDefines.h:36
static const IdType noId(0)
static const SolvableIdType noSolvableId(0)
Id to denote Solvable::noSolvable.
const Pathname & sysconfigStoragePath()
Definition PoolImpl.cc:108
int IdType
Generic Id type.
Definition PoolDefines.h:42
::s_Solvable CSolvable
Wrapped libsolv C data type exposed as backdoor.
Definition PoolDefines.h:37
::s_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
Definition PoolDefines.h:34
BOOST_MPL_ASSERT_RELATION(noId,==, STRID_NULL)
static const SolvableIdType systemSolvableId(1)
Id to denote the usually hidden Solvable::systemSolvable.
CRepo * RepoIdType
Id type to connect Repo and sat-repo.
Definition PoolDefines.h:71
static void logSat(CPool *, void *data, int type, const char *logString)
Definition PoolImpl.cc:116
Libsolv interface
void setDirty() const
Explicitly flag the cache as dirty, so it will be rebuilt on the next request.
bool dirty() const
Whether the cache is needed and dirty.
std::string hexdecode(const C_Str &str_r)
Decode hexencoded XX sequences.
Definition String.cc:148
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
Definition String.h:1097
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", const Trim trim_r=NO_TRIM)
Split line_r into words.
Definition String.h:602
TInt strtonum(const C_Str &str)
Parsing numbers from string.
Easy-to use interface to the ZYPP dependency resolver.
std::ostream & dumpRangeLine(std::ostream &str, TIterator begin, TIterator end)
Print range defined by iterators (single line style).
Definition LogTools.h:432
std::unordered_set< Locale > LocaleSet
Definition Locale.h:29
std::string asString(const Patch::Category &obj)
relates: Patch::Category string representation.
Definition Patch.cc:122
int repo_add_helix(::Repo *repo, FILE *fp, int flags)
int testcase_add_testtags(Repo *repo, FILE *fp, int flags)
Track added/removed set items based on an initial set.
Definition SetTracker.h:39
const set_type & current() const
Return the current set.
Definition SetTracker.h:140
bool wasAdded(const key_type &key_r) const
Whether val_r is tracked as added.
Definition SetTracker.h:133
const set_type & added() const
Return the set of added items.
Definition SetTracker.h:143
const set_type & removed() const
Return the set of removed items.
Definition SetTracker.h:146
bool contains(const key_type &key_r) const
Whether val_r is in the set.
Definition SetTracker.h:130