16 #include <zypp-core/APIConfig.h> 19 #include <zypp-core/base/InputStream> 27 #include <zypp-core/parser/EconfDict> 32 #include <zypp-media/MediaConfig> 38 #undef ZYPP_BASE_LOGGER_LOGGROUP 39 #define ZYPP_BASE_LOGGER_LOGGROUP "zconfig" 48 const char *env_confpath = getenv(
"ZYPP_CONF" );
87 Locale _autodetectTextLocale()
90 const char * envlist[] = {
"LC_ALL",
"LC_MESSAGES",
"LANG", NULL };
91 for (
const char ** envvar = envlist; *envvar; ++envvar )
93 const char * envlang = getenv( *envvar );
96 std::string envstr( envlang );
97 if ( envstr !=
"POSIX" && envstr !=
"C" )
99 Locale lang( envstr );
102 MIL <<
"Found " << *envvar <<
"=" << envstr << endl;
109 MIL <<
"Default text locale is '" << ret <<
"'" << endl;
110 #warning HACK AROUND BOOST_TEST_CATCH_SYSTEM_ERRORS 111 setenv(
"BOOST_TEST_CATCH_SYSTEM_ERRORS",
"no", 1 );
125 struct ZyppConfIniMap :
public IniDict {
126 ZyppConfIniMap(
Pathname root_r =
"/" )
127 :
IniDict { iniMapReadFrom(root_r) }
137 pMIL(
"Reading zypp.conf for root", root_r );
143 if ( conf.isFile() ) {
144 pMIL(
"$ZYPP_CONF requests reading file", conf );
145 return parser::IniDict( conf.path() );
147 pMIL(
"$ZYPP_CONF denotes no file below root. Using builtin defaults." );
148 return parser::IniDict();
152 return parser::EconfDict(
"/zypp/zypp.conf", root_r );
169 : _val(
std::move(initial_r) )
173 {
set( std::move(newval_r) );
return *
this; }
185 { _val = std::move(newval_r); }
200 , _default(
std::move(initial_r) )
204 { this->
set( std::move(newval_r) );
return *
this; }
208 { this->
set( _default.get() ); }
212 { setDefault( std::move(newval_r) ); restoreToDefault(); }
216 {
return _default.get(); }
220 { _default.set( std::move(newval_r) ); }
244 , solver_onlyRequires ( false )
245 , solver_allowVendorChange ( false )
246 , solver_dupAllowDowngrade ( true )
247 , solver_dupAllowNameChange ( true )
248 , solver_dupAllowArchChange ( true )
249 , solver_dupAllowVendorChange ( false )
250 , solver_cleandepsOnRemove ( false )
251 , solver_noUpdateProvide ( false )
252 , solver_upgradeTestcasesToKeep ( 2 )
253 , solverUpgradeRemoveDroppedPackages ( true )
256 bool consume(
const std::string & section,
const std::string & entry,
const std::string & value )
258 if ( section !=
"main" )
261 if ( entry ==
"solver.focus" )
265 else if ( entry ==
"solver.onlyRequires" )
267 solver_onlyRequires.set(
str::strToBool( value, solver_onlyRequires ) );
269 else if ( entry ==
"solver.allowVendorChange" )
271 solver_allowVendorChange.set(
str::strToBool( value, solver_allowVendorChange ) );
273 else if ( entry ==
"solver.dupAllowDowngrade" )
275 solver_dupAllowDowngrade.set(
str::strToBool( value, solver_dupAllowDowngrade ) );
277 else if ( entry ==
"solver.dupAllowNameChange" )
279 solver_dupAllowNameChange.set(
str::strToBool( value, solver_dupAllowNameChange ) );
281 else if ( entry ==
"solver.dupAllowArchChange" )
283 solver_dupAllowArchChange.set(
str::strToBool( value, solver_dupAllowArchChange ) );
285 else if ( entry ==
"solver.dupAllowVendorChange" )
287 solver_dupAllowVendorChange.set(
str::strToBool( value, solver_dupAllowVendorChange ) );
289 else if ( entry ==
"solver.cleandepsOnRemove" )
291 solver_cleandepsOnRemove.set(
str::strToBool( value, solver_cleandepsOnRemove ) );
293 else if ( entry ==
"solver.noUpdateProvide" )
295 solver_noUpdateProvide.set(
str::strToBool( value, solver_noUpdateProvide ) );
297 else if ( entry ==
"solver.upgradeTestcasesToKeep" )
299 solver_upgradeTestcasesToKeep.set( str::strtonum<unsigned>( value ) );
301 else if ( entry ==
"solver.upgradeRemoveDroppedPackages" )
303 solverUpgradeRemoveDroppedPackages.restoreToDefault(
str::strToBool( value, solverUpgradeRemoveDroppedPackages.getDefault() ) );
326 : cfg_arch ( defaultSystemArchitecture() )
327 , cfg_textLocale ( defaultTextLocale() )
328 , cfg_cache_path {
"/var/cache/zypp" }
329 , cfg_metadata_path {
"" }
330 , cfg_solvfiles_path {
"" }
331 , cfg_packages_path {
"" }
332 , updateMessagesNotify (
"" )
333 , repo_add_probe (
false )
334 , repo_refresh_delay ( 10 )
335 , repoLabelIsAlias (
false )
336 , download_use_deltarpm ( APIConfig(LIBZYPP_CONFIG_USE_DELTARPM_BY_DEFAULT) )
337 , download_use_deltarpm_always (
false )
338 , download_media_prefer_download(
true )
339 , download_mediaMountdir (
"/var/adm/mount" )
342 , repoGpgCheck ( indeterminate )
343 , pkgGpgCheck ( indeterminate )
344 , apply_locks_file (
true )
345 , pluginsPath (
"/usr/lib/zypp/plugins" )
346 , geoipEnabled (
true )
347 , geoipHosts {
"download.opensuse.org" }
349 MIL <<
"libzypp: " LIBZYPP_VERSION_STRING <<
" (" << LIBZYPP_CODESTREAM <<
")" << endl;
351 ZyppConfIniMap iniMap;
353 using EnvMap = std::map<std::string,std::string>;
354 std::optional<EnvMap> envMap;
355 for (
const auto & section : iniMap.sections() ) {
356 for (
const auto & [entry,value] : iniMap.entries( section ) ) {
358 if ( _initialTargetDefaults.consume( section, entry, value ) )
361 if ( _mediaConf.setConfigValue( section, entry, value ) )
364 if ( section ==
"main" )
366 if ( entry ==
"lock_timeout" )
370 else if ( entry ==
"arch" )
373 if ( carch != cfg_arch ) {
374 WAR <<
"Overriding system architecture (" << cfg_arch <<
"): " << carch << endl;
378 else if ( entry ==
"cachedir" )
380 cfg_cache_path.restoreToDefault( value );
382 else if ( entry ==
"metadatadir" )
384 cfg_metadata_path.restoreToDefault( value );
386 else if ( entry ==
"solvfilesdir" )
388 cfg_solvfiles_path.restoreToDefault( value );
390 else if ( entry ==
"packagesdir" )
392 cfg_packages_path.restoreToDefault( value );
394 else if ( entry ==
"configdir" )
398 else if ( entry ==
"reposdir" )
400 cfg_known_repos_path =
Pathname(value);
402 else if ( entry ==
"servicesdir" )
404 cfg_known_services_path =
Pathname(value);
406 else if ( entry ==
"varsdir" )
410 else if ( entry ==
"repo.add.probe" )
414 else if ( entry ==
"repo.refresh.delay" )
418 else if ( entry ==
"repo.refresh.locales" )
420 std::vector<std::string> tmp;
421 str::split( value, back_inserter( tmp ),
", \t" );
423 boost::function<Locale(const std::string &)>
transform(
424 [](
const std::string & str_r)->Locale{
return Locale(str_r); }
426 repoRefreshLocales.insert( make_transform_iterator( tmp.begin(),
transform ),
427 make_transform_iterator( tmp.end(),
transform ) );
429 else if ( entry ==
"download.use_deltarpm" )
431 download_use_deltarpm =
str::strToBool( value, download_use_deltarpm );
433 else if ( entry ==
"download.use_deltarpm.always" )
435 download_use_deltarpm_always =
str::strToBool( value, download_use_deltarpm_always );
437 else if ( entry ==
"download.media_preference" )
439 download_media_prefer_download.restoreToDefault(
str::compareCI( value,
"volatile" ) != 0 );
441 else if ( entry ==
"download.media_mountdir" )
443 download_mediaMountdir.restoreToDefault(
Pathname(value) );
445 else if ( entry ==
"download.use_geoip_mirror") {
448 else if ( entry ==
"commit.downloadMode" )
452 else if ( entry ==
"gpgcheck" )
456 else if ( entry ==
"repo_gpgcheck" )
460 else if ( entry ==
"pkg_gpgcheck" )
464 else if ( entry ==
"vendordir" )
468 else if ( entry ==
"multiversiondir" )
470 cfg_multiversion_path =
Pathname(value);
472 else if ( entry ==
"multiversion.kernels" )
474 cfg_kernel_keep_spec = value;
476 else if ( entry ==
"solver.checkSystemFile" )
478 solver_checkSystemFile =
Pathname(value);
480 else if ( entry ==
"solver.checkSystemFileDir" )
482 solver_checkSystemFileDir =
Pathname(value);
484 else if ( entry ==
"multiversion" )
486 MultiversionSpec & defSpec( _multiversionMap.getDefaultSpec() );
489 else if ( entry ==
"locksfile.path" )
493 else if ( entry ==
"locksfile.apply" )
497 else if ( entry ==
"update.datadir" )
502 else if ( entry ==
"update.scriptsdir" )
507 else if ( entry ==
"update.messagessdir" )
512 else if ( entry ==
"update.messages.notify" )
514 updateMessagesNotify.set( value );
516 else if ( entry ==
"rpm.install.excludedocs" )
521 else if ( entry ==
"history.logfile" )
525 else if ( entry ==
"ZYPP_SINGLE_RPMTRANS" || entry ==
"techpreview.ZYPP_SINGLE_RPMTRANS" )
527 DBG <<
"ZYPP_SINGLE_RPMTRANS=" << value << endl;
528 ::setenv(
"ZYPP_SINGLE_RPMTRANS", value.c_str(), 0 );
530 else if ( entry ==
"techpreview.ZYPP_MEDIANETWORK" )
532 DBG <<
"techpreview.ZYPP_MEDIANETWORK=" << value << endl;
533 ::setenv(
"ZYPP_MEDIANETWORK", value.c_str(), 1 );
536 pWAR(
"zypp.conf: Unknown entry in [main]:", entry,
"=", value );
539 else if ( section ==
"env" )
543 auto [it, inserted] = envMap->emplace( entry, value );
545 WAR <<
"zypp.conf [env]: duplicate key '" << entry <<
"', shadowing previous value '" << it->second <<
"' with '" << value <<
"'" << endl;
550 pWAR(
"zypp.conf: Unknown section:",
str::sconcat(
"[",section,
"]"), entry,
"=", value );
556 for (
const auto & [entry, value] : *envMap ) {
557 const char* exists = ::getenv( entry.c_str() );
558 if ( exists ==
nullptr ) {
559 if ( ::setenv( entry.c_str(), value.c_str(), 0 ) != 0 ) {
560 pWAR(
"zypp.conf [env]: set",
str::sconcat(
"'",entry,
"=",value,
"'"),
": failed", Errno() );
573 if ( getenv(
"ZYPP_TESTSUITE_FAKE_ARCH" ) )
575 Arch carch( getenv(
"ZYPP_TESTSUITE_FAKE_ARCH" ) );
576 if ( carch != cfg_arch )
578 WAR <<
"ZYPP_TESTSUITE_FAKE_ARCH: Overriding system architecture (" << cfg_arch <<
"): " << carch << endl;
582 MIL <<
"ZConfig singleton created." << endl;
587 Impl &operator=(
const Impl &) =
delete;
601 return target ? target->root() : _announced_root_path;
608 Pathname newRoot { _autodetectSystemRoot() };
609 MIL <<
"notifyTargetChanged (" << newRoot <<
")" << endl;
611 if ( newRoot.emptyOrRoot() ) {
612 _currentTargetDefaults.reset();
616 ZyppConfIniMap iniMap { newRoot };
617 for (
const auto & section : iniMap.sections() ) {
618 for (
const auto & [entry,value] : iniMap.entries( section ) ) {
619 (*_currentTargetDefaults).consume( section, entry, value );
628 long cfg_lockTimeout = 0;
706 using SpecMap = std::map<Pathname, MultiversionSpec>;
714 if ( root_r.
empty() )
716 bool cacheHit = _specMap.count( root_r );
726 if ( root_r ==
"/" || not scanConfAt( root_r, ret, zConfImpl_r ) )
728 scanDirAt( root_r, ret, zConfImpl_r );
729 using zypp::operator<<;
730 MIL <<
"MultiversionSpec '" << root_r <<
"' = " << ret << endl;
741 ZyppConfIniMap iniMap { root_r };
743 for (
const auto & section : iniMap.sections() ) {
744 for (
const auto & [entry,value] : iniMap.entries( section ) ) {
745 if ( entry ==
"multiversion" ) {
758 if ( multiversionDir.
empty() )
764 [&spec_r](
const Pathname & dir_r,
const char *
const & name_r )->
bool 766 MIL <<
"Parsing " << dir_r/name_r << endl;
768 [&spec_r](
int num_r, std::string line_r )->
bool 770 DBG <<
" found " << line_r << endl;
771 spec_r.insert( std::move(line_r) );
783 {
return _multiversionMap.getSpec( _autodetectSystemRoot(), *
this ); }
821 const char *
env = getenv(
"ZYPP_LOCK_TIMEOUT");
823 return str::strtonum<long>(
env );
825 return _pimpl->cfg_lockTimeout;
829 {
return _pimpl->notifyTargetChanged(); }
832 {
return _pimpl->_autodetectSystemRoot(); }
836 return (
_pimpl->cfg_repo_mgr_root_path.empty()
841 {
_pimpl->cfg_repo_mgr_root_path = root; }
844 {
_pimpl->_announced_root_path = root_r; }
858 {
return _pimpl->cfg_arch; }
862 if ( arch_r !=
_pimpl->cfg_arch )
864 WAR <<
"Overriding system architecture (" <<
_pimpl->cfg_arch <<
"): " << arch_r << endl;
865 _pimpl->cfg_arch = arch_r;
877 static Locale _val( _autodetectTextLocale() );
882 {
return _pimpl->cfg_textLocale; }
886 if ( locale_r !=
_pimpl->cfg_textLocale )
888 WAR <<
"Overriding text locale (" <<
_pimpl->cfg_textLocale <<
"): " << locale_r << endl;
889 _pimpl->cfg_textLocale = locale_r;
900 {
return !
_pimpl->userData.empty(); }
903 {
return _pimpl->userData; }
907 for_( ch, str_r.begin(), str_r.end() )
909 if ( *ch <
' ' && *ch !=
'\t' )
911 ERR <<
"New user data string rejectded: char " << (int)*ch <<
" at position " << (ch - str_r.begin()) << endl;
915 MIL <<
"Set user data string to '" << str_r <<
"'" << endl;
924 return (
_pimpl->cfg_cache_path.get().empty()
935 _pimpl->cfg_cache_path = path_r;
940 return (
_pimpl->cfg_metadata_path.get().empty()
946 _pimpl->cfg_metadata_path = path_r;
951 return (
_pimpl->cfg_solvfiles_path.get().empty()
957 _pimpl->cfg_solvfiles_path = path_r;
962 return (
_pimpl->cfg_packages_path.get().empty()
968 _pimpl->cfg_packages_path = path_r;
972 {
return _pimpl->cfg_cache_path.getDefault().empty() ?
Pathname(
"/var/cache/zypp") :
_pimpl->cfg_cache_path.getDefault(); }
987 return (
_pimpl->cfg_config_path.empty()
993 return (
_pimpl->cfg_known_repos_path.empty()
999 return (
_pimpl->cfg_known_services_path.empty()
1010 {
_pimpl->geoipEnabled = enable; }
1013 {
return _pimpl->geoipEnabled; }
1019 {
return _pimpl->geoipHosts; }
1023 return (
_pimpl->cfg_vars_path.empty()
1029 return (
_pimpl->cfg_vendor_path.empty()
1035 return (
_pimpl->locks_file.empty()
1042 {
return _pimpl->repo_add_probe; }
1045 {
return _pimpl->repo_refresh_delay; }
1051 {
return _pimpl->repoLabelIsAlias; }
1054 {
_pimpl->repoLabelIsAlias = yesno_r; }
1057 {
return _pimpl->download_use_deltarpm; }
1063 {
return _pimpl->download_media_prefer_download; }
1066 {
_pimpl->download_media_prefer_download.set( yesno_r ); }
1069 {
_pimpl->download_media_prefer_download.restoreToDefault(); }
1072 {
return _pimpl->_mediaConf.download_max_concurrent_connections(); }
1075 {
return _pimpl->_mediaConf.download_min_download_speed(); }
1078 {
return _pimpl->_mediaConf.download_min_download_speed_time(); }
1081 {
return _pimpl->_mediaConf.download_max_download_speed(); }
1084 {
return _pimpl->_mediaConf.download_max_silent_tries(); }
1087 {
return _pimpl->_mediaConf.download_transfer_timeout(); }
1094 {
return _pimpl->commit_downloadMode; }
1127 {
return (
_pimpl->solver_checkSystemFile.empty()
1131 {
return (
_pimpl->solver_checkSystemFileDir.empty()
1137 inline void sigMultiversionSpecChanged()
1151 {
return _pimpl->apply_locks_file; }
1166 return Pathname(update_dataPath()/
"update-messages");
1174 return Pathname(update_dataPath()/
"update-scripts");
1178 {
return _pimpl->updateMessagesNotify; }
1181 {
_pimpl->updateMessagesNotify.set( val_r ); }
1184 {
_pimpl->updateMessagesNotify.restoreToDefault(); }
1189 {
return _pimpl->rpmInstallFlags; }
1194 return (
_pimpl->history_log_path.empty() ?
1200 return _pimpl->_mediaConf.credentialsGlobalDir();
1205 return _pimpl->_mediaConf.credentialsGlobalFile();
1211 {
return "system-release"; }
1216 {
return _pimpl->pluginsPath.get(); }
1220 return _pimpl->cfg_kernel_keep_spec;
1227 str <<
"libzypp: " LIBZYPP_VERSION_STRING <<
" (" << LIBZYPP_CODESTREAM <<
")" << endl;
1229 str <<
"libsolv: " << solv_version;
1230 if ( ::strcmp( solv_version, LIBSOLV_VERSION_STRING ) )
1231 str <<
" (built against " << LIBSOLV_VERSION_STRING <<
")";
std::set< std::string > MultiversionSpec
void setDefault(value_type newval_r)
Set a new default value.
bool hasUserData() const
Whether a (non empty) user data sting is defined.
Option< bool > solver_dupAllowDowngrade
static Locale defaultTextLocale()
The autodetected preferred locale for translated texts.
Pathname repoSolvfilesPath() const
Path where the repo solv files are created and kept (repoCachePath()/solv).
Pathname credentialsGlobalDir() const
Defaults to /etc/zypp/credentials.d.
Pathname builtinRepoPackagesPath() const
The builtin config file value.
Pathname cfg_known_repos_path
void setGeoipEnabled(bool enable=true)
Enables or disables the use of the geoip feature of download.opensuse.org.
void setGpgCheck(bool val_r)
Change the value.
long download_min_download_speed_time() const
The time in seconds that the transfer speed must remain below download_min_download_speed before the ...
std::ostream & about(std::ostream &str) const
Print some detail about the current libzypp version.
bool download_use_deltarpm_always() const
Whether to consider using a deltarpm even when rpm is local.
Namespace intended to collect all environment variables we use.
void setUpdateMessagesNotify(const std::string &val_r)
Set a new command definition (see update.messages.notify in zypp.conf).
void setRepoGpgCheck(TriBool val_r)
Change the value.
Pathname knownReposPath() const
Path where the known repositories .repo files are kept (configPath()/repos.d).
long download_transfer_timeout() const
Maximum time in seconds that you allow a transfer operation to take.
unsigned splitEscaped(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \, bool withEmpty=false)
Split line_r into words with respect to escape delimeters.
Pathname cfg_known_services_path
static ZConfig & instance()
Singleton ctor.
long download_max_download_speed() const
Maximum download speed (bytes per second)
static Pathname update_messagesPath()
Path where the update messages are stored ( /var/adm/update-messages )
MultiversionSpec & multiversion()
static const Locale enCode
Last resort "en".
Locale textLocale() const
The locale for translated texts zypp uses.
bool repoLabelIsAlias() const
Whether to use repository alias or name in user messages (progress, exceptions, ...).
void setTextLocale(const Locale &locale_r)
Set the default language for retrieving translated texts.
bool download_use_deltarpm
void setRepoPackagesPath(const Pathname &path_r)
Set a new path as the default repo cache path.
Pathname varsPath() const
Path containing custom repo variable definitions (configPath()/vars.d).
ResolverFocus
The resolver's general attitude.
Pathname pubkeyCachePath() const
Path where the pubkey caches.
std::unordered_set< Locale > LocaleSet
LocaleSet repoRefreshLocales
Pathname builtinRepoMetadataPath() const
The builtin config file value.
Option< bool > solver_onlyRequires
int dirForEach(const Pathname &dir_r, const StrMatcher &matcher_r, function< bool(const Pathname &, const char *const)> fnc_r)
DefaultOption< Pathname > cfg_metadata_path
static Arch detectSystemArchitecture()
Determine system architecture evaluating uname and /proc/cpuinfo.
bool repo_add_probe() const
Whether repository urls should be probed.
void restoreToDefault()
Reset value to the current default.
String related utilities and Regular expression matching.
void removeMultiversionSpec(const std::string &name_r)
bool geoipEnabled() const
Returns true if zypp should use the geoip feature of download.opensuse.org.
void setSystemArchitecture(const Arch &arch_r)
Override the zypp system architecture.
unsigned solver_upgradeTestcasesToKeep() const
When committing a dist upgrade (e.g.
Option< bool > solver_allowVendorChange
std::vector< std::string > geoipHosts
Pathname vendorPath() const
Directory for equivalent vendor definitions (configPath()/vendors.d)
target::rpm::RpmInstFlags rpmInstallFlags
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
bool setUserData(const std::string &str_r)
Set a new userData string.
std::string cfg_kernel_keep_spec
Request the standard behavior (as defined in zypp.conf or 'Job')
void set_download_mediaMountdir(Pathname newval_r)
Set alternate value.
bool solver_dupAllowArchChange() const
DUP tune: Whether to allow package arch changes upon DUP.
MultiversionSpec & getDefaultSpec()
void resetSolverUpgradeRemoveDroppedPackages()
Reset solverUpgradeRemoveDroppedPackages to the zypp.conf default.
std::string userData() const
User defined string value to be passed to log, history, plugins...
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
Pointer to implementation.
const std::set< std::string > & multiversionSpec() const
void set_default_download_mediaMountdir()
Reset to zypp.cong default.
void addMultiversionSpec(const std::string &name_r)
void resetGpgCheck()
Reset to the zconfig default.
void set_download_media_prefer_download(bool yesno_r)
Set download_media_prefer_download to a specific value.
DefaultOption< Pathname > download_mediaMountdir
bool solverUpgradeRemoveDroppedPackages() const
Whether dist upgrade should remove a products dropped packages (true).
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
DownloadMode commit_downloadMode() const
Commit download policy to use as default.
DefaultOption< bool > download_media_prefer_download
LocaleSet repoRefreshLocales() const
List of locales for which translated package descriptions should be downloaded.
TriBool strToTriBool(const C_Str &str)
Parse str into a bool if it's a legal true or false string; else indeterminate.
Pathname download_mediaMountdir() const
Path where media are preferably mounted or downloaded.
Pathname repoManagerRoot() const
The RepoManager root directory.
MultiversionMap _multiversionMap
bool consume(const std::string §ion, const std::string &entry, const std::string &value)
DefaultOption< bool > gpgCheck
bool empty() const
Test for an empty path.
void setTextLocale(const Locale &locale_r)
Set the preferred locale for translated texts.
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \, const Trim trim_r=NO_TRIM)
Split line_r into words.
static Pool instance()
Singleton ctor.
Pathname _announced_root_path
TriBool pkgGpgCheck() const
Check rpm package signatures (indeterminate - according to gpgcheck)
Pathname solver_checkSystemFileDir() const
Directory, which may or may not contain files in which dependencies described which has to be fulfill...
std::optional< TargetDefaults > _currentTargetDefaults
TargetDefaults while –root.
void set_default_download_media_prefer_download()
Set download_media_prefer_download to the configfiles default.
Pathname solver_checkSystemFile() const
File in which dependencies described which has to be fulfilled for a running system.
LocaleSet requestedLocales() const
Languages to be supported by the system.
Pathname locksFile() const
Path where zypp can find or create lock file (configPath()/locks)
Option & operator=(value_type newval_r)
unsigned repo_refresh_delay() const
Amount of time in minutes that must pass before another refresh.
libzypp will decide what to do.
bool gpgCheck() const
Turn signature checking on/off (on)
Pathname repoCachePath() const
Path where the caches are kept (/var/cache/zypp)
Option< bool > solver_cleandepsOnRemove
bool solver_dupAllowVendorChange() const
DUP tune: Whether to allow package vendor changes upon DUP.
Option(value_type initial_r)
No default ctor, explicit initialisation!
static Pathname assertprefix(const Pathname &root_r, const Pathname &path_r)
Unless path_r does not already denote a path below root_r, combine them.
Interim helper class to collect global options and settings.
Pathname _autodetectSystemRoot() const
bsc#1237044: Provide announceSystemRoot to allow commands using –root without launching a Target...
Pathname credentialsGlobalFile() const
Defaults to /etc/zypp/credentials.cat.
bool solver_dupAllowDowngrade() const
DUP tune: Whether to allow version downgrades upon DUP.
DefaultOption< bool > solverUpgradeRemoveDroppedPackages
static Pathname update_dataPath()
Path where the update items are kept (/var/adm)
Types and functions for filesystem operations.
TriBool repoGpgCheck() const
Check repo matadata signatures (indeterminate - according to gpgcheck)
bool apply_locks_file() const
Whether locks file should be read and applied after start (true)
void restoreToDefault(value_type newval_r)
Reset value to a new default.
bool solver_dupAllowNameChange() const
DUP tune: Whether to follow package renames upon DUP.
TInt strtonum(const C_Str &str)
Parsing numbers from string.
std::string sconcat(Args &&... args)
Concat words as string.
Pathname needrebootPath() const
Path where the custom needreboot config files are kept (configPath()/needreboot.d).
void clearMultiversionSpec()
Pathname repoPackagesPath() const
Path where the repo packages are downloaded and kept (repoCachePath()/packages).
static PoolImpl & myPool()
Pathname geoipCachePath() const
Path where the geoip caches are kept (/var/cache/zypp/geoip)
long download_max_silent_tries() const
Maximum silent tries.
Mutable option with initial value also remembering a config value.
target::rpm::RpmInstFlags rpmInstallFlags() const
The default target::rpm::RpmInstFlags for ZYppCommitPolicy.
bool solver_noUpdateProvide() const
Do not prefer update candidates also providing the old package.
bool download_use_deltarpm_always
std::optional< Pathname > ZYPP_CONF()
int compareCI(const C_Str &lhs, const C_Str &rhs)
long lockTimeout() const
The number of seconds to wait for the zypp lock to become available.
static Pathname update_scriptsPath()
Path where the update scripts are stored ( /var/adm/update-scripts )
bool solver_onlyRequires() const
Solver regards required packages,patterns,...
TargetDefaults _initialTargetDefaults
Initial TargetDefaults from /.
Pathname configPath() const
Path where the configfiles are kept (/etc/zypp).
'Language[_Country]' codes.
Option< Pathname > pluginsPath
DefaultOption< Pathname > cfg_cache_path
ZYpp::Ptr getZYpp()
relates: ZYppFactory Convenience to get the Pointer to the ZYpp instance.
Parses a INI file and offers its structure as a dictionary.
DefaultOption< Pathname > cfg_packages_path
Option< bool > solver_dupAllowArchChange
Pathname builtinRepoSolvfilesPath() const
The builtin config file value.
static Arch defaultSystemArchitecture()
The autodetected system architecture.
void resetRepoGpgCheck()
Reset to the zconfig default.
ResolverFocus solver_focus() const
The resolver's general attitude when resolving jobs.
bool solver_cleandepsOnRemove() const
Whether removing a package should also remove no longer needed requirements.
DefaultOption< std::string > updateMessagesNotify
int simpleParseFile(std::istream &str_r, ParseFlags flags_r, function< bool(int, std::string)> consume_r)
Simple lineparser optionally trimming and skipping comments.
std::map< Pathname, MultiversionSpec > SpecMap
void announceSystemRoot(const Pathname &root_r)
Announce a target root directory without launching the Target.
Pathname cfg_repo_mgr_root_path
bool download_media_prefer_download() const
Hint which media to prefer when installing packages (download vs.
Pathname solver_checkSystemFile
bool fromString(const std::string &val_r, ResolverFocus &ret_r)
relates: ResolverFocus Conversion from string (enumerator name, case insensitive, empty string is Def...
Pathname needrebootFile() const
Path of the default needreboot config file (configPath()/needreboot).
Pathname historyLogFile() const
Path where ZYpp install history is logged.
Pathname history_log_path
bool strToBool(const C_Str &str, bool default_r)
Parse str into a bool depending on the default value.
std::string distroverpkg() const
Package telling the "product version" on systems not using /etc/product.d/baseproduct.
MultiversionSpec & getMultiversion() const
const TargetDefaults & targetDefaults() const
std::string multiversionKernels() const
TargetDefaults & targetDefaults()
void setRepoMetadataPath(const Pathname &path_r)
Set a new path as the default repo cache path.
DownloadMode deserializeDownloadMode(const std::string &str_r)
relates: DownloadMode Parse from string.
Wrapper class for ::stat/::lstat.
Pathname knownServicesPath() const
Path where the known services .service files are kept (configPath()/services.d).
void resetUpdateMessagesNotify()
Reset to the zypp.conf default.
Arch systemArchitecture() const
The system architecture zypp uses.
void setSolverUpgradeRemoveDroppedPackages(bool val_r)
Set solverUpgradeRemoveDroppedPackages to val_r.
DefaultOption(value_type initial_r)
bool scanConfAt(const Pathname &root_r, MultiversionSpec &spec_r, const Impl &zConfImpl_r)
std::string updateMessagesNotify() const
Command definition for sending update messages.
Pathname systemRoot() const
The target root directory.
Pathname builtinRepoCachePath() const
The builtin config file value.
Pathname solver_checkSystemFileDir
Pathname cfg_multiversion_path
Option< bool > solver_dupAllowVendorChange
void setPkgGpgCheck(TriBool val_r)
Change the value.
const value_type & getDefault() const
Get the current default value.
DefaultOption< Pathname > cfg_solvfiles_path
void notifyTargetChanged()
bool solver_allowVendorChange() const
Whether vendor check is by default enabled.
Easy-to use interface to the ZYPP dependency resolver.
void setRepoSolvfilesPath(const Pathname &path_r)
Set a new path as the default repo cache path.
DefaultOption & operator=(value_type newval_r)
ResolverFocus solver_focus
detail::Dump< Tp > dump(const Tp &obj_r)
const std::vector< std::string > geoipHostnames() const
All hostnames we want to rewrite using the geoip feature.
void notifyTargetChanged()
internal
bool download_use_deltarpm() const
Whether to consider using a deltarpm when downloading a package.
void setRepoCachePath(const Pathname &path_r)
Set a new path as the default repo cache path.
const MultiversionSpec & multiversion() const
void setRepoManagerRoot(const Pathname &root)
Sets the RepoManager root directory.
MultiversionSpec & getSpec(Pathname root_r, const Impl &zConfImpl_r)
Pathname pluginsPath() const
Defaults to /usr/lib/zypp/plugins.
DefaultOption< TriBool > repoGpgCheck
void scanDirAt(const Pathname &root_r, MultiversionSpec &spec_r, const Impl &zConfImpl_r)
Option< DownloadMode > commit_downloadMode
DefaultOption< TriBool > pkgGpgCheck
unsigned repo_refresh_delay
void resetPkgGpgCheck()
Reset to the zconfig default.
void multiversionSpecChanged()
Option< bool > solver_noUpdateProvide
Pathname repoMetadataPath() const
Path where the repo metadata is downloaded and kept (repoCachePath()/raw).
auto transform(Container< Msg, CArgs... > &&val, Transformation &&transformation)
Settings that follow a changed Target.
long download_min_download_speed() const
Minimum download speed (bytes per second) until the connection is dropped.
long download_max_concurrent_connections() const
Maximum number of concurrent connections for a single transfer.
DownloadMode
Supported commit download policies.
Option< unsigned > solver_upgradeTestcasesToKeep
Option< bool > solver_dupAllowNameChange