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" )
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) }
135 IniDict iniMapReadFrom(
const Pathname & root_r )
137 pMIL(
"Reading zypp.conf for root", root_r );
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 );
173 {
set( std::move(newval_r) );
return *
this; }
185 {
_val = std::move(newval_r); }
204 { this->
set( std::move(newval_r) );
return *
this; }
220 {
_default.set( std::move(newval_r) ); }
255 bool consume(
const std::string & section,
const std::string & entry,
const std::string & value )
257 if ( section !=
"main" )
260 if ( entry ==
"solver.focus" )
264 else if ( entry ==
"solver.onlyRequires" )
268 else if ( entry ==
"solver.allowVendorChange" )
272 else if ( entry ==
"solver.dupAllowDowngrade" )
276 else if ( entry ==
"solver.dupAllowNameChange" )
280 else if ( entry ==
"solver.dupAllowArchChange" )
284 else if ( entry ==
"solver.dupAllowVendorChange" )
288 else if ( entry ==
"solver.cleandepsOnRemove" )
292 else if ( entry ==
"solver.upgradeTestcasesToKeep" )
296 else if ( entry ==
"solver.upgradeRemoveDroppedPackages" )
343 MIL <<
"libzypp: " LIBZYPP_VERSION_STRING <<
" (" << LIBZYPP_CODESTREAM <<
")" << endl;
345 ZyppConfIniMap iniMap;
347 using EnvMap = std::map<std::string,std::string>;
348 std::optional<EnvMap> envMap;
349 for (
const auto & section : iniMap.sections() ) {
350 for ( const auto & [entry,value] : iniMap.entries( section ) ) {
352 if ( _initialTargetDefaults.consume( section, entry, value ) )
355 if ( _mediaConf.setConfigValue( section, entry, value ) )
358 if ( section ==
"main" )
360 if ( entry ==
"lock_timeout" )
362 str::strtonum( value, cfg_lockTimeout );
364 else if ( entry ==
"arch" )
367 if ( carch != cfg_arch ) {
368 WAR <<
"Overriding system architecture (" << cfg_arch <<
"): " << carch << endl;
372 else if ( entry ==
"cachedir" )
374 cfg_cache_path.restoreToDefault( value );
376 else if ( entry ==
"metadatadir" )
378 cfg_metadata_path.restoreToDefault( value );
380 else if ( entry ==
"solvfilesdir" )
382 cfg_solvfiles_path.restoreToDefault( value );
384 else if ( entry ==
"packagesdir" )
386 cfg_packages_path.restoreToDefault( value );
388 else if ( entry ==
"configdir" )
390 cfg_config_path = Pathname(value);
392 else if ( entry ==
"reposdir" )
394 cfg_known_repos_path = Pathname(value);
396 else if ( entry ==
"servicesdir" )
398 cfg_known_services_path = Pathname(value);
400 else if ( entry ==
"varsdir" )
402 cfg_vars_path = Pathname(value);
404 else if ( entry ==
"repo.add.probe" )
406 repo_add_probe = str::strToBool( value, repo_add_probe );
408 else if ( entry ==
"repo.refresh.delay" )
410 str::strtonum(value, repo_refresh_delay);
412 else if ( entry ==
"repo.refresh.locales" )
414 std::vector<std::string> tmp;
415 str::split( value, back_inserter( tmp ),
", \t" );
417 boost::function<Locale(const std::string &)> transform(
418 [](const std::string & str_r)->Locale{ return Locale(str_r); }
420 repoRefreshLocales.insert( make_transform_iterator( tmp.begin(), transform ),
421 make_transform_iterator( tmp.end(), transform ) );
423 else if ( entry ==
"download.use_deltarpm" )
425 download_use_deltarpm = str::strToBool( value, download_use_deltarpm );
427 else if ( entry ==
"download.use_deltarpm.always" )
429 download_use_deltarpm_always = str::strToBool( value, download_use_deltarpm_always );
431 else if ( entry ==
"download.media_preference" )
433 download_media_prefer_download.restoreToDefault( str::compareCI( value,
"volatile" ) != 0 );
435 else if ( entry ==
"download.media_mountdir" )
437 download_mediaMountdir.restoreToDefault( Pathname(value) );
439 else if ( entry ==
"download.use_geoip_mirror") {
440 geoipEnabled = str::strToBool( value, geoipEnabled );
442 else if ( entry ==
"commit.downloadMode" )
444 commit_downloadMode.set( deserializeDownloadMode( value ) );
446 else if ( entry ==
"gpgcheck" )
448 gpgCheck.restoreToDefault( str::strToBool( value, gpgCheck ) );
450 else if ( entry ==
"repo_gpgcheck" )
452 repoGpgCheck.restoreToDefault( str::strToTriBool( value ) );
454 else if ( entry ==
"pkg_gpgcheck" )
456 pkgGpgCheck.restoreToDefault( str::strToTriBool( value ) );
458 else if ( entry ==
"vendordir" )
460 cfg_vendor_path = Pathname(value);
462 else if ( entry ==
"multiversiondir" )
464 cfg_multiversion_path = Pathname(value);
466 else if ( entry ==
"multiversion.kernels" )
468 cfg_kernel_keep_spec = value;
470 else if ( entry ==
"solver.checkSystemFile" )
472 solver_checkSystemFile = Pathname(value);
474 else if ( entry ==
"solver.checkSystemFileDir" )
476 solver_checkSystemFileDir = Pathname(value);
478 else if ( entry ==
"multiversion" )
480 MultiversionSpec & defSpec( _multiversionMap.getDefaultSpec() );
481 str::splitEscaped( value, std::inserter( defSpec, defSpec.end() ),
", \t" );
483 else if ( entry ==
"locksfile.path" )
485 locks_file = Pathname(value);
487 else if ( entry ==
"locksfile.apply" )
489 apply_locks_file = str::strToBool( value, apply_locks_file );
491 else if ( entry ==
"update.datadir" )
496 else if ( entry ==
"update.scriptsdir" )
501 else if ( entry ==
"update.messagessdir" )
506 else if ( entry ==
"update.messages.notify" )
508 updateMessagesNotify.set( value );
510 else if ( entry ==
"rpm.install.excludedocs" )
512 rpmInstallFlags.setFlag( target::rpm::RPMINST_EXCLUDEDOCS,
513 str::strToBool( value, false ) );
515 else if ( entry ==
"history.logfile" )
517 history_log_path = Pathname(value);
519 else if ( entry ==
"ZYPP_SINGLE_RPMTRANS" || entry ==
"techpreview.ZYPP_SINGLE_RPMTRANS" )
521 DBG <<
"ZYPP_SINGLE_RPMTRANS=" << value << endl;
522 ::setenv(
"ZYPP_SINGLE_RPMTRANS", value.c_str(), 0 );
524 else if ( entry ==
"techpreview.ZYPP_MEDIANETWORK" )
526 DBG <<
"techpreview.ZYPP_MEDIANETWORK=" << value << endl;
527 ::setenv(
"ZYPP_MEDIANETWORK", value.c_str(), 1 );
530 pWAR(
"zypp.conf: Unknown entry in [main]:", entry,
"=", value );
533 else if ( section ==
"env" )
537 auto [it, inserted] = envMap->emplace( entry, value );
539 WAR <<
"zypp.conf [env]: duplicate key '" << entry <<
"', shadowing previous value '" << it->second <<
"' with '" << value <<
"'" << endl;
544 pWAR(
"zypp.conf: Unknown section:", str::sconcat(
"[",section,
"]"), entry,
"=", value );
550 for (
const auto & [entry, value] : *envMap ) {
551 const char* exists = ::getenv( entry.c_str() );
552 if ( exists ==
nullptr ) {
553 if ( ::setenv( entry.c_str(), value.c_str(), 0 ) != 0 ) {
567 if ( getenv(
"ZYPP_TESTSUITE_FAKE_ARCH" ) )
569 Arch carch( getenv(
"ZYPP_TESTSUITE_FAKE_ARCH" ) );
572 WAR <<
"ZYPP_TESTSUITE_FAKE_ARCH: Overriding system architecture (" <<
cfg_arch <<
"): " << carch << endl;
576 MIL <<
"ZConfig singleton created." << endl;
603 MIL <<
"notifyTargetChanged (" << newRoot <<
")" << endl;
610 ZyppConfIniMap iniMap { newRoot };
611 for (
const auto & section : iniMap.sections() ) {
612 for (
const auto & [entry,value] : iniMap.entries( section ) ) {
613 (*_currentTargetDefaults).consume( section, entry, value );
700 using SpecMap = std::map<Pathname, MultiversionSpec>;
708 if ( root_r.
empty() )
710 bool cacheHit =
_specMap.count( root_r );
720 if ( root_r ==
"/" || not
scanConfAt( root_r, ret, zConfImpl_r ) )
723 using zypp::operator<<;
724 MIL <<
"MultiversionSpec '" << root_r <<
"' = " << ret << endl;
735 ZyppConfIniMap iniMap { root_r };
737 for (
const auto & section : iniMap.sections() ) {
738 for (
const auto & [entry,value] : iniMap.entries( section ) ) {
739 if ( entry ==
"multiversion" ) {
752 if ( multiversionDir.
empty() )
758 [&spec_r](
const Pathname & dir_r,
const char *
const & name_r )->
bool
760 MIL <<
"Parsing " << dir_r/name_r << endl;
762 [&spec_r](
int num_r, std::string line_r )->
bool
764 DBG <<
" found " << line_r << endl;
765 spec_r.insert( std::move(line_r) );
815 const char *
env = getenv(
"ZYPP_LOCK_TIMEOUT");
819 return _pimpl->cfg_lockTimeout;
823 {
return _pimpl->notifyTargetChanged(); }
826 {
return _pimpl->_autodetectSystemRoot(); }
830 return (
_pimpl->cfg_repo_mgr_root_path.empty()
835 {
_pimpl->cfg_repo_mgr_root_path = root; }
838 {
_pimpl->_announced_root_path = root_r; }
852 {
return _pimpl->cfg_arch; }
856 if ( arch_r !=
_pimpl->cfg_arch )
858 WAR <<
"Overriding system architecture (" <<
_pimpl->cfg_arch <<
"): " << arch_r << endl;
859 _pimpl->cfg_arch = arch_r;
871 static Locale _val( _autodetectTextLocale() );
876 {
return _pimpl->cfg_textLocale; }
880 if ( locale_r !=
_pimpl->cfg_textLocale )
882 WAR <<
"Overriding text locale (" <<
_pimpl->cfg_textLocale <<
"): " << locale_r << endl;
883 _pimpl->cfg_textLocale = locale_r;
894 {
return !
_pimpl->userData.empty(); }
897 {
return _pimpl->userData; }
901 for_( ch, str_r.begin(), str_r.end() )
903 if ( *ch <
' ' && *ch !=
'\t' )
905 ERR <<
"New user data string rejectded: char " << (int)*ch <<
" at position " << (ch - str_r.begin()) << endl;
909 MIL <<
"Set user data string to '" << str_r <<
"'" << endl;
918 return (
_pimpl->cfg_cache_path.get().empty()
929 _pimpl->cfg_cache_path = path_r;
934 return (
_pimpl->cfg_metadata_path.get().empty()
940 _pimpl->cfg_metadata_path = path_r;
945 return (
_pimpl->cfg_solvfiles_path.get().empty()
951 _pimpl->cfg_solvfiles_path = path_r;
956 return (
_pimpl->cfg_packages_path.get().empty()
962 _pimpl->cfg_packages_path = path_r;
966 {
return _pimpl->cfg_cache_path.getDefault().empty() ?
Pathname(
"/var/cache/zypp") :
_pimpl->cfg_cache_path.getDefault(); }
981 return (
_pimpl->cfg_config_path.empty()
987 return (
_pimpl->cfg_known_repos_path.empty()
993 return (
_pimpl->cfg_known_services_path.empty()
1004 {
_pimpl->geoipEnabled = enable; }
1007 {
return _pimpl->geoipEnabled; }
1013 {
return _pimpl->geoipHosts; }
1017 return (
_pimpl->cfg_vars_path.empty()
1023 return (
_pimpl->cfg_vendor_path.empty()
1029 return (
_pimpl->locks_file.empty()
1036 {
return _pimpl->repo_add_probe; }
1039 {
return _pimpl->repo_refresh_delay; }
1045 {
return _pimpl->repoLabelIsAlias; }
1048 {
_pimpl->repoLabelIsAlias = yesno_r; }
1051 {
return _pimpl->download_use_deltarpm; }
1057 {
return _pimpl->download_media_prefer_download; }
1060 {
_pimpl->download_media_prefer_download.set( yesno_r ); }
1063 {
_pimpl->download_media_prefer_download.restoreToDefault(); }
1066 {
return _pimpl->_mediaConf.download_max_concurrent_connections(); }
1069 {
return _pimpl->_mediaConf.download_min_download_speed(); }
1072 {
return _pimpl->_mediaConf.download_max_download_speed(); }
1075 {
return _pimpl->_mediaConf.download_max_silent_tries(); }
1078 {
return _pimpl->_mediaConf.download_transfer_timeout(); }
1085 {
return _pimpl->commit_downloadMode; }
1117 {
return (
_pimpl->solver_checkSystemFile.empty()
1121 {
return (
_pimpl->solver_checkSystemFileDir.empty()
1127 inline void sigMultiversionSpecChanged()
1141 {
return _pimpl->apply_locks_file; }
1168 {
return _pimpl->updateMessagesNotify; }
1171 {
_pimpl->updateMessagesNotify.set( val_r ); }
1174 {
_pimpl->updateMessagesNotify.restoreToDefault(); }
1179 {
return _pimpl->rpmInstallFlags; }
1184 return (
_pimpl->history_log_path.empty() ?
1190 return _pimpl->_mediaConf.credentialsGlobalDir();
1195 return _pimpl->_mediaConf.credentialsGlobalFile();
1201 {
return "system-release"; }
1206 {
return _pimpl->pluginsPath.get(); }
1210 return _pimpl->cfg_kernel_keep_spec;
1217 str <<
"libzypp: " LIBZYPP_VERSION_STRING <<
" (" << LIBZYPP_CODESTREAM <<
")" << endl;
1219 str <<
"libsolv: " << solv_version;
1220 if ( ::strcmp( solv_version, LIBSOLV_VERSION_STRING ) )
1221 str <<
" (built against " << LIBSOLV_VERSION_STRING <<
")";
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
static Arch detectSystemArchitecture()
Determine system architecture evaluating uname and /proc/cpuinfo.
Convenience errno wrapper.
'Language[_Country]' codes.
static const Locale enCode
Last resort "en".
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.
LocaleSet requestedLocales() const
Languages to be supported by the system.
Pathname cfg_multiversion_path
DefaultOption< Pathname > download_mediaMountdir
DefaultOption< Pathname > cfg_metadata_path
Pathname cfg_known_repos_path
Pathname cfg_known_services_path
Pathname _autodetectSystemRoot() const
bsc#1237044: Provide announceSystemRoot to allow commands using –root without launching a Target.
Impl & operator=(const Impl &)=delete
Impl & operator=(Impl &&)=delete
DefaultOption< Pathname > cfg_packages_path
bool download_use_deltarpm_always
void notifyTargetChanged()
Pathname solver_checkSystemFile
Impl(const Impl &)=delete
MultiversionMap _multiversionMap
Pathname history_log_path
const TargetDefaults & targetDefaults() const
MultiversionSpec & getMultiversion() const
LocaleSet repoRefreshLocales
DefaultOption< Pathname > cfg_cache_path
std::vector< std::string > geoipHosts
TargetDefaults & targetDefaults()
Pathname _announced_root_path
Option< Pathname > pluginsPath
std::string cfg_kernel_keep_spec
DefaultOption< TriBool > repoGpgCheck
unsigned repo_refresh_delay
Option< DownloadMode > commit_downloadMode
std::optional< TargetDefaults > _currentTargetDefaults
TargetDefaults while –root.
MultiversionSpec & multiversion()
DefaultOption< bool > download_media_prefer_download
bool download_use_deltarpm
std::set< std::string > MultiversionSpec
Pathname solver_checkSystemFileDir
TargetDefaults _initialTargetDefaults
Initial TargetDefaults from /.
target::rpm::RpmInstFlags rpmInstallFlags
const MultiversionSpec & multiversion() const
Pathname cfg_repo_mgr_root_path
DefaultOption< TriBool > pkgGpgCheck
DefaultOption< std::string > updateMessagesNotify
DefaultOption< Pathname > cfg_solvfiles_path
DefaultOption< bool > gpgCheck
bool hasUserData() const
Whether a (non empty) user data sting is defined.
bool solver_cleandepsOnRemove() const
Whether removing a package should also remove no longer needed requirements.
std::string userData() const
User defined string value to be passed to log, history, plugins...
Pathname knownServicesPath() const
Path where the known services .service files are kept (configPath()/services.d).
void removeMultiversionSpec(const std::string &name_r)
Pathname repoPackagesPath() const
Path where the repo packages are downloaded and kept (repoCachePath()/packages).
unsigned repo_refresh_delay() const
Amount of time in minutes that must pass before another refresh.
Arch systemArchitecture() const
The system architecture zypp uses.
Locale textLocale() const
The locale for translated texts zypp uses.
const std::vector< std::string > geoipHostnames() const
All hostnames we want to rewrite using the geoip feature.
ZConfig(const ZConfig &)=delete
static Pathname update_dataPath()
Path where the update items are kept (/var/adm).
ResolverFocus solver_focus() const
The resolver's general attitude when resolving jobs.
Pathname builtinRepoSolvfilesPath() const
The builtin config file value.
Pathname pluginsPath() const
Defaults to /usr/lib/zypp/plugins.
Pathname repoManagerRoot() const
The RepoManager root directory.
void resetRepoGpgCheck()
Reset to the zconfig default.
bool gpgCheck() const
Turn signature checking on/off (on).
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.
void setRepoManagerRoot(const Pathname &root)
Sets the RepoManager root directory.
bool solver_dupAllowArchChange() const
DUP tune: Whether to allow package arch changes upon DUP.
void setTextLocale(const Locale &locale_r)
Set the preferred locale for translated texts.
bool solverUpgradeRemoveDroppedPackages() const
Whether dist upgrade should remove a products dropped packages (true).
void notifyTargetChanged()
internal
static Locale defaultTextLocale()
The autodetected preferred locale for translated texts.
Pathname download_mediaMountdir() const
Path where media are preferably mounted or downloaded.
static Pathname update_scriptsPath()
Path where the update scripts are stored ( /var/adm/update-scripts ).
void resetSolverUpgradeRemoveDroppedPackages()
Reset solverUpgradeRemoveDroppedPackages to the zypp.conf default.
bool apply_locks_file() const
Whether locks file should be read and applied after start (true).
bool solver_allowVendorChange() const
Whether vendor check is by default enabled.
void set_default_download_mediaMountdir()
Reset to zypp.cong default.
Pathname repoCachePath() const
Path where the caches are kept (/var/cache/zypp).
void setPkgGpgCheck(TriBool val_r)
Change the value.
Pathname needrebootPath() const
Path where the custom needreboot config files are kept (configPath()/needreboot.d).
bool setUserData(const std::string &str_r)
Set a new userData string.
Pathname systemRoot() const
The target root directory.
long download_max_silent_tries() const
Maximum silent tries.
bool repo_add_probe() const
Whether repository urls should be probed.
target::rpm::RpmInstFlags rpmInstallFlags() const
The default target::rpm::RpmInstFlags for ZYppCommitPolicy.
void setUpdateMessagesNotify(const std::string &val_r)
Set a new command definition (see update.messages.notify in zypp.conf).
unsigned solver_upgradeTestcasesToKeep() const
When committing a dist upgrade (e.g.
Pathname repoMetadataPath() const
Path where the repo metadata is downloaded and kept (repoCachePath()/raw).
Pathname geoipCachePath() const
Path where the geoip caches are kept (/var/cache/zypp/geoip).
Pathname vendorPath() const
Directory for equivalent vendor definitions (configPath()/vendors.d).
long download_min_download_speed() const
Minimum download speed (bytes per second) until the connection is dropped.
DownloadMode commit_downloadMode() const
Commit download policy to use as default.
Pathname needrebootFile() const
Path of the default needreboot config file (configPath()/needreboot).
void setGpgCheck(bool val_r)
Change the value.
bool solver_dupAllowVendorChange() const
DUP tune: Whether to allow package vendor changes upon DUP.
void setGeoipEnabled(bool enable=true)
Enables or disables the use of the geoip feature of download.opensuse.org.
Pathname locksFile() const
Path where zypp can find or create lock file (configPath()/locks).
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
Pointer to implementation.
Pathname repoSolvfilesPath() const
Path where the repo solv files are created and kept (repoCachePath()/solv).
bool geoipEnabled() const
Returns true if zypp should use the geoip feature of download.opensuse.org.
static Pathname update_messagesPath()
Path where the update messages are stored ( /var/adm/update-messages ).
Pathname historyLogFile() const
Path where ZYpp install history is logged.
void setSystemArchitecture(const Arch &arch_r)
Override the zypp system architecture.
TriBool pkgGpgCheck() const
Check rpm package signatures (indeterminate - according to gpgcheck).
static ZConfig & instance()
Singleton ctor.
void setRepoPackagesPath(const Pathname &path_r)
Set a new path as the default repo cache path.
void setRepoSolvfilesPath(const Pathname &path_r)
Set a new path as the default repo cache path.
void resetUpdateMessagesNotify()
Reset to the zypp.conf default.
std::ostream & about(std::ostream &str) const
Print some detail about the current libzypp version.
const std::set< std::string > & multiversionSpec() const
void set_download_mediaMountdir(Pathname newval_r)
Set alternate value.
bool download_use_deltarpm() const
Whether to consider using a deltarpm when downloading a package.
TriBool repoGpgCheck() const
Check repo matadata signatures (indeterminate - according to gpgcheck).
void set_download_media_prefer_download(bool yesno_r)
Set download_media_prefer_download to a specific value.
std::string updateMessagesNotify() const
Command definition for sending update messages.
void addMultiversionSpec(const std::string &name_r)
Pathname builtinRepoCachePath() const
The builtin config file value.
Pathname builtinRepoPackagesPath() const
The builtin config file value.
Pathname solver_checkSystemFile() const
File in which dependencies described which has to be fulfilled for a running system.
Pathname builtinRepoMetadataPath() const
The builtin config file value.
void set_default_download_media_prefer_download()
Set download_media_prefer_download to the configfiles default.
long lockTimeout() const
The number of seconds to wait for the zypp lock to become available.
Pathname solver_checkSystemFileDir() const
Directory, which may or may not contain files in which dependencies described which has to be fulfill...
void resetGpgCheck()
Reset to the zconfig default.
void setSolverUpgradeRemoveDroppedPackages(bool val_r)
Set solverUpgradeRemoveDroppedPackages to val_r.
Pathname configPath() const
Path where the configfiles are kept (/etc/zypp).
static Arch defaultSystemArchitecture()
The autodetected system architecture.
Pathname pubkeyCachePath() const
Path where the pubkey caches.
long download_max_concurrent_connections() const
Maximum number of concurrent connections for a single transfer.
void resetPkgGpgCheck()
Reset to the zconfig default.
void announceSystemRoot(const Pathname &root_r)
Announce a target root directory without launching the Target.
bool solver_onlyRequires() const
Solver regards required packages,patterns,... only.
Pathname varsPath() const
Path containing custom repo variable definitions (configPath()/vars.d).
bool solver_dupAllowNameChange() const
DUP tune: Whether to follow package renames upon DUP.
bool repoLabelIsAlias() const
Whether to use repository alias or name in user messages (progress, exceptions, .....
void clearMultiversionSpec()
LocaleSet repoRefreshLocales() const
List of locales for which translated package descriptions should be downloaded.
long download_max_download_speed() const
Maximum download speed (bytes per second).
void setRepoMetadataPath(const Pathname &path_r)
Set a new path as the default repo cache path.
bool solver_dupAllowDowngrade() const
DUP tune: Whether to allow version downgrades upon DUP.
std::string multiversionKernels() const
std::string distroverpkg() const
Package telling the "product version" on systems not using /etc/product.d/baseproduct.
bool download_use_deltarpm_always() const
Whether to consider using a deltarpm even when rpm is local.
void setRepoCachePath(const Pathname &path_r)
Set a new path as the default repo cache path.
void setRepoGpgCheck(TriBool val_r)
Change the value.
Pathname credentialsGlobalDir() const
Defaults to /etc/zypp/credentials.d.
bool download_media_prefer_download() const
Hint which media to prefer when installing packages (download vs.
Pathname credentialsGlobalFile() const
Defaults to /etc/zypp/credentials.cat.
const Pathname & path() const
Return current Pathname.
bool emptyOrRoot() const
Test for "" or "/".
bool empty() const
Test for an empty path.
void setTextLocale(const Locale &locale_r)
Set the default language for retrieving translated texts.
static Pool instance()
Singleton ctor.
void multiversionSpecChanged()
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
String related utilities and Regular expression matching.
Namespace intended to collect all environment variables we use.
std::optional< Pathname > ZYPP_CONF()
Types and functions for filesystem operations.
int dirForEach(const Pathname &dir_r, const StrMatcher &matcher_r, function< bool(const Pathname &, const char *const)> fnc_r)
int simpleParseFile(std::istream &str_r, ParseFlags flags_r, function< bool(int, std::string)> consume_r)
Simple lineparser optionally trimming and skipping comments.
bool strToBool(const C_Str &str, bool default_r)
Parse str into a bool depending on the default value.
TInt strtonum(const C_Str &str)
Parsing numbers from string.
std::string sconcat(Args &&... args)
Concat words as string.
unsigned splitEscaped(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", bool withEmpty=false)
Split line_r into words with respect to escape delimeters.
Easy-to use interface to the ZYPP dependency resolver.
std::unordered_set< Locale > LocaleSet
ResolverFocus
The resolver's general attitude.
@ Default
Request the standard behavior (as defined in zypp.conf or 'Job').
bool fromString(const std::string &val_r, ResolverFocus &ret_r)
relates: ResolverFocus Conversion from string (enumerator name, case insensitive, empty string is Def...
ZYpp::Ptr getZYpp()
relates: ZYppFactory Convenience to get the Pointer to the ZYpp instance.
detail::Dump< Tp > dump(const Tp &obj_r)
DownloadMode
Supported commit download policies.
@ DownloadDefault
libzypp will decide what to do.
Mutable option with initial value also remembering a config value.
DefaultOption(value_type initial_r)
void setDefault(value_type newval_r)
Set a new default value.
void restoreToDefault(value_type newval_r)
Reset value to a new default.
DefaultOption & operator=(value_type newval_r)
void restoreToDefault()
Reset value to the current default.
const value_type & getDefault() const
Get the current default value.
const value_type & get() const
Get the value.
Option & operator=(value_type newval_r)
void set(value_type newval_r)
Set a new value.
Option(value_type initial_r)
No default ctor, explicit initialisation!
MultiversionSpec & getSpec(Pathname root_r, const Impl &zConfImpl_r)
MultiversionSpec & getDefaultSpec()
void scanDirAt(const Pathname &root_r, MultiversionSpec &spec_r, const Impl &zConfImpl_r)
bool scanConfAt(const Pathname &root_r, MultiversionSpec &spec_r, const Impl &zConfImpl_r)
std::map< Pathname, MultiversionSpec > SpecMap
Settings that follow a changed Target.
Option< bool > solver_dupAllowVendorChange
DefaultOption< bool > solverUpgradeRemoveDroppedPackages
Option< unsigned > solver_upgradeTestcasesToKeep
Option< bool > solver_dupAllowDowngrade
bool consume(const std::string §ion, const std::string &entry, const std::string &value)
Option< bool > solver_dupAllowArchChange
Option< bool > solver_onlyRequires
ResolverFocus solver_focus
Option< bool > solver_cleandepsOnRemove
Option< bool > solver_allowVendorChange
Option< bool > solver_dupAllowNameChange
static PoolImpl & myPool()