15 #include <sys/utsname.h> 16 #if __GLIBC_PREREQ (2,16) 20 #include <solv/solvversion.h> 24 #include <zypp/base/LogTools.h> 25 #include <zypp/base/IOStream.h> 27 #include <zypp/base/String.h> 28 #include <zypp/base/Regex.h> 32 #include <zypp/PathInfo.h> 36 #include <zypp/sat/detail/PoolImpl.h> 42 #undef ZYPP_BASE_LOGGER_LOGGROUP 43 #define ZYPP_BASE_LOGGER_LOGGROUP "zconfig" 63 Arch _autodetectSystemArchitecture()
66 if ( ::uname( &buf ) < 0 )
68 ERR <<
"Can't determine system architecture" << endl;
72 Arch architecture( buf.machine );
73 MIL <<
"Uname architecture is '" << buf.machine <<
"'" << endl;
75 if ( architecture == Arch_i686 )
80 std::ifstream cpuinfo(
"/proc/cpuinfo" );
83 for( iostr::EachLine in( cpuinfo ); in; in.next() )
87 if ( in->find(
"cx8" ) == std::string::npos
88 || in->find(
"cmov" ) == std::string::npos )
90 architecture = Arch_i586;
91 WAR <<
"CPU lacks 'cx8' or 'cmov': architecture downgraded to '" << architecture <<
"'" << endl;
99 ERR <<
"Cant open " <<
PathInfo(
"/proc/cpuinfo") << endl;
102 else if ( architecture == Arch_sparc || architecture == Arch_sparc64 )
105 std::ifstream cpuinfo(
"/proc/cpuinfo" );
108 for( iostr::EachLine in( cpuinfo ); in; in.next() )
112 if ( in->find(
"sun4v" ) != std::string::npos )
114 architecture = ( architecture == Arch_sparc64 ? Arch_sparc64v : Arch_sparcv9v );
115 WAR <<
"CPU has 'sun4v': architecture upgraded to '" << architecture <<
"'" << endl;
117 else if ( in->find(
"sun4u" ) != std::string::npos )
119 architecture = ( architecture == Arch_sparc64 ? Arch_sparc64 : Arch_sparcv9 );
120 WAR <<
"CPU has 'sun4u': architecture upgraded to '" << architecture <<
"'" << endl;
122 else if ( in->find(
"sun4m" ) != std::string::npos )
124 architecture = Arch_sparcv8;
125 WAR <<
"CPU has 'sun4m': architecture upgraded to '" << architecture <<
"'" << endl;
133 ERR <<
"Cant open " <<
PathInfo(
"/proc/cpuinfo") << endl;
136 else if ( architecture == Arch_armv7l || architecture == Arch_armv6l )
138 std::ifstream platform(
"/etc/rpm/platform" );
141 for( iostr::EachLine in( platform ); in; in.next() )
145 architecture = Arch_armv7hl;
146 WAR <<
"/etc/rpm/platform contains armv7hl-: architecture upgraded to '" << architecture <<
"'" << endl;
151 architecture = Arch_armv6hl;
152 WAR <<
"/etc/rpm/platform contains armv6hl-: architecture upgraded to '" << architecture <<
"'" << endl;
158 #if __GLIBC_PREREQ (2,16) 159 else if ( architecture == Arch_ppc64 )
161 const char * platform = (
const char *)getauxval( AT_PLATFORM );
163 if ( platform && sscanf( platform,
"power%d", &powerlvl ) == 1 && powerlvl > 6 )
164 architecture = Arch_ppc64p7;
187 Locale _autodetectTextLocale()
190 const char * envlist[] = {
"LC_ALL",
"LC_MESSAGES",
"LANG", NULL };
191 for (
const char ** envvar = envlist; *envvar; ++envvar )
193 const char * envlang = getenv( *envvar );
196 std::string envstr( envlang );
197 if ( envstr !=
"POSIX" && envstr !=
"C" )
199 Locale lang( envstr );
202 MIL <<
"Found " << *envvar <<
"=" << envstr << endl;
209 MIL <<
"Default text locale is '" << ret <<
"'" << endl;
210 #warning HACK AROUND BOOST_TEST_CATCH_SYSTEM_ERRORS 211 setenv(
"BOOST_TEST_CATCH_SYSTEM_ERRORS",
"no", 1 );
216 inline Pathname _autodetectSystemRoot()
219 return target ? target->root() :
Pathname();
222 inline Pathname _autodetectZyppConfPath()
224 const char *env_confpath = getenv(
"ZYPP_CONF" );
225 return env_confpath ? env_confpath :
"/etc/zypp/zypp.conf";
240 : _val(
std::move(initial_r) )
244 {
set( std::move(newval_r) );
return *
this; }
256 { _val = std::move(newval_r); }
271 , _default(
std::move(initial_r) )
275 { this->
set( std::move(newval_r) );
return *
this; }
279 { this->
set( _default.get() ); }
283 { setDefault( std::move(newval_r) ); restoreToDefault(); }
287 {
return _default.get(); }
291 { _default.set( std::move(newval_r) ); }
312 : _parsedZyppConf ( override_r )
313 , cfg_arch ( defaultSystemArchitecture() )
314 , cfg_textLocale ( defaultTextLocale() )
315 , cfg_cache_path {
"/var/cache/zypp" }
316 , cfg_metadata_path {
"" }
317 , cfg_solvfiles_path {
"" }
318 , cfg_packages_path {
"" }
319 , updateMessagesNotify (
"" )
320 , repo_add_probe (
false )
321 , repo_refresh_delay ( 10 )
322 , repoLabelIsAlias (
false )
323 , download_use_deltarpm (
true )
324 , download_use_deltarpm_always (
false )
325 , download_media_prefer_download(
true )
326 , download_mediaMountdir (
"/var/adm/mount" )
327 , download_max_concurrent_connections( 5 )
328 , download_min_download_speed ( 0 )
329 , download_max_download_speed ( 0 )
330 , download_max_silent_tries ( 5 )
331 , download_transfer_timeout ( 180 )
334 , repoGpgCheck ( indeterminate )
335 , pkgGpgCheck ( indeterminate )
337 , solver_onlyRequires (
false )
338 , solver_allowVendorChange (
false )
339 , solver_dupAllowDowngrade (
true )
340 , solver_dupAllowNameChange (
true )
341 , solver_dupAllowArchChange (
true )
342 , solver_dupAllowVendorChange (
true )
343 , solver_cleandepsOnRemove (
false )
344 , solver_upgradeTestcasesToKeep ( 2 )
345 , solverUpgradeRemoveDroppedPackages(
true )
346 , apply_locks_file (
true )
347 , pluginsPath (
"/usr/lib/zypp/plugins" )
349 MIL <<
"libzypp: " LIBZYPP_VERSION_STRING << endl;
352 if ( _parsedZyppConf.empty() )
354 _parsedZyppConf = _autodetectZyppConfPath();
362 INT <<
"Reconfigure to " << _parsedZyppConf << endl;
365 if (
PathInfo(_parsedZyppConf).isExist() )
367 parser::IniDict dict( _parsedZyppConf );
369 sit != dict.sectionsEnd();
372 std::string section(*sit);
375 it != dict.entriesEnd(*sit);
378 std::string entry(it->first);
379 std::string value(it->second);
381 if ( section ==
"main" )
383 if ( entry ==
"arch" )
386 if ( carch != cfg_arch )
388 WAR <<
"Overriding system architecture (" << cfg_arch <<
"): " << carch << endl;
392 else if ( entry ==
"cachedir" )
394 cfg_cache_path.restoreToDefault( value );
396 else if ( entry ==
"metadatadir" )
398 cfg_metadata_path.restoreToDefault( value );
400 else if ( entry ==
"solvfilesdir" )
402 cfg_solvfiles_path.restoreToDefault( value );
404 else if ( entry ==
"packagesdir" )
406 cfg_packages_path.restoreToDefault( value );
408 else if ( entry ==
"configdir" )
412 else if ( entry ==
"reposdir" )
414 cfg_known_repos_path =
Pathname(value);
416 else if ( entry ==
"servicesdir" )
418 cfg_known_services_path =
Pathname(value);
420 else if ( entry ==
"varsdir" )
424 else if ( entry ==
"repo.add.probe" )
428 else if ( entry ==
"repo.refresh.delay" )
432 else if ( entry ==
"repo.refresh.locales" )
434 std::vector<std::string> tmp;
435 str::split( value, back_inserter( tmp ),
", \t" );
437 boost::function<Locale(const std::string &)> transform(
438 [](
const std::string & str_r)->Locale{
return Locale(str_r); }
440 repoRefreshLocales.insert( make_transform_iterator( tmp.begin(), transform ),
441 make_transform_iterator( tmp.end(), transform ) );
443 else if ( entry ==
"download.use_deltarpm" )
445 download_use_deltarpm =
str::strToBool( value, download_use_deltarpm );
447 else if ( entry ==
"download.use_deltarpm.always" )
449 download_use_deltarpm_always =
str::strToBool( value, download_use_deltarpm_always );
451 else if ( entry ==
"download.media_preference" )
453 download_media_prefer_download.restoreToDefault(
str::compareCI( value,
"volatile" ) != 0 );
456 else if ( entry ==
"download.media_mountdir" )
458 download_mediaMountdir.restoreToDefault(
Pathname(value) );
461 else if ( entry ==
"download.max_concurrent_connections" )
465 else if ( entry ==
"download.min_download_speed" )
469 else if ( entry ==
"download.max_download_speed" )
473 else if ( entry ==
"download.max_silent_tries" )
477 else if ( entry ==
"download.transfer_timeout" )
480 if ( download_transfer_timeout < 0 ) download_transfer_timeout = 0;
481 else if ( download_transfer_timeout > 3600 ) download_transfer_timeout = 3600;
483 else if ( entry ==
"commit.downloadMode" )
485 commit_downloadMode.set( deserializeDownloadMode( value ) );
487 else if ( entry ==
"gpgcheck" )
491 else if ( entry ==
"repo_gpgcheck" )
495 else if ( entry ==
"pkg_gpgcheck" )
499 else if ( entry ==
"vendordir" )
503 else if ( entry ==
"multiversiondir" )
505 cfg_multiversion_path =
Pathname(value);
507 else if ( entry ==
"multiversion.kernels" )
509 cfg_kernel_keep_spec = value;
511 else if ( entry ==
"solver.focus" )
515 else if ( entry ==
"solver.onlyRequires" )
517 solver_onlyRequires.set(
str::strToBool( value, solver_onlyRequires ) );
519 else if ( entry ==
"solver.allowVendorChange" )
521 solver_allowVendorChange.set(
str::strToBool( value, solver_allowVendorChange ) );
523 else if ( entry ==
"solver.dupAllowDowngrade" )
525 solver_dupAllowDowngrade.set(
str::strToBool( value, solver_dupAllowDowngrade ) );
527 else if ( entry ==
"solver.dupAllowNameChange" )
529 solver_dupAllowNameChange.set(
str::strToBool( value, solver_dupAllowNameChange ) );
531 else if ( entry ==
"solver.dupAllowArchChange" )
533 solver_dupAllowArchChange.set(
str::strToBool( value, solver_dupAllowArchChange ) );
535 else if ( entry ==
"solver.dupAllowVendorChange" )
537 solver_dupAllowVendorChange.set(
str::strToBool( value, solver_dupAllowVendorChange ) );
539 else if ( entry ==
"solver.cleandepsOnRemove" )
541 solver_cleandepsOnRemove.set(
str::strToBool( value, solver_cleandepsOnRemove ) );
543 else if ( entry ==
"solver.upgradeTestcasesToKeep" )
545 solver_upgradeTestcasesToKeep.set( str::strtonum<unsigned>( value ) );
547 else if ( entry ==
"solver.upgradeRemoveDroppedPackages" )
549 solverUpgradeRemoveDroppedPackages.restoreToDefault(
str::strToBool( value, solverUpgradeRemoveDroppedPackages.getDefault() ) );
551 else if ( entry ==
"solver.checkSystemFile" )
553 solver_checkSystemFile =
Pathname(value);
555 else if ( entry ==
"solver.checkSystemFileDir" )
557 solver_checkSystemFileDir =
Pathname(value);
559 else if ( entry ==
"multiversion" )
561 MultiversionSpec & defSpec( _multiversionMap.getDefaultSpec() );
564 else if ( entry ==
"locksfile.path" )
568 else if ( entry ==
"locksfile.apply" )
572 else if ( entry ==
"update.datadir" )
576 else if ( entry ==
"update.scriptsdir" )
578 update_scripts_path =
Pathname(value);
580 else if ( entry ==
"update.messagessdir" )
582 update_messages_path =
Pathname(value);
584 else if ( entry ==
"update.messages.notify" )
586 updateMessagesNotify.set( value );
588 else if ( entry ==
"rpm.install.excludedocs" )
593 else if ( entry ==
"history.logfile" )
597 else if ( entry ==
"credentials.global.dir" )
599 credentials_global_dir_path =
Pathname(value);
601 else if ( entry ==
"credentials.global.file" )
603 credentials_global_file_path =
Pathname(value);
605 else if ( entry ==
"techpreview.ZYPP_SINGLE_RPMTRANS" )
607 DBG <<
"techpreview.ZYPP_SINGLE_RPMTRANS=" << value << endl;
608 ::setenv(
"ZYPP_SINGLE_RPMTRANS", value.c_str(), 1 );
610 else if ( entry ==
"techpreview.ZYPP_MEDIANETWORK" )
612 DBG <<
"techpreview.ZYPP_MEDIANETWORK=" << value << endl;
613 ::setenv(
"ZYPP_MEDIANETWORK", value.c_str(), 1 );
623 MIL << _parsedZyppConf <<
" not found, using defaults instead." << endl;
624 _parsedZyppConf = _parsedZyppConf.extend(
" (NOT FOUND)" );
628 if ( getenv(
"ZYPP_TESTSUITE_FAKE_ARCH" ) )
630 Arch carch( getenv(
"ZYPP_TESTSUITE_FAKE_ARCH" ) );
631 if ( carch != cfg_arch )
633 WAR <<
"ZYPP_TESTSUITE_FAKE_ARCH: Overriding system architecture (" << cfg_arch <<
"): " << carch << endl;
637 MIL <<
"ZConfig singleton created." << endl;
730 typedef std::map<Pathname,MultiversionSpec>
SpecMap;
738 if ( root_r.
empty() )
740 bool cacheHit = _specMap.count( root_r );
748 scanConfAt( root_r, ret, zConfImpl_r );
749 scanDirAt( root_r, ret, zConfImpl_r );
750 using zypp::operator<<;
751 MIL <<
"MultiversionSpec '" << root_r <<
"' = " << ret << endl;
762 static const str::regex rx(
"^multiversion *= *(.*)" );
765 [&](
int num_r, std::string line_r )->
bool 780 if ( multiversionDir.
empty() )
786 [&spec_r](
const Pathname & dir_r,
const char *
const & name_r )->
bool 788 MIL <<
"Parsing " << dir_r/name_r << endl;
790 [&spec_r](
int num_r, std::string line_r )->
bool 792 DBG <<
" found " << line_r << endl;
793 spec_r.insert( std::move(line_r) );
805 {
return _multiversionMap.getSpec( _autodetectSystemRoot(), *
this ); }
842 {
return _autodetectSystemRoot(); }
847 return (
_pimpl->cfg_repo_mgr_root_path.empty()
852 {
_pimpl->cfg_repo_mgr_root_path = root; }
862 static Arch _val( _autodetectSystemArchitecture() );
867 {
return _pimpl->cfg_arch; }
871 if ( arch_r !=
_pimpl->cfg_arch )
873 WAR <<
"Overriding system architecture (" <<
_pimpl->cfg_arch <<
"): " << arch_r << endl;
874 _pimpl->cfg_arch = arch_r;
886 static Locale _val( _autodetectTextLocale() );
891 {
return _pimpl->cfg_textLocale; }
895 if ( locale_r !=
_pimpl->cfg_textLocale )
897 WAR <<
"Overriding text locale (" <<
_pimpl->cfg_textLocale <<
"): " << locale_r << endl;
898 _pimpl->cfg_textLocale = locale_r;
909 {
return !
_pimpl->userData.empty(); }
912 {
return _pimpl->userData; }
916 for_( ch, str_r.begin(), str_r.end() )
918 if ( *ch <
' ' && *ch !=
'\t' )
920 ERR <<
"New user data string rejectded: char " << (int)*ch <<
" at position " << (ch - str_r.begin()) << endl;
924 MIL <<
"Set user data string to '" << str_r <<
"'" << endl;
933 return (
_pimpl->cfg_cache_path.get().empty()
944 _pimpl->cfg_cache_path = path_r;
949 return (
_pimpl->cfg_metadata_path.get().empty()
955 _pimpl->cfg_metadata_path = path_r;
960 return (
_pimpl->cfg_solvfiles_path.get().empty()
966 _pimpl->cfg_solvfiles_path = path_r;
971 return (
_pimpl->cfg_packages_path.get().empty()
977 _pimpl->cfg_packages_path = path_r;
981 {
return _pimpl->cfg_cache_path.getDefault().empty() ?
Pathname(
"/var/cache/zypp") :
_pimpl->cfg_cache_path.getDefault(); }
996 return (
_pimpl->cfg_config_path.empty()
1002 return (
_pimpl->cfg_known_repos_path.empty()
1008 return (
_pimpl->cfg_known_services_path.empty()
1020 return (
_pimpl->cfg_vars_path.empty()
1026 return (
_pimpl->cfg_vendor_path.empty()
1032 return (
_pimpl->locks_file.empty()
1039 {
return _pimpl->repo_add_probe; }
1042 {
return _pimpl->repo_refresh_delay; }
1048 {
return _pimpl->repoLabelIsAlias; }
1051 {
_pimpl->repoLabelIsAlias = yesno_r; }
1054 {
return _pimpl->download_use_deltarpm; }
1060 {
return _pimpl->download_media_prefer_download; }
1063 {
_pimpl->download_media_prefer_download.set( yesno_r ); }
1066 {
_pimpl->download_media_prefer_download.restoreToDefault(); }
1069 {
return _pimpl->download_max_concurrent_connections; }
1072 {
return _pimpl->download_min_download_speed; }
1075 {
return _pimpl->download_max_download_speed; }
1078 {
return _pimpl->download_max_silent_tries; }
1081 {
return _pimpl->download_transfer_timeout; }
1088 {
return _pimpl->commit_downloadMode; }
1106 {
return _pimpl->solver_onlyRequires; }
1109 {
return _pimpl->solver_allowVendorChange; }
1117 {
return _pimpl->solver_cleandepsOnRemove; }
1120 {
return (
_pimpl->solver_checkSystemFile.empty()
1124 {
return (
_pimpl->solver_checkSystemFileDir.empty()
1128 {
return _pimpl->solver_upgradeTestcasesToKeep; }
1136 inline void sigMultiversionSpecChanged()
1149 {
return _pimpl->apply_locks_file; }
1153 return (
_pimpl->update_data_path.empty()
1159 return (
_pimpl->update_messages_path.empty()
1165 return (
_pimpl->update_scripts_path.empty()
1170 {
return _pimpl->updateMessagesNotify; }
1173 {
_pimpl->updateMessagesNotify.set( val_r ); }
1176 {
_pimpl->updateMessagesNotify.restoreToDefault(); }
1181 {
return _pimpl->rpmInstallFlags; }
1186 return (
_pimpl->history_log_path.empty() ?
1192 return (
_pimpl->credentials_global_dir_path.empty() ?
1193 Pathname(
"/etc/zypp/credentials.d") :
_pimpl->credentials_global_dir_path );
1198 return (
_pimpl->credentials_global_file_path.empty() ?
1199 Pathname(
"/etc/zypp/credentials.cat") :
_pimpl->credentials_global_file_path );
1205 {
return "system-release"; }
1210 {
return _pimpl->pluginsPath.get(); }
1214 return _pimpl->cfg_kernel_keep_spec;
1221 str <<
"libzypp: " LIBZYPP_VERSION_STRING << endl;
1223 str <<
"libsolv: " << solv_version;
1224 if ( ::strcmp( solv_version, LIBSOLV_VERSION_STRING ) )
1225 str <<
" (built against " << LIBSOLV_VERSION_STRING <<
")";
1228 str <<
"zypp.conf: '" <<
_pimpl->_parsedZyppConf <<
"'" << endl;
TriBool strToTriBool(const C_Str &str)
Parse str into a bool if it's a legal true or false string; else indterminate.
void setDefault(value_type newval_r)
Set a new default value.
bool hasUserData() const
Whether a (non empty) user data sting is defined.
std::map< Pathname, MultiversionSpec > SpecMap
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 update_scripts_path
Pathname cfg_known_repos_path
int download_transfer_timeout
void setGpgCheck(bool val_r)
Change the value.
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.
MapKVIteratorTraits< SectionSet >::Key_const_iterator section_const_iterator
Option< unsigned > solver_upgradeTestcasesToKeep
void setUpdateMessagesNotify(const std::string &val_r)
Set a new command definition (see update.messages.notify in zypp.conf).
Option< bool > solver_cleandepsOnRemove
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
int download_max_concurrent_connections
static ZConfig & instance()
Singleton ctor.
long download_max_download_speed() const
Maximum download speed (bytes per second)
Pathname update_messages_path
MultiversionSpec & multiversion()
static const Locale enCode
Last resort "en".
Locale textLocale() const
The locale for translated texts zypp uses.
void scanDirAt(const Pathname root_r, MultiversionSpec &spec_r, const Impl &zConfImpl_r)
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.
Pathname update_scriptsPath() const
Path where the repo metadata is downloaded and kept (update_dataPath()/).
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 resolvers general attitude.
Pathname pubkeyCachePath() const
Path where the pubkey caches.
LocaleSet repoRefreshLocales
Option< bool > solver_dupAllowVendorChange
Pathname builtinRepoMetadataPath() const
The builtin config file value.
int dirForEach(const Pathname &dir_r, const StrMatcher &matcher_r, function< bool(const Pathname &, const char *const)> fnc_r)
DefaultOption< Pathname > cfg_metadata_path
bool repo_add_probe() const
Whether repository urls should be probed.
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
void restoreToDefault()
Reset value to the current default.
String related utilities and Regular expression matching.
void removeMultiversionSpec(const std::string &name_r)
void setSystemArchitecture(const Arch &arch_r)
Override the zypp system architecture.
unsigned solver_upgradeTestcasesToKeep() const
When committing a dist upgrade (e.g.
Pathname vendorPath() const
Directory for equivalent vendor definitions (configPath()/vendors.d)
target::rpm::RpmInstFlags rpmInstallFlags
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')
std::set< std::string > MultiversionSpec
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.
Pathname _parsedZyppConf
Remember any parsed zypp.conf.
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.
Option< bool > solver_allowVendorChange
void addMultiversionSpec(const std::string &name_r)
void resetGpgCheck()
Reset to the zconfig default.
Pathname credentials_global_dir_path
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.
Pathname download_mediaMountdir() const
Path where media are preferably mounted or downloaded.
Pathname repoManagerRoot() const
The RepoManager root directory.
MultiversionMap _multiversionMap
DefaultOption< bool > gpgCheck
bool empty() const
Test for an empty path.
void setTextLocale(const Locale &locale_r)
Set the preferred locale for translated texts.
int simpleParseFile(std::istream &str_r, ParseFlags flags_r, function< bool(int, std::string)> consume_r)
Simple lineparser optionally trimming and skipping comments.
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 update_data_path
Pathname credentials_global_file_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...
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)
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)
Return path_r prefixed with root_r, unless it is already prefixed.
Interim helper class to collect global options and settings.
Pathname credentialsGlobalFile() const
Defaults to /etc/zypp/credentials.cat.
bool solver_dupAllowDowngrade() const
DUP tune: Whether to allow version downgrades upon DUP.
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.
void scanConfAt(const Pathname root_r, MultiversionSpec &spec_r, const Impl &zConfImpl_r)
bool solver_dupAllowNameChange() const
DUP tune: Whether to follow package renames upon DUP.
TInt strtonum(const C_Str &str)
Parsing numbers from string.
Pathname needrebootPath() const
Path where the custom needreboot config files are kept (configPath()/needreboot.d).
Pathname update_dataPath() const
Path where the update items are kept (/var/adm)
void clearMultiversionSpec()
int download_max_silent_tries
Pathname repoPackagesPath() const
Path where the repo packages are downloaded and kept (repoCachePath()/packages).
static PoolImpl & myPool()
bool fromString(const std::string &val_r, ResolverFocus &ret_r)
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.
Pathname update_messagesPath() const
Path where the repo solv files are created and kept (update_dataPath()/solv).
bool download_use_deltarpm_always
int compareCI(const C_Str &lhs, const C_Str &rhs)
bool solver_onlyRequires() const
Solver regards required packages,patterns,...
Pathname configPath() const
Path where the configfiles are kept (/etc/zypp).
'Language[_Country]' codes.
Option< Pathname > pluginsPath
Impl(const Pathname &override_r=Pathname())
DefaultOption< Pathname > cfg_cache_path
DefaultOption< Pathname > cfg_packages_path
Pathname builtinRepoSolvfilesPath() const
The builtin config file value.
static Arch defaultSystemArchitecture()
The autodetected system architecture.
Regular expression match result.
void resetRepoGpgCheck()
Reset to the zconfig default.
ResolverFocus solver_focus() const
The resolvers general attitude when resolving jobs.
bool solver_cleandepsOnRemove() const
Whether removing a package should also remove no longer needed requirements.
DefaultOption< std::string > updateMessagesNotify
Option< bool > solver_dupAllowNameChange
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
Option< bool > solver_onlyRequires
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
int download_max_download_speed
std::string multiversionKernels() const
void setRepoMetadataPath(const Pathname &path_r)
Set a new path as the default repo cache path.
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.
bool regex_match(const std::string &s, smatch &matches, const regex ®ex)
regex ZYPP_STR_REGEX regex ZYPP_STR_REGEX
DefaultOption(value_type initial_r)
int download_min_download_speed
std::string updateMessagesNotify() const
Command definition for sending update messages.
Pathname systemRoot() const
The target root directory.
EntrySet::const_iterator entry_const_iterator
ResolverFocus solver_focus
Pathname builtinRepoCachePath() const
The builtin config file value.
Pathname solver_checkSystemFileDir
Pathname cfg_multiversion_path
void setPkgGpgCheck(TriBool val_r)
Change the value.
DefaultOption< bool > solverUpgradeRemoveDroppedPackages
const value_type & getDefault() const
Get the current default value.
DefaultOption< Pathname > cfg_solvfiles_path
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.
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
DefaultOption & operator=(value_type newval_r)
bool download_use_deltarpm() const
Whether to consider using a deltarpm when downloading a package.
std::unordered_set< Locale > LocaleSet
Option< bool > solver_dupAllowArchChange
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)
Option< bool > solver_dupAllowDowngrade
Pathname pluginsPath() const
Defaults to /usr/lib/zypp/plugins.
DefaultOption< TriBool > repoGpgCheck
Option< DownloadMode > commit_downloadMode
DefaultOption< TriBool > pkgGpgCheck
unsigned repo_refresh_delay
void resetPkgGpgCheck()
Reset to the zconfig default.
void multiversionSpecChanged()
Pathname repoMetadataPath() const
Path where the repo metadata is downloaded and kept (repoCachePath()/raw).
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.