libzypp 17.38.15
zypp::sat::Pool Class Reference

Global sat-pool. More...

#include <zypp/sat/Pool.h>

Inheritance diagram for zypp::sat::Pool:

Public Types

using SolvableIterator = detail::SolvableIterator
using RepositoryIterator = zypp::detail::RepositoryIterator
using size_type = detail::size_type

Public Member Functions

 Pool (const detail::PoolMember &)
 Ctor from PoolMember.
size_type capacity () const
 Internal array size for stats only.
const SerialNumberserial () const
 Housekeeping data serial number.
const SerialNumberserialIDs () const
 Serial number changing whenever resusePoolIDs==true was used.
void prepare () const
 Update housekeeping data if necessary (e.g.
Pathname rootDir () const
 Get rootdir (for file conflicts check)
void rootDir (const Pathname &root_r)
 Set rootdir (for file conflicts check)
bool reposEmpty () const
 Whether Pool contains repos.
size_type reposSize () const
 Number of repos in Pool.
RepositoryIterator reposBegin () const
 Iterator to the first Repository.
RepositoryIterator reposEnd () const
 Iterator behind the last Repository.
Iterable< RepositoryIteratorrepos () const
 Iterate the repositories.
Repository reposInsert (const std::string &alias_r)
 Return a Repository named alias_r.
Repository reposFind (const std::string &alias_r) const
 Find a Repository named alias_r.
void reposErase (const std::string &alias_r)
 Remove a Repository named alias_r.
void reposEraseAll ()
 Remove all repos from the pool.
Repository findSystemRepo () const
 Return the system repository if it is on the pool.
Repository systemRepo ()
 Return the system repository, create it if missing.
Repository addRepoSolv (const Pathname &file_r, const std::string &name_r)
 Load Solvables from a solv-file into a Repository named name_r.
Repository addRepoSolv (const Pathname &file_r)
Repository addRepoSolv (const Pathname &file_r, const RepoInfo &info_r)
void reserveIds (unsigned numid_r, unsigned numrel_r)
 Size the pool's id hash tables for the given number of new string and rel ids that upcoming addRepoSolv calls will add, to avoid rehashing all interned ids on every growth.
Iterate all Solvables matching a \c TFilter.
template<class TFilter>
filter_iterator< TFilter, SolvableIteratorfilterBegin (const TFilter &filter_r) const
template<class TFilter>
filter_iterator< TFilter, SolvableIteratorfilterEnd (const TFilter &filter_r) const
WhatProvides whatProvides (Capability cap_r) const
 Conainer of all Solvable providing cap_r.
Queue whatMatchesDep (const SolvAttr &attr, const Capability &cap) const
Queue whatMatchesSolvable (const SolvAttr &attr, const Solvable &solv) const
Queue whatContainsDep (const SolvAttr &attr, const Capability &cap) const
Requested locales.
void setTextLocale (const Locale &locale_r)
 Set the default language for retrieving translated texts.
void setRequestedLocales (const LocaleSet &locales_r)
 Set the requested locales.
bool addRequestedLocale (const Locale &locale_r)
 Add one Locale to the set of requested locales.
bool eraseRequestedLocale (const Locale &locale_r)
 Erase one Locale from the set of requested locales.
const LocaleSetgetRequestedLocales () const
 Return the requested locales.
bool isRequestedLocale (const Locale &locale_r) const
 Whether this Locale is in the set of requested locales.
void initRequestedLocales (const LocaleSet &locales_r)
 Start tracking changes based on this locales_r.
const LocaleSetgetAddedRequestedLocales () const
 Added since last initRequestedLocales.
const LocaleSetgetRemovedRequestedLocales () const
 Removed since last initRequestedLocales.
const LocaleSetgetAvailableLocales () const
 Get the set of available locales.
bool isAvailableLocale (const Locale &locale_r) const
 Whether this Locale is in the set of available locales.
Autoinstalled
Queue autoInstalled () const
 Get ident list of all autoinstalled solvables.
void setAutoInstalled (const Queue &autoInstalled_r)
 Set ident list of all autoinstalled solvables.

Static Public Member Functions

static Pool instance ()
 Singleton ctor.
static const std::string & systemRepoAlias ()
 Reserved system repository alias @System .

Multiversion install.

Whether the pool contains packages which are multiversion installable.

See also
Solvable::multiversionInstall
ZConfig::multiversionSpec
using MultiversionList = SolvableSet
const MultiversionListmultiversion () const
ZYPP_DEPRECATED bool multiversionEmpty () const

Experimental whole-pool snapshot (ZYPP_POOL_SNAPSHOT=1).

The snapshot caches the merged pool of all repos, so a zypper invocation can skip re-interning millions of ids from the per-repo solv caches.

The cookie describes the repo set the snapshot was made from; mapSnapshot only restores if it matches cookie_r and the pool is still empty.

static std::string snapshotCookie (const Pathname &path_r)
 Cookie stored in the snapshot, empty if unreadable.
static bool snapshotMapped ()
 Whether mapSnapshot succeeded in this process.
bool mapSnapshot (const Pathname &path_r, const std::string &cookie_r)
bool writeSnapshot (const Pathname &path_r, const std::string &cookie_r) const
void setSnapshotCandidate (const Pathname &path_r, const std::string &cookie_r, const std::vector< std::string > &aliases_r)
 Arm snapshot writing: once the pool holds exactly the repos in aliases_r (sorted), detail::PoolImpl::prepare writes the snapshot if it is missing or stale.
Repository addRepoHelix (const Pathname &file_r, const std::string &name_r)
 Load Solvables from a helix-file into a Repository named name_r.
Repository addRepoHelix (const Pathname &file_r)
Repository addRepoHelix (const Pathname &file_r, const RepoInfo &info_r)
bool solvablesEmpty () const
 Whether Pool contains solvables.
size_type solvablesSize () const
 Number of solvables in Pool.
SolvableIterator solvablesBegin () const
 Iterator to the first Solvable.
SolvableIterator solvablesEnd () const
 Iterator behind the last Solvable.
Iterable< SolvableIteratorsolvables () const
 Iterate the solvables.

Needreboot

void setNeedrebootSpec (sat::SolvableSpec needrebootSpec_r)
 Solvables which should trigger the reboot-needed hint if installed/updated.
detail::CPoolget () const
 Expert backdoor.
 Pool ()
 Default ctor.

Additional Inherited Members

Static Protected Member Functions inherited from zypp::sat::detail::PoolMember
static PoolImplmyPool ()
static bool poolValid ()

Detailed Description

Global sat-pool.

Explicitly shared singleton Pool::instance.

Definition at line 47 of file Pool.h.

Member Typedef Documentation

◆ SolvableIterator

◆ RepositoryIterator

◆ size_type

Definition at line 52 of file Pool.h.

◆ MultiversionList

Definition at line 286 of file Pool.h.

Constructor & Destructor Documentation

◆ Pool() [1/2]

zypp::sat::Pool::Pool ( const detail::PoolMember & )
inline

Ctor from PoolMember.

Definition at line 60 of file Pool.h.

◆ Pool() [2/2]

zypp::sat::Pool::Pool ( )
inlineprivate

Default ctor.

Definition at line 313 of file Pool.h.

Member Function Documentation

◆ instance()

Pool zypp::sat::Pool::instance ( )
inlinestatic

Singleton ctor.

Definition at line 56 of file Pool.h.

◆ capacity()

Pool::size_type zypp::sat::Pool::capacity ( ) const

Internal array size for stats only.

Definition at line 55 of file Pool.cc.

◆ serial()

const SerialNumber & zypp::sat::Pool::serial ( ) const

Housekeeping data serial number.

Definition at line 58 of file Pool.cc.

◆ serialIDs()

const SerialNumber & zypp::sat::Pool::serialIDs ( ) const

Serial number changing whenever resusePoolIDs==true was used.

ResPool must also invalidate its PoolItems!

Definition at line 61 of file Pool.cc.

◆ prepare()

void zypp::sat::Pool::prepare ( ) const

Update housekeeping data if necessary (e.g.

whatprovides).

Definition at line 64 of file Pool.cc.

◆ rootDir() [1/2]

Pathname zypp::sat::Pool::rootDir ( ) const

Get rootdir (for file conflicts check)

Definition at line 67 of file Pool.cc.

◆ rootDir() [2/2]

void zypp::sat::Pool::rootDir ( const Pathname & root_r)

Set rootdir (for file conflicts check)

Definition at line 70 of file Pool.cc.

◆ reposEmpty()

bool zypp::sat::Pool::reposEmpty ( ) const

Whether Pool contains repos.

Definition at line 73 of file Pool.cc.

◆ reposSize()

Pool::size_type zypp::sat::Pool::reposSize ( ) const

Number of repos in Pool.

Definition at line 76 of file Pool.cc.

◆ reposBegin()

Pool::RepositoryIterator zypp::sat::Pool::reposBegin ( ) const

Iterator to the first Repository.

Definition at line 79 of file Pool.cc.

◆ reposEnd()

Pool::RepositoryIterator zypp::sat::Pool::reposEnd ( ) const

Iterator behind the last Repository.

Definition at line 90 of file Pool.cc.

◆ repos()

Iterable< RepositoryIterator > zypp::sat::Pool::repos ( ) const
inline

Iterate the repositories.

Definition at line 96 of file Pool.h.

◆ reposInsert()

Repository zypp::sat::Pool::reposInsert ( const std::string & alias_r)

Return a Repository named alias_r.

It a such a Repository does not already exist a new empty Repository is created.

Definition at line 146 of file Pool.cc.

◆ reposFind()

Repository zypp::sat::Pool::reposFind ( const std::string & alias_r) const

Find a Repository named alias_r.

Returns noRepository if there is no such Repository.

Definition at line 166 of file Pool.cc.

◆ reposErase()

void zypp::sat::Pool::reposErase ( const std::string & alias_r)
inline

Remove a Repository named alias_r.

See also
Repository::eraseFromPool

Definition at line 113 of file Pool.h.

◆ reposEraseAll()

void zypp::sat::Pool::reposEraseAll ( )
inline

Remove all repos from the pool.

This also shrinks a pool which may have become large after having added and removed repos lots of times.

Definition at line 120 of file Pool.h.

◆ systemRepoAlias()

const std::string & zypp::sat::Pool::systemRepoAlias ( )
static

Reserved system repository alias @System .

Definition at line 49 of file Pool.cc.

◆ findSystemRepo()

Repository zypp::sat::Pool::findSystemRepo ( ) const

Return the system repository if it is on the pool.

Definition at line 176 of file Pool.cc.

◆ systemRepo()

Repository zypp::sat::Pool::systemRepo ( )

Return the system repository, create it if missing.

Definition at line 181 of file Pool.cc.

◆ addRepoSolv() [1/3]

Repository zypp::sat::Pool::addRepoSolv ( const Pathname & file_r,
const std::string & name_r )

Load Solvables from a solv-file into a Repository named name_r.

In case of an exception the Repository is removed from the Pool.

Exceptions
Exceptionif loading the solv-file fails.
See also
Repository::EraseFromPool

Definition at line 249 of file Pool.cc.

◆ addRepoSolv() [2/3]

Repository zypp::sat::Pool::addRepoSolv ( const Pathname & file_r)

Definition at line 261 of file Pool.cc.

◆ addRepoSolv() [3/3]

Repository zypp::sat::Pool::addRepoSolv ( const Pathname & file_r,
const RepoInfo & info_r )

Definition at line 264 of file Pool.cc.

◆ reserveIds()

void zypp::sat::Pool::reserveIds ( unsigned numid_r,
unsigned numrel_r )

Size the pool's id hash tables for the given number of new string and rel ids that upcoming addRepoSolv calls will add, to avoid rehashing all interned ids on every growth.

Definition at line 188 of file Pool.cc.

◆ mapSnapshot()

bool zypp::sat::Pool::mapSnapshot ( const Pathname & path_r,
const std::string & cookie_r )

Definition at line 213 of file Pool.cc.

◆ writeSnapshot()

bool zypp::sat::Pool::writeSnapshot ( const Pathname & path_r,
const std::string & cookie_r ) const

Definition at line 223 of file Pool.cc.

◆ snapshotCookie()

std::string zypp::sat::Pool::snapshotCookie ( const Pathname & path_r)
static

Cookie stored in the snapshot, empty if unreadable.

Definition at line 201 of file Pool.cc.

◆ snapshotMapped()

bool zypp::sat::Pool::snapshotMapped ( )
static

Whether mapSnapshot succeeded in this process.

Definition at line 195 of file Pool.cc.

◆ setSnapshotCandidate()

void zypp::sat::Pool::setSnapshotCandidate ( const Pathname & path_r,
const std::string & cookie_r,
const std::vector< std::string > & aliases_r )

Arm snapshot writing: once the pool holds exactly the repos in aliases_r (sorted), detail::PoolImpl::prepare writes the snapshot if it is missing or stale.

Definition at line 198 of file Pool.cc.

◆ addRepoHelix() [1/3]

Repository zypp::sat::Pool::addRepoHelix ( const Pathname & file_r,
const std::string & name_r )

Load Solvables from a helix-file into a Repository named name_r.

Supports loading of gzip compressed files (.gz). In case of an exception the Repository is removed from the Pool.

Exceptions
Exceptionif loading the helix-file fails.
See also
Repository::EraseFromPool

Definition at line 273 of file Pool.cc.

◆ addRepoHelix() [2/3]

Repository zypp::sat::Pool::addRepoHelix ( const Pathname & file_r)

Definition at line 285 of file Pool.cc.

◆ addRepoHelix() [3/3]

Repository zypp::sat::Pool::addRepoHelix ( const Pathname & file_r,
const RepoInfo & info_r )

Definition at line 288 of file Pool.cc.

◆ solvablesEmpty()

bool zypp::sat::Pool::solvablesEmpty ( ) const

Whether Pool contains solvables.

Definition at line 93 of file Pool.cc.

◆ solvablesSize()

Pool::size_type zypp::sat::Pool::solvablesSize ( ) const

Number of solvables in Pool.

Definition at line 106 of file Pool.cc.

◆ solvablesBegin()

Pool::SolvableIterator zypp::sat::Pool::solvablesBegin ( ) const

Iterator to the first Solvable.

Definition at line 119 of file Pool.cc.

◆ solvablesEnd()

Pool::SolvableIterator zypp::sat::Pool::solvablesEnd ( ) const

Iterator behind the last Solvable.

Definition at line 122 of file Pool.cc.

◆ solvables()

Iterable< SolvableIterator > zypp::sat::Pool::solvables ( ) const
inline

Iterate the solvables.

Definition at line 202 of file Pool.h.

◆ filterBegin()

template<class TFilter>
filter_iterator< TFilter, SolvableIterator > zypp::sat::Pool::filterBegin ( const TFilter & filter_r) const
inline

Definition at line 209 of file Pool.h.

◆ filterEnd()

template<class TFilter>
filter_iterator< TFilter, SolvableIterator > zypp::sat::Pool::filterEnd ( const TFilter & filter_r) const
inline

Definition at line 213 of file Pool.h.

◆ whatProvides()

WhatProvides zypp::sat::Pool::whatProvides ( Capability cap_r) const
inline

Conainer of all Solvable providing cap_r.

Definition at line 219 of file Pool.h.

◆ whatMatchesDep()

sat::Queue zypp::sat::Pool::whatMatchesDep ( const SolvAttr & attr,
const Capability & cap ) const

Definition at line 125 of file Pool.cc.

◆ whatMatchesSolvable()

Queue zypp::sat::Pool::whatMatchesSolvable ( const SolvAttr & attr,
const Solvable & solv ) const

Definition at line 132 of file Pool.cc.

◆ whatContainsDep()

Queue zypp::sat::Pool::whatContainsDep ( const SolvAttr & attr,
const Capability & cap ) const

Definition at line 139 of file Pool.cc.

◆ setTextLocale()

void zypp::sat::Pool::setTextLocale ( const Locale & locale_r)

Set the default language for retrieving translated texts.

Updated when calling ZConfig::setTextLocale.

Definition at line 297 of file Pool.cc.

◆ setRequestedLocales()

void zypp::sat::Pool::setRequestedLocales ( const LocaleSet & locales_r)

Set the requested locales.

Languages to be supported by the system, e.g. language specific packages to be installed.

Definition at line 300 of file Pool.cc.

◆ addRequestedLocale()

bool zypp::sat::Pool::addRequestedLocale ( const Locale & locale_r)

Add one Locale to the set of requested locales.

Return true if locale_r was newly added to the set.

Definition at line 303 of file Pool.cc.

◆ eraseRequestedLocale()

bool zypp::sat::Pool::eraseRequestedLocale ( const Locale & locale_r)

Erase one Locale from the set of requested locales.

Return false if locale_r was not found in the set.

Definition at line 306 of file Pool.cc.

◆ getRequestedLocales()

const LocaleSet & zypp::sat::Pool::getRequestedLocales ( ) const

Return the requested locales.

See also
setRequestedLocales

Definition at line 309 of file Pool.cc.

◆ isRequestedLocale()

bool zypp::sat::Pool::isRequestedLocale ( const Locale & locale_r) const

Whether this Locale is in the set of requested locales.

Definition at line 312 of file Pool.cc.

◆ initRequestedLocales()

void zypp::sat::Pool::initRequestedLocales ( const LocaleSet & locales_r)

Start tracking changes based on this locales_r.

Definition at line 315 of file Pool.cc.

◆ getAddedRequestedLocales()

const LocaleSet & zypp::sat::Pool::getAddedRequestedLocales ( ) const

Added since last initRequestedLocales.

Definition at line 316 of file Pool.cc.

◆ getRemovedRequestedLocales()

const LocaleSet & zypp::sat::Pool::getRemovedRequestedLocales ( ) const

Removed since last initRequestedLocales.

Definition at line 317 of file Pool.cc.

◆ getAvailableLocales()

const LocaleSet & zypp::sat::Pool::getAvailableLocales ( ) const

Get the set of available locales.

This is computed from the package data so it actually represents all locales packages claim to support.

Definition at line 319 of file Pool.cc.

◆ isAvailableLocale()

bool zypp::sat::Pool::isAvailableLocale ( const Locale & locale_r) const

Whether this Locale is in the set of available locales.

Definition at line 322 of file Pool.cc.

◆ multiversion()

const Pool::MultiversionList & zypp::sat::Pool::multiversion ( ) const

Definition at line 325 of file Pool.cc.

◆ multiversionEmpty()

ZYPP_DEPRECATED bool zypp::sat::Pool::multiversionEmpty ( ) const
inline
Deprecated
Legacy, use multiversion().empty() instead.

Definition at line 289 of file Pool.h.

◆ autoInstalled()

Queue zypp::sat::Pool::autoInstalled ( ) const

Get ident list of all autoinstalled solvables.

Definition at line 328 of file Pool.cc.

◆ setAutoInstalled()

void zypp::sat::Pool::setAutoInstalled ( const Queue & autoInstalled_r)

Set ident list of all autoinstalled solvables.

Definition at line 329 of file Pool.cc.

◆ setNeedrebootSpec()

void zypp::sat::Pool::setNeedrebootSpec ( sat::SolvableSpec needrebootSpec_r)

Solvables which should trigger the reboot-needed hint if installed/updated.

Definition at line 331 of file Pool.cc.

◆ get()

detail::CPool * zypp::sat::Pool::get ( ) const

Expert backdoor.

Definition at line 52 of file Pool.cc.


The documentation for this class was generated from the following files: