63 pMIL(
"getConfigFiles for stem", configStem,
"below", root_r,
"in",
_etcDir,
_usrDir );
65 std::string configSuffix { configStem.
extension() };
68 std::vector<Pathname> lookupDirs;
77 std::map<std::string,PathInfo> dropinsToParse;
79 for (
const Pathname & ldir : lookupDirs ) {
81 PathInfo basecfg { ldir / configStem };
85 PathInfo dropinDir { ldir / configDir };
86 if ( dropinDir.
isDir() ) {
88 if ( entry.name[0] ==
'.' )
90 if ( not ( configSuffix.empty() || str::hasSuffix( entry.name, configSuffix ) ) )
92 PathInfo dropin { p / entry.name };
100 std::vector<Pathname> ret;
102 for (
const auto & [
_,p] : dropinsToParse ) {
107 pMIL(
"No config files found for stem", configStem,
"below", root_r );
116 lookupDirs_r.push_back( dir_r );
127 if (
isSet( toParse_r ) ) {
128 pDBG(
"masked", file_r,
"by", toParse_r );
130 toParse_r = std::move(file_r);
138 if (
isSet( file_r ) ) {
139 pMIL(
"take", file_r );
140 ret_r.push_back( file_r.
path() );
160 pDBG( stem_r,
"below", root_r,
":", *
this );
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
Wrapper class for stat/lstat.
const Pathname & path() const
Return current Pathname.
bool isExist() const
Return whether valid stat info exists.
Pathname extend(const std::string &r) const
Append string r to the last component of the path.
bool relativeDotDot() const
Test for a relative path referring to ../.
bool emptyOrRoot() const
Test for "" or "/".
bool empty() const
Test for an empty path.
Pathname absolutename() const
Return this path, adding a leading '/' if relative.
std::string extension() const
Return all of the characters in name after and including the last dot in the last element of name.
bool relative() const
Test for a relative path.
void read(const InputStream &is, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
Fill a dictionary from a InputStream containing a ini structured file.
IniDict(const InputStream &is, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
Creates a dictionary from a InputStream containing a ini structured file.
int dirForEachExt(const Pathname &dir_r, const function< bool(const Pathname &, const DirEntry &)> &fnc_r)
Simiar to.
std::string sprint(Args &&... args)
Print words as string.
Listentry returned by readdir.
Provide access to the prioritized list of files and drop-ins to read and merge for a specific config ...
static void takeOrMask(const PathInfo &file_r, PathInfo &toParse_r)
The 1st viable file_r is stored in toParse_r; candidates found later are masked.
std::vector< Pathname > getConfigFiles(const std::string &stem_r, const Pathname &root_r=Pathname("/")) const
static void handOutIf(std::vector< Pathname > &ret_r, const PathInfo &file_r)
Store set values in ret_r.
static void takeLookupDirIf(std::vector< Pathname > &lookupDirs_r, Pathname dir_r)
Remember valid lookup dirs.
std::optional< Pathname > _etcDir
system configuration: /etc
const std::optional< Pathname > & usrDir() const
static bool isSet(const PathInfo &file_r)
An empty path denotes the unset value.
ConfigurationContext(std::optional< Pathname > etcDir_r, std::optional< Pathname > usrDir_r)
const std::optional< Pathname > & etcDir() const
std::optional< Pathname > _usrDir
vendor configuration: distconfdir (/usr/etc)