libzypp 17.31.23
zypp::PurgeKernels::Impl Struct Reference

Public Member Functions

 Impl ()
void setUnameR (const std::string &uname)
bool removePackageAndCheck (const sat::Solvable slv, const std::set< sat::Solvable > &keepList, const std::set< sat::Solvable > &removeList) const
void parseKeepSpec ()
void fillKeepList (const GroupMap &installedKernels, std::set< sat::Solvable > &keepList, std::set< sat::Solvable > &removeList) const

Static Public Member Functions

static bool versionMatch (const Edition &a, const Edition &b)

Public Attributes

std::set< size_t > _keepLatestOffsets = { 0 }
std::set< size_t > _keepOldestOffsets
std::set< Edition_keepSpecificEditions
std::string _uname_r
std::set< Edition_runningKernelEditionVariants
Flavour _runningKernelFlavour
Arch _kernelArch
std::string _keepSpec = ZConfig::instance().multiversionKernels()
bool _keepRunning = true
bool _detectedRunning = false

Detailed Description

Definition at line 59 of file

Constructor & Destructor Documentation

◆ Impl()

zypp::PurgeKernels::Impl::Impl ( )

Definition at line 61 of file

Member Function Documentation

◆ setUnameR()

void zypp::PurgeKernels::Impl::setUnameR ( const std::string &  uname)

Definition at line 82 of file

◆ removePackageAndCheck()

bool zypp::PurgeKernels::Impl::removePackageAndCheck ( const sat::Solvable  slv,
const std::set< sat::Solvable > &  keepList,
const std::set< sat::Solvable > &  removeList 
) const

tries to remove a the PoolItem pi from the pool, solves and checks if no unexpected packages are removed due to the validRemovals regex. If the constraint fails the changes are reverted and false is returned.

Definition at line 144 of file

◆ versionMatch()

bool zypp::PurgeKernels::Impl::versionMatch ( const Edition a,
const Edition b 

Return true if a == b or a == (b minus rebuild counter)

Definition at line 278 of file

◆ parseKeepSpec()

void zypp::PurgeKernels::Impl::parseKeepSpec ( )

Parse the config line keep spec that tells us which kernels should be kept

Definition at line 300 of file

◆ fillKeepList()

void zypp::PurgeKernels::Impl::fillKeepList ( const GroupMap installedKernels,
std::set< sat::Solvable > &  keepList,
std::set< sat::Solvable > &  removeList 
) const

Go over the list of available Editions for each flavour/arch combinations, apply the keep spec and mark the packages that belong to a matching category as to keep

All packages with Arch_noarch will only be matched against the version but NOT the flavour, reasoning for that is simply that source flavours not necessarily match the binary flavours. Without a translation table that would not be doable. This is also what the perl script did.

Definition at line 380 of file

Member Data Documentation

◆ _keepLatestOffsets

std::set<size_t> zypp::PurgeKernels::Impl::_keepLatestOffsets = { 0 }

Definition at line 123 of file

◆ _keepOldestOffsets

std::set<size_t> zypp::PurgeKernels::Impl::_keepOldestOffsets

Definition at line 124 of file

◆ _keepSpecificEditions

std::set<Edition> zypp::PurgeKernels::Impl::_keepSpecificEditions

Definition at line 125 of file

◆ _uname_r

std::string zypp::PurgeKernels::Impl::_uname_r

Definition at line 126 of file

◆ _runningKernelEditionVariants

std::set<Edition> zypp::PurgeKernels::Impl::_runningKernelEditionVariants

A kernel uname can expand into multiple variants especially with rc kernels, older rc releases replaced the upstream tag -rc with .rc, however newer code replaces it with ~rc. We need to check against all variants to match the correct one.

Definition at line 132 of file

◆ _runningKernelFlavour

Flavour zypp::PurgeKernels::Impl::_runningKernelFlavour

Definition at line 133 of file

◆ _kernelArch

Arch zypp::PurgeKernels::Impl::_kernelArch

Definition at line 134 of file

◆ _keepSpec

std::string zypp::PurgeKernels::Impl::_keepSpec = ZConfig::instance().multiversionKernels()

Definition at line 135 of file

◆ _keepRunning

bool zypp::PurgeKernels::Impl::_keepRunning = true

Definition at line 136 of file

◆ _detectedRunning

bool zypp::PurgeKernels::Impl::_detectedRunning = false

Definition at line 137 of file

The documentation for this struct was generated from the following file: