15#include <sys/utsname.h>
16#if __GLIBC_PREREQ (2,16)
20#include <solv/solvversion.h>
25#include <zypp/base/LogTools.h>
26#include <zypp/base/IOStream.h>
27#include <zypp-core/base/InputStream>
28#include <zypp/base/String.h>
29#include <zypp/base/Regex.h>
33#include <zypp/PathInfo.h>
34#include <zypp-core/parser/IniDict>
37#include <zypp/sat/detail/PoolImpl.h>
39#include <zypp-media/MediaConfig>
45#undef ZYPP_BASE_LOGGER_LOGGROUP
46#define ZYPP_BASE_LOGGER_LOGGROUP "zconfig"
66 Arch _autodetectSystemArchitecture()
69 if ( ::uname( &buf ) < 0 )
71 ERR <<
"Can't determine system architecture" << endl;
75 Arch architecture( buf.machine );
76 MIL <<
"Uname architecture is '" << buf.machine <<
"'" << endl;
78 if ( architecture == Arch_i686 )
83 std::ifstream cpuinfo(
"/proc/cpuinfo" );
86 for( iostr::EachLine in( cpuinfo ); in; in.next() )
90 if ( in->find(
"cx8" ) == std::string::npos
91 || in->find(
"cmov" ) == std::string::npos )
93 architecture = Arch_i586;
94 WAR <<
"CPU lacks 'cx8' or 'cmov': architecture downgraded to '" << architecture <<
"'" << endl;
102 ERR <<
"Cant open " <<
PathInfo(
"/proc/cpuinfo") << endl;
105 else if ( architecture == Arch_sparc || architecture == Arch_sparc64 )
108 std::ifstream cpuinfo(
"/proc/cpuinfo" );
111 for( iostr::EachLine in( cpuinfo ); in; in.next() )
115 if ( in->find(
"sun4v" ) != std::string::npos )
117 architecture = ( architecture == Arch_sparc64 ? Arch_sparc64v : Arch_sparcv9v );
118 WAR <<
"CPU has 'sun4v': architecture upgraded to '" << architecture <<
"'" << endl;
120 else if ( in->find(
"sun4u" ) != std::string::npos )
122 architecture = ( architecture == Arch_sparc64 ? Arch_sparc64 : Arch_sparcv9 );
123 WAR <<
"CPU has 'sun4u': architecture upgraded to '" << architecture <<
"'" << endl;
125 else if ( in->find(
"sun4m" ) != std::string::npos )
127 architecture = Arch_sparcv8;
128 WAR <<
"CPU has 'sun4m': architecture upgraded to '" << architecture <<
"'" << endl;
136 ERR <<
"Cant open " <<
PathInfo(
"/proc/cpuinfo") << endl;
139 else if ( architecture == Arch_armv8l || architecture == Arch_armv7l || architecture == Arch_armv6l )
141 std::ifstream platform(
"/etc/rpm/platform" );
144 for( iostr::EachLine in( platform ); in; in.next() )
148 architecture = Arch_armv8hl;
149 WAR <<
"/etc/rpm/platform contains armv8hl-: architecture upgraded to '" << architecture <<
"'" << endl;
154 architecture = Arch_armv7hl;
155 WAR <<
"/etc/rpm/platform contains armv7hl-: architecture upgraded to '" << architecture <<
"'" << endl;
160 architecture = Arch_armv6hl;
161 WAR <<
"/etc/rpm/platform contains armv6hl-: architecture upgraded to '" << architecture <<
"'" << endl;
167#if __GLIBC_PREREQ (2,16)
168 else if ( architecture == Arch_ppc64 )
170 const char * platform = (
const char *)getauxval( AT_PLATFORM );
172 if ( platform && sscanf( platform,
"power%d", &powerlvl ) == 1 && powerlvl > 6 )
173 architecture = Arch_ppc64p7;
196 Locale _autodetectTextLocale()
199 const char * envlist[] = {
"LC_ALL",
"LC_MESSAGES",
"LANG", NULL };
200 for (
const char ** envvar = envlist; *envvar; ++envvar )
202 const char * envlang = getenv( *envvar );
205 std::string envstr( envlang );
206 if ( envstr !=
"POSIX" && envstr !=
"C" )
208 Locale lang( envstr );
211 MIL <<
"Found " << *envvar <<
"=" << envstr << endl;
218 MIL <<
"Default text locale is '" << ret <<
"'" << endl;
219#warning HACK AROUND BOOST_TEST_CATCH_SYSTEM_ERRORS
220 setenv(
"BOOST_TEST_CATCH_SYSTEM_ERRORS",
"no", 1 );
225 inline Pathname _autodetectSystemRoot()
228 return target ? target->root() :
Pathname();
231 inline Pathname _autodetectZyppConfPath()
233 const char *env_confpath = getenv(
"ZYPP_CONF" );
234 return env_confpath ? env_confpath :
"/etc/zypp/zypp.conf";
253 {
set( std::move(newval_r) );
return *
this; }
265 {
_val = std::move(newval_r); }
284 { this->
set( std::move(newval_r) );
return *
this; }
300 {
_default.set( std::move(newval_r) ); }
335 bool consume(
const std::string & entry,
const std::string & value )
337 if ( entry ==
"solver.focus" )
341 else if ( entry ==
"solver.onlyRequires" )
345 else if ( entry ==
"solver.allowVendorChange" )
349 else if ( entry ==
"solver.dupAllowDowngrade" )
353 else if ( entry ==
"solver.dupAllowNameChange" )
357 else if ( entry ==
"solver.dupAllowArchChange" )
361 else if ( entry ==
"solver.dupAllowVendorChange" )
365 else if ( entry ==
"solver.cleandepsOnRemove" )
369 else if ( entry ==
"solver.upgradeTestcasesToKeep" )
373 else if ( entry ==
"solver.upgradeRemoveDroppedPackages" )
421 MIL <<
"libzypp: " LIBZYPP_VERSION_STRING << endl;
429 std::string section(*sit);
435 std::string entry(it->first);
436 std::string value(it->second);
442 if ( section ==
"main" )
447 if ( entry ==
"arch" )
452 WAR <<
"Overriding system architecture (" <<
cfg_arch <<
"): " << carch << endl;
456 else if ( entry ==
"cachedir" )
460 else if ( entry ==
"metadatadir" )
464 else if ( entry ==
"solvfilesdir" )
468 else if ( entry ==
"packagesdir" )
472 else if ( entry ==
"configdir" )
476 else if ( entry ==
"reposdir" )
480 else if ( entry ==
"servicesdir" )
484 else if ( entry ==
"varsdir" )
488 else if ( entry ==
"repo.add.probe" )
492 else if ( entry ==
"repo.refresh.delay" )
496 else if ( entry ==
"repo.refresh.locales" )
498 std::vector<std::string> tmp;
499 str::split( value, back_inserter( tmp ),
", \t" );
501 boost::function<
Locale(
const std::string &)> transform(
502 [](
const std::string & str_r)->
Locale{
return Locale(str_r); }
505 make_transform_iterator( tmp.end(), transform ) );
507 else if ( entry ==
"download.use_deltarpm" )
511 else if ( entry ==
"download.use_deltarpm.always" )
515 else if ( entry ==
"download.media_preference" )
519 else if ( entry ==
"download.media_mountdir" )
523 else if ( entry ==
"download.use_geoip_mirror") {
526 else if ( entry ==
"commit.downloadMode" )
530 else if ( entry ==
"gpgcheck" )
534 else if ( entry ==
"repo_gpgcheck" )
538 else if ( entry ==
"pkg_gpgcheck" )
542 else if ( entry ==
"vendordir" )
546 else if ( entry ==
"multiversiondir" )
550 else if ( entry ==
"multiversion.kernels" )
554 else if ( entry ==
"solver.checkSystemFile" )
558 else if ( entry ==
"solver.checkSystemFileDir" )
562 else if ( entry ==
"multiversion" )
567 else if ( entry ==
"locksfile.path" )
571 else if ( entry ==
"locksfile.apply" )
575 else if ( entry ==
"update.datadir" )
579 else if ( entry ==
"update.scriptsdir" )
583 else if ( entry ==
"update.messagessdir" )
587 else if ( entry ==
"update.messages.notify" )
591 else if ( entry ==
"rpm.install.excludedocs" )
596 else if ( entry ==
"history.logfile" )
600 else if ( entry ==
"techpreview.ZYPP_SINGLE_RPMTRANS" )
602 DBG <<
"techpreview.ZYPP_SINGLE_RPMTRANS=" << value << endl;
603 ::setenv(
"ZYPP_SINGLE_RPMTRANS", value.c_str(), 1 );
605 else if ( entry ==
"techpreview.ZYPP_MEDIANETWORK" )
607 DBG <<
"techpreview.ZYPP_MEDIANETWORK=" << value << endl;
608 ::setenv(
"ZYPP_MEDIANETWORK", value.c_str(), 1 );
621 if ( getenv(
"ZYPP_TESTSUITE_FAKE_ARCH" ) )
623 Arch carch( getenv(
"ZYPP_TESTSUITE_FAKE_ARCH" ) );
626 WAR <<
"ZYPP_TESTSUITE_FAKE_ARCH: Overriding system architecture (" <<
cfg_arch <<
"): " << carch << endl;
630 MIL <<
"ZConfig singleton created." << endl;
638 Pathname newRoot { _autodetectSystemRoot() };
639 MIL <<
"notifyTargetChanged (" << newRoot <<
")" << endl;
641 if ( newRoot.emptyOrRoot() ) {
647 Pathname newConf { newRoot/_autodetectZyppConfPath() };
648 if (
PathInfo(newConf).isExist() ) {
650 for (
const auto & [entry,value] : dict.
entries(
"main" ) ) {
651 (*_currentTargetDefaults).consume( entry, value );
743 typedef std::map<Pathname,MultiversionSpec>
SpecMap;
751 if ( root_r.
empty() )
753 bool cacheHit =
_specMap.count( root_r );
763 if ( root_r ==
"/" ||
scanConfAt( root_r, ret, zConfImpl_r ) == 0 )
766 using zypp::operator<<;
767 MIL <<
"MultiversionSpec '" << root_r <<
"' = " << ret << endl;
778 static const str::regex rx(
"^multiversion *= *(.*)" );
781 [&](
int num_r, std::string line_r )->
bool
796 if ( multiversionDir.
empty() )
802 [&spec_r](
const Pathname & dir_r,
const char *
const & name_r )->
bool
804 MIL <<
"Parsing " << dir_r/name_r << endl;
806 [&spec_r](
int num_r, std::string line_r )->
bool
808 DBG <<
" found " << line_r << endl;
809 spec_r.insert( std::move(line_r) );
858 {
return _pimpl->notifyTargetChanged(); }
861 {
return _autodetectSystemRoot(); }
865 return (
_pimpl->cfg_repo_mgr_root_path.empty()
870 {
_pimpl->cfg_repo_mgr_root_path = root; }
880 static Arch _val( _autodetectSystemArchitecture() );
885 {
return _pimpl->cfg_arch; }
889 if ( arch_r !=
_pimpl->cfg_arch )
891 WAR <<
"Overriding system architecture (" <<
_pimpl->cfg_arch <<
"): " << arch_r << endl;
892 _pimpl->cfg_arch = arch_r;
904 static Locale _val( _autodetectTextLocale() );
909 {
return _pimpl->cfg_textLocale; }
913 if ( locale_r !=
_pimpl->cfg_textLocale )
915 WAR <<
"Overriding text locale (" <<
_pimpl->cfg_textLocale <<
"): " << locale_r << endl;
916 _pimpl->cfg_textLocale = locale_r;
927 {
return !
_pimpl->userData.empty(); }
930 {
return _pimpl->userData; }
934 for_( ch, str_r.begin(), str_r.end() )
936 if ( *ch <
' ' && *ch !=
'\t' )
938 ERR <<
"New user data string rejectded: char " << (int)*ch <<
" at position " << (ch - str_r.begin()) << endl;
942 MIL <<
"Set user data string to '" << str_r <<
"'" << endl;
951 return (
_pimpl->cfg_cache_path.get().empty()
962 _pimpl->cfg_cache_path = path_r;
967 return (
_pimpl->cfg_metadata_path.get().empty()
973 _pimpl->cfg_metadata_path = path_r;
978 return (
_pimpl->cfg_solvfiles_path.get().empty()
984 _pimpl->cfg_solvfiles_path = path_r;
989 return (
_pimpl->cfg_packages_path.get().empty()
995 _pimpl->cfg_packages_path = path_r;
999 {
return _pimpl->cfg_cache_path.getDefault().empty() ?
Pathname(
"/var/cache/zypp") :
_pimpl->cfg_cache_path.getDefault(); }
1014 return (
_pimpl->cfg_config_path.empty()
1020 return (
_pimpl->cfg_known_repos_path.empty()
1026 return (
_pimpl->cfg_known_services_path.empty()
1037 {
_pimpl->geoipEnabled = enable; }
1040 {
return _pimpl->geoipEnabled; }
1046 {
return _pimpl->geoipHosts; }
1050 return (
_pimpl->cfg_vars_path.empty()
1056 return (
_pimpl->cfg_vendor_path.empty()
1062 return (
_pimpl->locks_file.empty()
1069 {
return _pimpl->repo_add_probe; }
1072 {
return _pimpl->repo_refresh_delay; }
1078 {
return _pimpl->repoLabelIsAlias; }
1081 {
_pimpl->repoLabelIsAlias = yesno_r; }
1084 {
return _pimpl->download_use_deltarpm; }
1090 {
return _pimpl->download_media_prefer_download; }
1093 {
_pimpl->download_media_prefer_download.set( yesno_r ); }
1096 {
_pimpl->download_media_prefer_download.restoreToDefault(); }
1099 {
return _pimpl->_mediaConf.download_max_concurrent_connections(); }
1102 {
return _pimpl->_mediaConf.download_min_download_speed(); }
1105 {
return _pimpl->_mediaConf.download_max_download_speed(); }
1108 {
return _pimpl->_mediaConf.download_max_silent_tries(); }
1111 {
return _pimpl->_mediaConf.download_transfer_timeout(); }
1118 {
return _pimpl->commit_downloadMode; }
1150 {
return (
_pimpl->solver_checkSystemFile.empty()
1154 {
return (
_pimpl->solver_checkSystemFileDir.empty()
1160 inline void sigMultiversionSpecChanged()
1173 {
return _pimpl->apply_locks_file; }
1177 return (
_pimpl->update_data_path.empty()
1183 return (
_pimpl->update_messages_path.empty()
1189 return (
_pimpl->update_scripts_path.empty()
1194 {
return _pimpl->updateMessagesNotify; }
1197 {
_pimpl->updateMessagesNotify.set( val_r ); }
1200 {
_pimpl->updateMessagesNotify.restoreToDefault(); }
1205 {
return _pimpl->rpmInstallFlags; }
1210 return (
_pimpl->history_log_path.empty() ?
1216 return _pimpl->_mediaConf.credentialsGlobalDir();
1221 return _pimpl->_mediaConf.credentialsGlobalFile();
1227 {
return "system-release"; }
1232 {
return _pimpl->pluginsPath.get(); }
1236 return _pimpl->cfg_kernel_keep_spec;
1243 str <<
"libzypp: " LIBZYPP_VERSION_STRING << endl;
1245 str <<
"libsolv: " << solv_version;
1246 if ( ::strcmp( solv_version, LIBSOLV_VERSION_STRING ) )
1247 str <<
" (built against " << LIBSOLV_VERSION_STRING <<
")";
1250 str <<
"zypp.conf: '" <<
_pimpl->_parsedZyppConf <<
"'" << endl;
'Language[_Country]' codes.
static const Locale enCode
Last resort "en".
LocaleSet requestedLocales() const
Languages to be supported by the system.
Pathname cfg_multiversion_path
DefaultOption< Pathname > download_mediaMountdir
std::set< std::string > MultiversionSpec
DefaultOption< Pathname > cfg_metadata_path
Pathname cfg_known_repos_path
Pathname cfg_known_services_path
DefaultOption< Pathname > cfg_packages_path
bool download_use_deltarpm_always
Pathname _parsedZyppConf
Remember any parsed zypp.conf.
void notifyTargetChanged()
Pathname solver_checkSystemFile
MultiversionMap _multiversionMap
Pathname update_data_path
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 update_scripts_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
Pathname solver_checkSystemFileDir
TargetDefaults _initialTargetDefaults
Initial TargetDefaults from /.
target::rpm::RpmInstFlags rpmInstallFlags
Pathname update_messages_path
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
Interim helper class to collect global options and settings.
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.
Pathname update_dataPath() const
Path where the update items are kept (/var/adm)
ResolverFocus solver_focus() const
The resolver's general attitude when resolving jobs.
Pathname update_messagesPath() const
Path where the repo solv files are created and kept (update_dataPath()/solv).
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).
Pathname update_scriptsPath() const
Path where the repo metadata is downloaded and kept (update_dataPath()/).
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.
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.
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.
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.
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.
Wrapper class for ::stat/::lstat.
Pathname extend(const std::string &r) const
Append string r to the last component of the path.
bool empty() const
Test for an empty path.
static Pathname assertprefix(const Pathname &root_r, const Pathname &path_r)
Return path_r prefixed with root_r, unless it is already prefixed.
Parses a INI file and offers its structure as a dictionary.
section_const_iterator sectionsEnd() const
EntrySet::const_iterator entry_const_iterator
MapKVIteratorTraits< SectionSet >::Key_const_iterator section_const_iterator
entry_const_iterator entriesBegin(const std::string §ion) const
Iterable< entry_const_iterator > entries(const std::string §ion) const
section_const_iterator sectionsBegin() const
entry_const_iterator entriesEnd(const std::string §ion) const
void setTextLocale(const Locale &locale_r)
Set the default language for retrieving translated texts.
static Pool instance()
Singleton ctor.
void multiversionSpecChanged()
Regular expression match result.
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
String related utilities and Regular expression matching.
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 hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
TriBool strToTriBool(const C_Str &str)
Parse str into a bool if it's a legal true or false string; else indeterminate.
bool regex_match(const std::string &s, smatch &matches, const regex ®ex)
\relates regex \ingroup ZYPP_STR_REGEX \relates regex \ingroup ZYPP_STR_REGEX
bool strToBool(const C_Str &str, bool default_r)
Parse str into a bool depending on the default value.
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", const Trim trim_r=NO_TRIM)
Split line_r into words.
TInt strtonum(const C_Str &str)
Parsing numbers from 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.
int compareCI(const C_Str &lhs, const C_Str &rhs)
Easy-to use interface to the ZYPP dependency resolver.
bool fromString(const std::string &val_r, ResolverFocus &ret_r)
ResolverFocus
The resolver's general attitude.
@ Default
Request the standard behavior (as defined in zypp.conf or 'Job')
std::unordered_set< Locale > LocaleSet
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)
void scanDirAt(const Pathname root_r, MultiversionSpec &spec_r, const Impl &zConfImpl_r)
MultiversionSpec & getDefaultSpec()
std::map< Pathname, MultiversionSpec > SpecMap
int scanConfAt(const Pathname root_r, MultiversionSpec &spec_r, const Impl &zConfImpl_r)
Settings that follow a changed Target.
Option< bool > solver_dupAllowVendorChange
DefaultOption< bool > solverUpgradeRemoveDroppedPackages
Option< unsigned > solver_upgradeTestcasesToKeep
Option< bool > solver_dupAllowDowngrade
Option< bool > solver_dupAllowArchChange
Option< bool > solver_onlyRequires
bool consume(const std::string &entry, const std::string &value)
ResolverFocus solver_focus
Option< bool > solver_cleandepsOnRemove
Option< bool > solver_allowVendorChange
Option< bool > solver_dupAllowNameChange
static PoolImpl & myPool()
#define for_(IT, BEG, END)
Convenient for-loops using iterator.