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";
249 : _val(
std::move(initial_r) )
253 {
set( std::move(newval_r) );
return *
this; }
265 { _val = std::move(newval_r); }
280 , _default(
std::move(initial_r) )
284 { this->
set( std::move(newval_r) );
return *
this; }
288 { this->
set( _default.get() ); }
292 { setDefault( std::move(newval_r) ); restoreToDefault(); }
296 {
return _default.get(); }
300 { _default.set( std::move(newval_r) ); }
324 , solver_onlyRequires ( false )
325 , solver_allowVendorChange ( false )
326 , solver_dupAllowDowngrade ( true )
327 , solver_dupAllowNameChange ( true )
328 , solver_dupAllowArchChange ( true )
329 , solver_dupAllowVendorChange ( true )
330 , solver_cleandepsOnRemove ( false )
331 , solver_upgradeTestcasesToKeep ( 2 )
332 , solverUpgradeRemoveDroppedPackages ( true )
335 bool consume(
const std::string & entry,
const std::string & value )
337 if ( entry ==
"solver.focus" )
341 else if ( entry ==
"solver.onlyRequires" )
343 solver_onlyRequires.set(
str::strToBool( value, solver_onlyRequires ) );
345 else if ( entry ==
"solver.allowVendorChange" )
347 solver_allowVendorChange.set(
str::strToBool( value, solver_allowVendorChange ) );
349 else if ( entry ==
"solver.dupAllowDowngrade" )
351 solver_dupAllowDowngrade.set(
str::strToBool( value, solver_dupAllowDowngrade ) );
353 else if ( entry ==
"solver.dupAllowNameChange" )
355 solver_dupAllowNameChange.set(
str::strToBool( value, solver_dupAllowNameChange ) );
357 else if ( entry ==
"solver.dupAllowArchChange" )
359 solver_dupAllowArchChange.set(
str::strToBool( value, solver_dupAllowArchChange ) );
361 else if ( entry ==
"solver.dupAllowVendorChange" )
363 solver_dupAllowVendorChange.set(
str::strToBool( value, solver_dupAllowVendorChange ) );
365 else if ( entry ==
"solver.cleandepsOnRemove" )
367 solver_cleandepsOnRemove.set(
str::strToBool( value, solver_cleandepsOnRemove ) );
369 else if ( entry ==
"solver.upgradeTestcasesToKeep" )
371 solver_upgradeTestcasesToKeep.set( str::strtonum<unsigned>( value ) );
373 else if ( entry ==
"solver.upgradeRemoveDroppedPackages" )
375 solverUpgradeRemoveDroppedPackages.restoreToDefault(
str::strToBool( value, solverUpgradeRemoveDroppedPackages.getDefault() ) );
397 : _parsedZyppConf ( _autodetectZyppConfPath() )
398 , cfg_arch ( defaultSystemArchitecture() )
399 , cfg_textLocale ( defaultTextLocale() )
400 , cfg_cache_path {
"/var/cache/zypp" }
401 , cfg_metadata_path {
"" }
402 , cfg_solvfiles_path {
"" }
403 , cfg_packages_path {
"" }
404 , updateMessagesNotify (
"" )
405 , repo_add_probe (
false )
406 , repo_refresh_delay ( 10 )
407 , repoLabelIsAlias (
false )
408 , download_use_deltarpm (
true )
409 , download_use_deltarpm_always (
false )
410 , download_media_prefer_download(
true )
411 , download_mediaMountdir (
"/var/adm/mount" )
414 , repoGpgCheck ( indeterminate )
415 , pkgGpgCheck ( indeterminate )
416 , apply_locks_file (
true )
417 , pluginsPath (
"/usr/lib/zypp/plugins" )
419 MIL <<
"libzypp: " LIBZYPP_VERSION_STRING << endl;
420 if (
PathInfo(_parsedZyppConf).isExist() )
422 parser::IniDict dict( _parsedZyppConf );
424 sit != dict.sectionsEnd();
427 std::string section(*sit);
430 it != dict.entriesEnd(*sit);
433 std::string entry(it->first);
434 std::string value(it->second);
436 if ( _mediaConf.setConfigValue( section, entry, value ) )
440 if ( section ==
"main" )
442 if ( _initialTargetDefaults.consume( entry, value ) )
445 if ( entry ==
"arch" )
448 if ( carch != cfg_arch )
450 WAR <<
"Overriding system architecture (" << cfg_arch <<
"): " << carch << endl;
454 else if ( entry ==
"cachedir" )
456 cfg_cache_path.restoreToDefault( value );
458 else if ( entry ==
"metadatadir" )
460 cfg_metadata_path.restoreToDefault( value );
462 else if ( entry ==
"solvfilesdir" )
464 cfg_solvfiles_path.restoreToDefault( value );
466 else if ( entry ==
"packagesdir" )
468 cfg_packages_path.restoreToDefault( value );
470 else if ( entry ==
"configdir" )
474 else if ( entry ==
"reposdir" )
476 cfg_known_repos_path =
Pathname(value);
478 else if ( entry ==
"servicesdir" )
480 cfg_known_services_path =
Pathname(value);
482 else if ( entry ==
"varsdir" )
486 else if ( entry ==
"repo.add.probe" )
490 else if ( entry ==
"repo.refresh.delay" )
494 else if ( entry ==
"repo.refresh.locales" )
496 std::vector<std::string> tmp;
497 str::split( value, back_inserter( tmp ),
", \t" );
499 boost::function<Locale(const std::string &)> transform(
500 [](
const std::string & str_r)->Locale{
return Locale(str_r); }
502 repoRefreshLocales.insert( make_transform_iterator( tmp.begin(), transform ),
503 make_transform_iterator( tmp.end(), transform ) );
505 else if ( entry ==
"download.use_deltarpm" )
507 download_use_deltarpm =
str::strToBool( value, download_use_deltarpm );
509 else if ( entry ==
"download.use_deltarpm.always" )
511 download_use_deltarpm_always =
str::strToBool( value, download_use_deltarpm_always );
513 else if ( entry ==
"download.media_preference" )
515 download_media_prefer_download.restoreToDefault(
str::compareCI( value,
"volatile" ) != 0 );
517 else if ( entry ==
"download.media_mountdir" )
519 download_mediaMountdir.restoreToDefault(
Pathname(value) );
521 else if ( entry ==
"commit.downloadMode" )
523 commit_downloadMode.set( deserializeDownloadMode( value ) );
525 else if ( entry ==
"gpgcheck" )
529 else if ( entry ==
"repo_gpgcheck" )
533 else if ( entry ==
"pkg_gpgcheck" )
537 else if ( entry ==
"vendordir" )
541 else if ( entry ==
"multiversiondir" )
543 cfg_multiversion_path =
Pathname(value);
545 else if ( entry ==
"multiversion.kernels" )
547 cfg_kernel_keep_spec = value;
549 else if ( entry ==
"solver.checkSystemFile" )
551 solver_checkSystemFile =
Pathname(value);
553 else if ( entry ==
"solver.checkSystemFileDir" )
555 solver_checkSystemFileDir =
Pathname(value);
557 else if ( entry ==
"multiversion" )
559 MultiversionSpec & defSpec( _multiversionMap.getDefaultSpec() );
562 else if ( entry ==
"locksfile.path" )
566 else if ( entry ==
"locksfile.apply" )
570 else if ( entry ==
"update.datadir" )
574 else if ( entry ==
"update.scriptsdir" )
576 update_scripts_path =
Pathname(value);
578 else if ( entry ==
"update.messagessdir" )
580 update_messages_path =
Pathname(value);
582 else if ( entry ==
"update.messages.notify" )
584 updateMessagesNotify.set( value );
586 else if ( entry ==
"rpm.install.excludedocs" )
591 else if ( entry ==
"history.logfile" )
595 else if ( entry ==
"techpreview.ZYPP_SINGLE_RPMTRANS" )
597 DBG <<
"techpreview.ZYPP_SINGLE_RPMTRANS=" << value << endl;
598 ::setenv(
"ZYPP_SINGLE_RPMTRANS", value.c_str(), 1 );
600 else if ( entry ==
"techpreview.ZYPP_MEDIANETWORK" )
602 DBG <<
"techpreview.ZYPP_MEDIANETWORK=" << value << endl;
603 ::setenv(
"ZYPP_MEDIANETWORK", value.c_str(), 1 );
611 MIL << _parsedZyppConf <<
" not found, using defaults instead." << endl;
612 _parsedZyppConf = _parsedZyppConf.extend(
" (NOT FOUND)" );
616 if ( getenv(
"ZYPP_TESTSUITE_FAKE_ARCH" ) )
618 Arch carch( getenv(
"ZYPP_TESTSUITE_FAKE_ARCH" ) );
619 if ( carch != cfg_arch )
621 WAR <<
"ZYPP_TESTSUITE_FAKE_ARCH: Overriding system architecture (" << cfg_arch <<
"): " << carch << endl;
625 MIL <<
"ZConfig singleton created." << endl;
633 Pathname newRoot { _autodetectSystemRoot() };
634 MIL <<
"notifyTargetChanged (" << newRoot <<
")" << endl;
636 if ( newRoot.emptyOrRoot() ) {
637 _currentTargetDefaults.reset();
642 Pathname newConf { newRoot/_autodetectZyppConfPath() };
643 if (
PathInfo(newConf).isExist() ) {
645 for (
const auto & [entry,value] : dict.
entries(
"main" ) ) {
646 (*_currentTargetDefaults).consume( entry, value );
650 MIL << _parsedZyppConf <<
" not found, using defaults." << endl;
716 MediaConfig &_mediaConf = MediaConfig::instance();
734 typedef std::map<Pathname,MultiversionSpec>
SpecMap;
742 if ( root_r.
empty() )
744 bool cacheHit = _specMap.count( root_r );
754 if ( root_r ==
"/" || scanConfAt( root_r, ret, zConfImpl_r ) == 0 )
756 scanDirAt( root_r, ret, zConfImpl_r );
757 using zypp::operator<<;
758 MIL <<
"MultiversionSpec '" << root_r <<
"' = " << ret << endl;
769 static const str::regex rx(
"^multiversion *= *(.*)" );
772 [&](
int num_r, std::string line_r )->
bool 787 if ( multiversionDir.
empty() )
793 [&spec_r](
const Pathname & dir_r,
const char *
const & name_r )->
bool 795 MIL <<
"Parsing " << dir_r/name_r << endl;
797 [&spec_r](
int num_r, std::string line_r )->
bool 799 DBG <<
" found " << line_r << endl;
800 spec_r.insert( std::move(line_r) );
812 {
return _multiversionMap.getSpec( _autodetectSystemRoot(), *
this ); }
849 {
return _pimpl->notifyTargetChanged(); }
852 {
return _autodetectSystemRoot(); }
856 return (
_pimpl->cfg_repo_mgr_root_path.empty()
861 {
_pimpl->cfg_repo_mgr_root_path = root; }
871 static Arch _val( _autodetectSystemArchitecture() );
876 {
return _pimpl->cfg_arch; }
880 if ( arch_r !=
_pimpl->cfg_arch )
882 WAR <<
"Overriding system architecture (" <<
_pimpl->cfg_arch <<
"): " << arch_r << endl;
883 _pimpl->cfg_arch = arch_r;
895 static Locale _val( _autodetectTextLocale() );
900 {
return _pimpl->cfg_textLocale; }
904 if ( locale_r !=
_pimpl->cfg_textLocale )
906 WAR <<
"Overriding text locale (" <<
_pimpl->cfg_textLocale <<
"): " << locale_r << endl;
907 _pimpl->cfg_textLocale = locale_r;
918 {
return !
_pimpl->userData.empty(); }
921 {
return _pimpl->userData; }
925 for_( ch, str_r.begin(), str_r.end() )
927 if ( *ch <
' ' && *ch !=
'\t' )
929 ERR <<
"New user data string rejectded: char " << (int)*ch <<
" at position " << (ch - str_r.begin()) << endl;
933 MIL <<
"Set user data string to '" << str_r <<
"'" << endl;
942 return (
_pimpl->cfg_cache_path.get().empty()
953 _pimpl->cfg_cache_path = path_r;
958 return (
_pimpl->cfg_metadata_path.get().empty()
964 _pimpl->cfg_metadata_path = path_r;
969 return (
_pimpl->cfg_solvfiles_path.get().empty()
975 _pimpl->cfg_solvfiles_path = path_r;
980 return (
_pimpl->cfg_packages_path.get().empty()
986 _pimpl->cfg_packages_path = path_r;
990 {
return _pimpl->cfg_cache_path.getDefault().empty() ?
Pathname(
"/var/cache/zypp") :
_pimpl->cfg_cache_path.getDefault(); }
1005 return (
_pimpl->cfg_config_path.empty()
1011 return (
_pimpl->cfg_known_repos_path.empty()
1017 return (
_pimpl->cfg_known_services_path.empty()
1029 return (
_pimpl->cfg_vars_path.empty()
1035 return (
_pimpl->cfg_vendor_path.empty()
1041 return (
_pimpl->locks_file.empty()
1048 {
return _pimpl->repo_add_probe; }
1051 {
return _pimpl->repo_refresh_delay; }
1057 {
return _pimpl->repoLabelIsAlias; }
1060 {
_pimpl->repoLabelIsAlias = yesno_r; }
1063 {
return _pimpl->download_use_deltarpm; }
1069 {
return _pimpl->download_media_prefer_download; }
1072 {
_pimpl->download_media_prefer_download.set( yesno_r ); }
1075 {
_pimpl->download_media_prefer_download.restoreToDefault(); }
1078 {
return _pimpl->_mediaConf.download_max_concurrent_connections(); }
1081 {
return _pimpl->_mediaConf.download_min_download_speed(); }
1084 {
return _pimpl->_mediaConf.download_max_download_speed(); }
1087 {
return _pimpl->_mediaConf.download_max_silent_tries(); }
1090 {
return _pimpl->_mediaConf.download_transfer_timeout(); }
1097 {
return _pimpl->commit_downloadMode; }
1129 {
return (
_pimpl->solver_checkSystemFile.empty()
1133 {
return (
_pimpl->solver_checkSystemFileDir.empty()
1139 inline void sigMultiversionSpecChanged()
1152 {
return _pimpl->apply_locks_file; }
1156 return (
_pimpl->update_data_path.empty()
1162 return (
_pimpl->update_messages_path.empty()
1168 return (
_pimpl->update_scripts_path.empty()
1173 {
return _pimpl->updateMessagesNotify; }
1176 {
_pimpl->updateMessagesNotify.set( val_r ); }
1179 {
_pimpl->updateMessagesNotify.restoreToDefault(); }
1184 {
return _pimpl->rpmInstallFlags; }
1189 return (
_pimpl->history_log_path.empty() ?
1195 return _pimpl->_mediaConf.credentialsGlobalDir();
1200 return _pimpl->_mediaConf.credentialsGlobalFile();
1206 {
return "system-release"; }
1211 {
return _pimpl->pluginsPath.get(); }
1215 return _pimpl->cfg_kernel_keep_spec;
1222 str <<
"libzypp: " LIBZYPP_VERSION_STRING << endl;
1224 str <<
"libsolv: " << solv_version;
1225 if ( ::strcmp( solv_version, LIBSOLV_VERSION_STRING ) )
1226 str <<
" (built against " << LIBSOLV_VERSION_STRING <<
")";
1229 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 indeterminate.
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
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
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
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)
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 resolver's general attitude.
Pathname pubkeyCachePath() const
Path where the pubkey caches.
LocaleSet repoRefreshLocales
Iterable< entry_const_iterator > entries(const std::string §ion) const
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
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.
Option< bool > solver_allowVendorChange
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.
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.
Pathname download_mediaMountdir() const
Path where media are preferably mounted or downloaded.
int scanConfAt(const Pathname root_r, MultiversionSpec &spec_r, const Impl &zConfImpl_r)
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
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)
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.
DefaultOption< bool > solverUpgradeRemoveDroppedPackages
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.
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()
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,...
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
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.
Regular expression match result.
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
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 consume(const std::string &entry, const std::string &value)
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.
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)
std::string updateMessagesNotify() const
Command definition for sending update messages.
Pathname systemRoot() const
The target root directory.
EntrySet::const_iterator entry_const_iterator
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.
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)
ResolverFocus solver_focus
void notifyTargetChanged()
internal
bool download_use_deltarpm() const
Whether to consider using a deltarpm when downloading a package.
std::unordered_set< Locale > LocaleSet
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
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).
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