libzypp  17.19.0
zypp::PurgeKernels::Impl Struct Reference

Public Member Functions

 Impl ()
 
bool removePackageAndCheck (PoolItem &item, const str::regex &validRemovals) const
 
void parseKeepSpec ()
 
void fillKeepList (const std::unordered_map< std::string, std::map< Arch, std::map< Edition, sat::Solvable > > > &installedKernels, std::set< sat::Solvable::IdType > &list) const
 
void cleanDevelAndSrcPackages (const str::regex &validRemovals, std::set< Edition > &validEditions, const std::string &flavour=std::string())
 

Static Public Member Functions

static std::string detectRunningKernel ()
 

Public Attributes

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

Detailed Description

Definition at line 35 of file PurgeKernels.cc.

Constructor & Destructor Documentation

◆ Impl()

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

Definition at line 37 of file PurgeKernels.cc.

Member Function Documentation

◆ removePackageAndCheck()

bool zypp::PurgeKernels::Impl::removePackageAndCheck ( PoolItem pi,
const str::regex validRemovals 
) 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 75 of file PurgeKernels.cc.

◆ parseKeepSpec()

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

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

Definition at line 116 of file PurgeKernels.cc.

◆ fillKeepList()

void zypp::PurgeKernels::Impl::fillKeepList ( const std::unordered_map< std::string, std::map< Arch, std::map< Edition, sat::Solvable > > > &  installedKernels,
std::set< sat::Solvable::IdType > &  list 
) const

Go over the list of installed kernels and mark those as "do not remove" that match a entry in the keep spec

Definition at line 180 of file PurgeKernels.cc.

◆ cleanDevelAndSrcPackages()

void zypp::PurgeKernels::Impl::cleanDevelAndSrcPackages ( const str::regex validRemovals,
std::set< Edition > &  validEditions,
const std::string &  flavour = std::string() 
)

This cleans up the source and devel packages tree for a specific flavour.

Definition at line 207 of file PurgeKernels.cc.

◆ detectRunningKernel()

static std::string zypp::PurgeKernels::Impl::detectRunningKernel ( )
inlinestatic

Definition at line 50 of file PurgeKernels.cc.

Member Data Documentation

◆ _keepLatestOffsets

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

Definition at line 62 of file PurgeKernels.cc.

◆ _keepOldestOffsets

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

Definition at line 63 of file PurgeKernels.cc.

◆ _keepSpecificEditions

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

Definition at line 64 of file PurgeKernels.cc.

◆ _uname_r

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

Definition at line 65 of file PurgeKernels.cc.

◆ _kernelArch

Arch zypp::PurgeKernels::Impl::_kernelArch

Definition at line 66 of file PurgeKernels.cc.

◆ _keepSpec

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

Definition at line 67 of file PurgeKernels.cc.

◆ _keepRunning

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

Definition at line 68 of file PurgeKernels.cc.


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