libzypp: zypp/ZConfig.cc Source File

libzypp 17.38.11

ZConfig.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#include <cstdlib>
13#include <iostream>
14#include <optional>
15#include <map>
16#include <zypp-core/APIConfig.h>
17#include <zypp-core/base/LogTools.h>
18#include <zypp-core/base/IOStream.h>
19#include <zypp-core/base/InputStream>
20#include <zypp-core/base/Errno.h>
21#include <zypp-core/base/String.h>
22#include <zypp-core/base/Regex.h>
23
24#include <zypp/ZConfig.h>
25#include <zypp/ZYppFactory.h>
26#include <zypp/PathInfo.h>
27#include <zypp-core/parser/EconfDict>
28
29#include <zypp/sat/Pool.h>
30#include <zypp/sat/detail/PoolImpl.h>
31
32#include <zypp-media/MediaConfig>
33
34using std::endl;
35using namespace zypp::filesystem;
36using namespace zypp::parser;
37
38#undef ZYPP_BASE_LOGGER_LOGGROUP
39#define ZYPP_BASE_LOGGER_LOGGROUP "zconfig"
40
42namespace zypp
43{
44
45 namespace env {
46 inline std::optional<Pathname> ZYPP_CONF()
47 {
48 const char *env_confpath = getenv( "ZYPP_CONF" );
49 if ( env_confpath )
50 return env_confpath;
51 return std::nullopt;
52 }
53 } // namespace env
54
55
56
67 namespace
68 {
69
87 Locale _autodetectTextLocale()
88 {
89 Locale ret( Locale::enCode );
90 const char * envlist[] = { "LC_ALL", "LC_MESSAGES", "LANG", NULL };
91 for ( const char ** envvar = envlist; *envvar; ++envvar )
92 {
93 const char * envlang = getenv( *envvar );
94 if ( envlang )
95 {
96 std::string envstr( envlang );
97 if ( envstr != "POSIX" && envstr != "C" )
98 {
99 Locale lang( envstr );
100 if ( lang )
101 {
102 MIL << "Found " << *envvar << "=" << envstr << endl;
103 ret = lang;
104 break;
105 }
106 }
107 }
108 }
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 );
112 return ret;
113 }
114
125 struct ZyppConfIniMap : public IniDict {
126 ZyppConfIniMap( Pathname root_r = "/" )
127 : IniDict { iniMapReadFrom(root_r) }
128 {
129 pMIL( str::sconcat("zypp.conf(", root_r, "):"), *this );
130 pDBG( dump(*this) );
131 }
132
133 private:
135 IniDict iniMapReadFrom( const Pathname & root_r )
136 {
137 pMIL( "Reading zypp.conf for root", root_r );
138 std::optional<Pathname> ZYPP_CONF { env::ZYPP_CONF() };
139 if ( ZYPP_CONF ) {
140 // Read the plain file requested by $ZYPP_CONF
141 pMIL( "$ZYPP_CONF is set to", str::sconcat("'",*ZYPP_CONF,"'") );
142 PathInfo conf { root_r / *ZYPP_CONF };
143 if ( conf.isFile() ) {
144 pMIL( "$ZYPP_CONF requests reading file", conf );
145 return parser::IniDict( conf.path() );
146 } else {
147 pMIL( "$ZYPP_CONF denotes no file below root. Using builtin defaults." );
148 return parser::IniDict();
149 }
150 } else {
151 // Econf mode reading the systems settings
152 return parser::EconfDict( "/zypp/zypp.conf", root_r );
153 }
154 }
155 };
156
158 } // namespace zypp
160
162 template<class Tp>
163 struct Option
164 {
165 using value_type = Tp;
166
168 Option( value_type initial_r )
169 : _val( std::move(initial_r) )
170 {}
171
172 Option & operator=( value_type newval_r )
173 { set( std::move(newval_r) ); return *this; }
174
176 const value_type & get() const
177 { return _val; }
178
180 operator const value_type &() const
181 { return _val; }
182
184 void set( value_type newval_r )
185 { _val = std::move(newval_r); }
186
187 private:
188 value_type _val;
189 };
190
192 template<class Tp>
193 struct DefaultOption : public Option<Tp>
194 {
195 using value_type = Tp;
196 using option_type = Option<Tp>;
197
198 explicit DefaultOption( value_type initial_r )
199 : Option<Tp>( initial_r )
200 , _default( std::move(initial_r) )
201 {}
202
203 DefaultOption & operator=( value_type newval_r )
204 { this->set( std::move(newval_r) ); return *this; }
205
207 void restoreToDefault()
208 { this->set( _default.get() ); }
209
211 void restoreToDefault( value_type newval_r )
212 { setDefault( std::move(newval_r) ); restoreToDefault(); }
213
215 const value_type & getDefault() const
216 { return _default.get(); }
217
219 void setDefault( value_type newval_r )
220 { _default.set( std::move(newval_r) ); }
221
222 private:
223 option_type _default;
224 };
225
227 //
228 // CLASS NAME : ZConfig::Impl
229 //
235 class ZConfig::Impl
236 {
237 using MultiversionSpec = std::set<std::string>;
238
240 struct TargetDefaults
241 {
242 TargetDefaults()
243 : solver_focus ( ResolverFocus::Default )
244 , solver_onlyRequires ( false )
245 , solver_allowVendorChange ( false )
246 , solver_dupAllowDowngrade ( true )
247 , solver_dupAllowNameChange ( true )
248 , solver_dupAllowArchChange ( true )
249 , solver_dupAllowVendorChange ( false )
250 , solver_cleandepsOnRemove ( false )
251 , solver_upgradeTestcasesToKeep ( 2 )
252 , solverUpgradeRemoveDroppedPackages ( true )
253 {}
254
255 bool consume( const std::string & section, const std::string & entry, const std::string & value )
256 {
257 if ( section != "main" )
258 return false;
259
260 if ( entry == "solver.focus" )
261 {
262 fromString( value, solver_focus );
263 }
264 else if ( entry == "solver.onlyRequires" )
265 {
266 solver_onlyRequires.set( str::strToBool( value, solver_onlyRequires ) );
267 }
268 else if ( entry == "solver.allowVendorChange" )
269 {
270 solver_allowVendorChange.set( str::strToBool( value, solver_allowVendorChange ) );
271 }
272 else if ( entry == "solver.dupAllowDowngrade" )
273 {
274 solver_dupAllowDowngrade.set( str::strToBool( value, solver_dupAllowDowngrade ) );
275 }
276 else if ( entry == "solver.dupAllowNameChange" )
277 {
278 solver_dupAllowNameChange.set( str::strToBool( value, solver_dupAllowNameChange ) );
279 }
280 else if ( entry == "solver.dupAllowArchChange" )
281 {
282 solver_dupAllowArchChange.set( str::strToBool( value, solver_dupAllowArchChange ) );
283 }
284 else if ( entry == "solver.dupAllowVendorChange" )
285 {
286 solver_dupAllowVendorChange.set( str::strToBool( value, solver_dupAllowVendorChange ) );
287 }
288 else if ( entry == "solver.cleandepsOnRemove" )
289 {
290 solver_cleandepsOnRemove.set( str::strToBool( value, solver_cleandepsOnRemove ) );
291 }
292 else if ( entry == "solver.upgradeTestcasesToKeep" )
293 {
294 solver_upgradeTestcasesToKeep.set( str::strtonum<unsigned>( value ) );
295 }
296 else if ( entry == "solver.upgradeRemoveDroppedPackages" )
297 {
298 solverUpgradeRemoveDroppedPackages.restoreToDefault( str::strToBool( value, solverUpgradeRemoveDroppedPackages.getDefault() ) );
299 }
300 else
301 return false;
302
303 return true;
304 }
305
306 ResolverFocus solver_focus;
307 Option<bool> solver_onlyRequires;
308 Option<bool> solver_allowVendorChange;
309 Option<bool> solver_dupAllowDowngrade;
310 Option<bool> solver_dupAllowNameChange;
311 Option<bool> solver_dupAllowArchChange;
312 Option<bool> solver_dupAllowVendorChange;
313 Option<bool> solver_cleandepsOnRemove;
314 Option<unsigned> solver_upgradeTestcasesToKeep;
315 DefaultOption<bool> solverUpgradeRemoveDroppedPackages;
316 };
317
318 public:
319 Impl()
320 : cfg_arch ( defaultSystemArchitecture() )
321 , cfg_textLocale ( defaultTextLocale() )
322 , cfg_cache_path { "/var/cache/zypp" }
323 , cfg_metadata_path { "" } // empty - follows cfg_cache_path
324 , cfg_solvfiles_path { "" } // empty - follows cfg_cache_path
325 , cfg_packages_path { "" } // empty - follows cfg_cache_path
326 , updateMessagesNotify ( "" )
327 , repo_add_probe ( false )
328 , repo_refresh_delay ( 10 )
329 , repoLabelIsAlias ( false )
330 , download_use_deltarpm ( APIConfig(LIBZYPP_CONFIG_USE_DELTARPM_BY_DEFAULT) )
331 , download_use_deltarpm_always ( false )
332 , download_media_prefer_download( true )
333 , download_mediaMountdir ( "/var/adm/mount" )
334 , commit_downloadMode ( DownloadDefault )
335 , gpgCheck ( true )
336 , repoGpgCheck ( indeterminate )
337 , pkgGpgCheck ( indeterminate )
338 , apply_locks_file ( true )
339 , pluginsPath ( "/usr/lib/zypp/plugins" )
340 , geoipEnabled ( true )
341 , geoipHosts { "download.opensuse.org" }
342 {
343 MIL << "libzypp: " LIBZYPP_VERSION_STRING << " (" << LIBZYPP_CODESTREAM << ")" << endl;
344
345 ZyppConfIniMap iniMap; // Scan the default zypp.conf settings
346
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 ) ) {
351
352 if ( _initialTargetDefaults.consume( section, entry, value ) )
353 continue;
354
355 if ( _mediaConf.setConfigValue( section, entry, value ) )
356 continue;
357
358 if ( section == "main" )
359 {
360 if ( entry == "lock_timeout" )
361 {
362 str::strtonum( value, cfg_lockTimeout );
363 }
364 else if ( entry == "arch" )
365 {
366 Arch carch( value );
367 if ( carch != cfg_arch ) {
368 WAR << "Overriding system architecture (" << cfg_arch << "): " << carch << endl;
369 cfg_arch = carch;
370 }
371 }
372 else if ( entry == "cachedir" )
373 {
374 cfg_cache_path.restoreToDefault( value );
375 }
376 else if ( entry == "metadatadir" )
377 {
378 cfg_metadata_path.restoreToDefault( value );
379 }
380 else if ( entry == "solvfilesdir" )
381 {
382 cfg_solvfiles_path.restoreToDefault( value );
383 }
384 else if ( entry == "packagesdir" )
385 {
386 cfg_packages_path.restoreToDefault( value );
387 }
388 else if ( entry == "configdir" )
389 {
390 cfg_config_path = Pathname(value);
391 }
392 else if ( entry == "reposdir" )
393 {
394 cfg_known_repos_path = Pathname(value);
395 }
396 else if ( entry == "servicesdir" )
397 {
398 cfg_known_services_path = Pathname(value);
399 }
400 else if ( entry == "varsdir" )
401 {
402 cfg_vars_path = Pathname(value);
403 }
404 else if ( entry == "repo.add.probe" )
405 {
406 repo_add_probe = str::strToBool( value, repo_add_probe );
407 }
408 else if ( entry == "repo.refresh.delay" )
409 {
410 str::strtonum(value, repo_refresh_delay);
411 }
412 else if ( entry == "repo.refresh.locales" )
413 {
414 std::vector<std::string> tmp;
415 str::split( value, back_inserter( tmp ), ", \t" );
416
417 boost::function<Locale(const std::string &)> transform(
418 [](const std::string & str_r)->Locale{ return Locale(str_r); }
419 );
420 repoRefreshLocales.insert( make_transform_iterator( tmp.begin(), transform ),
421 make_transform_iterator( tmp.end(), transform ) );
422 }
423 else if ( entry == "download.use_deltarpm" )
424 {
425 download_use_deltarpm = str::strToBool( value, download_use_deltarpm );
426 }
427 else if ( entry == "download.use_deltarpm.always" )
428 {
429 download_use_deltarpm_always = str::strToBool( value, download_use_deltarpm_always );
430 }
431 else if ( entry == "download.media_preference" )
432 {
433 download_media_prefer_download.restoreToDefault( str::compareCI( value, "volatile" ) != 0 );
434 }
435 else if ( entry == "download.media_mountdir" )
436 {
437 download_mediaMountdir.restoreToDefault( Pathname(value) );
438 }
439 else if ( entry == "download.use_geoip_mirror") {
440 geoipEnabled = str::strToBool( value, geoipEnabled );
441 }
442 else if ( entry == "commit.downloadMode" )
443 {
444 commit_downloadMode.set( deserializeDownloadMode( value ) );
445 }
446 else if ( entry == "gpgcheck" )
447 {
448 gpgCheck.restoreToDefault( str::strToBool( value, gpgCheck ) );
449 }
450 else if ( entry == "repo_gpgcheck" )
451 {
452 repoGpgCheck.restoreToDefault( str::strToTriBool( value ) );
453 }
454 else if ( entry == "pkg_gpgcheck" )
455 {
456 pkgGpgCheck.restoreToDefault( str::strToTriBool( value ) );
457 }
458 else if ( entry == "vendordir" )
459 {
460 cfg_vendor_path = Pathname(value);
461 }
462 else if ( entry == "multiversiondir" )
463 {
464 cfg_multiversion_path = Pathname(value);
465 }
466 else if ( entry == "multiversion.kernels" )
467 {
468 cfg_kernel_keep_spec = value;
469 }
470 else if ( entry == "solver.checkSystemFile" )
471 {
472 solver_checkSystemFile = Pathname(value);
473 }
474 else if ( entry == "solver.checkSystemFileDir" )
475 {
476 solver_checkSystemFileDir = Pathname(value);
477 }
478 else if ( entry == "multiversion" )
479 {
480 MultiversionSpec & defSpec( _multiversionMap.getDefaultSpec() );
481 str::splitEscaped( value, std::inserter( defSpec, defSpec.end() ), ", \t" );
482 }
483 else if ( entry == "locksfile.path" )
484 {
485 locks_file = Pathname(value);
486 }
487 else if ( entry == "locksfile.apply" )
488 {
489 apply_locks_file = str::strToBool( value, apply_locks_file );
490 }
491 else if ( entry == "update.datadir" )
492 {
493 // ignore, this is a constant anyway and should not be user configurabe
494 // update_data_path = Pathname(value);
495 }
496 else if ( entry == "update.scriptsdir" )
497 {
498 // ignore, this is a constant anyway and should not be user configurabe
499 // update_scripts_path = Pathname(value);
500 }
501 else if ( entry == "update.messagessdir" )
502 {
503 // ignore, this is a constant anyway and should not be user configurabe
504 // update_messages_path = Pathname(value);
505 }
506 else if ( entry == "update.messages.notify" )
507 {
508 updateMessagesNotify.set( value );
509 }
510 else if ( entry == "rpm.install.excludedocs" )
511 {
512 rpmInstallFlags.setFlag( target::rpm::RPMINST_EXCLUDEDOCS,
513 str::strToBool( value, false ) );
514 }
515 else if ( entry == "history.logfile" )
516 {
517 history_log_path = Pathname(value);
518 }
519 else if ( entry == "ZYPP_SINGLE_RPMTRANS" || entry == "techpreview.ZYPP_SINGLE_RPMTRANS" )
520 {
521 DBG << "ZYPP_SINGLE_RPMTRANS=" << value << endl;
522 ::setenv( "ZYPP_SINGLE_RPMTRANS", value.c_str(), 0 );
523 }
524 else if ( entry == "techpreview.ZYPP_MEDIANETWORK" )
525 {
526 DBG << "techpreview.ZYPP_MEDIANETWORK=" << value << endl;
527 ::setenv( "ZYPP_MEDIANETWORK", value.c_str(), 1 );
528 }
529 else { // unknown entry
530 pWAR( "zypp.conf: Unknown entry in [main]:", entry, "=", value );
531 }
532 }
533 else if ( section == "env" )
534 {
535 if ( !envMap )
536 envMap = EnvMap();
537 auto [it, inserted] = envMap->emplace( entry, value );
538 if ( !inserted ) {
539 WAR << "zypp.conf [env]: duplicate key '" << entry << "', shadowing previous value '" << it->second << "' with '" << value << "'" << endl;
540 it->second = value;
541 }
542 }
543 else { // unknown section {
544 pWAR( "zypp.conf: Unknown section:", str::sconcat("[",section,"]"), entry, "=", value );
545 }
546 }
547 }
548
549 if ( envMap ) {
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 ) {
554 pWAR( "zypp.conf [env]: set", str::sconcat("'",entry,"=",value,"'"), ": failed", Errno() );
555 }
556 else {
557 pMIL( "zypp.conf [env]: set", str::sconcat("'",entry,"=",value,"'") );
558 }
559 }
560 else {
561 pWAR( "zypp.conf [env]: skip", str::sconcat("'",entry,"=",value,"'"), ": is already set to", str::sconcat("'",exists,"'") );
562 }
563 }
564 }
565
566 // legacy:
567 if ( getenv( "ZYPP_TESTSUITE_FAKE_ARCH" ) )
568 {
569 Arch carch( getenv( "ZYPP_TESTSUITE_FAKE_ARCH" ) );
570 if ( carch != cfg_arch )
571 {
572 WAR << "ZYPP_TESTSUITE_FAKE_ARCH: Overriding system architecture (" << cfg_arch << "): " << carch << endl;
573 cfg_arch = carch;
574 }
575 }
576 MIL << "ZConfig singleton created." << endl;
577 }
578
579 Impl(const Impl &) = delete;
580 Impl(Impl &&) = delete;
581 Impl &operator=(const Impl &) = delete;
582 Impl &operator=(Impl &&) = delete;
583 ~Impl() {}
584
592 Pathname _autodetectSystemRoot() const
593 {
594 Target_Ptr target( getZYpp()->getTarget() );
595 return target ? target->root() : _announced_root_path;
596 }
597
598 void notifyTargetChanged()
599 {
600 _announced_root_path = Pathname(); // first of all reset any previously _announced_root_path
601
602 Pathname newRoot { _autodetectSystemRoot() };
603 MIL << "notifyTargetChanged (" << newRoot << ")" << endl;
604
605 if ( newRoot.emptyOrRoot() ) {
606 _currentTargetDefaults.reset(); // to initial settigns from /
607 }
608 else {
609 _currentTargetDefaults = TargetDefaults();
610 ZyppConfIniMap iniMap { newRoot }; // Scan the zypp.conf settings for newRoot
611 for ( const auto & section : iniMap.sections() ) {
612 for ( const auto & [entry,value] : iniMap.entries( section ) ) {
613 (*_currentTargetDefaults).consume( section, entry, value );
614 }
615 }
616 }
617 }
618
619 public:
620 Pathname _announced_root_path;
621
622 long cfg_lockTimeout = 0; // signed!
623
624 Arch cfg_arch;
625 Locale cfg_textLocale;
626
627 DefaultOption<Pathname> cfg_cache_path; // Settings from the config file are also remembered
628 DefaultOption<Pathname> cfg_metadata_path; // 'default'. Cleanup in RepoManager e.g needs to tell
629 DefaultOption<Pathname> cfg_solvfiles_path; // whether settings in effect are config values or
630 DefaultOption<Pathname> cfg_packages_path; // custom settings applied vie set...Path().
631
632 Pathname cfg_config_path;
633 Pathname cfg_known_repos_path;
634 Pathname cfg_known_services_path;
635 Pathname cfg_vars_path;
636 Pathname cfg_repo_mgr_root_path;
637
638 Pathname cfg_vendor_path;
639 Pathname cfg_multiversion_path;
640 std::string cfg_kernel_keep_spec;
641 Pathname locks_file;
642
643 DefaultOption<std::string> updateMessagesNotify;
644
645 bool repo_add_probe;
646 unsigned repo_refresh_delay;
647 LocaleSet repoRefreshLocales;
648 bool repoLabelIsAlias;
649
650 bool download_use_deltarpm;
651 bool download_use_deltarpm_always;
652 DefaultOption<bool> download_media_prefer_download;
653 DefaultOption<Pathname> download_mediaMountdir;
654
655 Option<DownloadMode> commit_downloadMode;
656
657 DefaultOption<bool> gpgCheck;
658 DefaultOption<TriBool> repoGpgCheck;
659 DefaultOption<TriBool> pkgGpgCheck;
660
661 Pathname solver_checkSystemFile;
662 Pathname solver_checkSystemFileDir;
663
664 MultiversionSpec & multiversion() { return getMultiversion(); }
665 const MultiversionSpec & multiversion() const { return getMultiversion(); }
666
667 bool apply_locks_file;
668
669 target::rpm::RpmInstFlags rpmInstallFlags;
670
671 Pathname history_log_path;
672
673 std::string userData;
674
675 Option<Pathname> pluginsPath;
676
677 bool geoipEnabled;
678
679 std::vector<std::string> geoipHosts;
680
681 /* Other config singleton instances */
682 MediaConfig &_mediaConf = MediaConfig::instance();
683
684
685 public:
686 const TargetDefaults & targetDefaults() const { return _currentTargetDefaults ? *_currentTargetDefaults : _initialTargetDefaults; }
687 TargetDefaults & targetDefaults() { return _currentTargetDefaults ? *_currentTargetDefaults : _initialTargetDefaults; }
688 private:
689 TargetDefaults _initialTargetDefaults;
690 std::optional<TargetDefaults> _currentTargetDefaults;
691
692 private:
693 // HACK for bnc#906096: let pool re-evaluate multiversion spec
694 // if target root changes. ZConfig returns data sensitive to
695 // current target root.
696 // TODO Actually we'd need to scan the target systems zypp.conf and
697 // overlay all system specific values.
698 struct MultiversionMap
699 {
700 using SpecMap = std::map<Pathname, MultiversionSpec>;
701
702 MultiversionSpec & getSpec( Pathname root_r, const Impl & zConfImpl_r ) // from system at root
703 {
704 // _specMap[] - the plain zypp.conf value
705 // _specMap[/] - combine [] and multiversion.d scan
706 // _specMap[root] - scan root/zypp.conf and root/multiversion.d
707
708 if ( root_r.empty() )
709 root_r = "/";
710 bool cacheHit = _specMap.count( root_r );
711 MultiversionSpec & ret( _specMap[root_r] ); // creates new entry on the fly
712
713 if ( ! cacheHit )
714 {
715 // bsc#1193488: If no (/root)/.../zypp.conf exists use the default zypp.conf
716 // multiversion settings. It is a legacy that the packaged multiversion setting
717 // in zypp.conf (the kernel) may differ from the builtin default (empty).
718 // But we want a missing config to behave similar to the default one, otherwise
719 // a bare metal install easily runs into trouble.
720 if ( root_r == "/" || not scanConfAt( root_r, ret, zConfImpl_r ) )
721 ret = _specMap[Pathname()];
722 scanDirAt( root_r, ret, zConfImpl_r ); // add multiversion.d at root_r
723 using zypp::operator<<;
724 MIL << "MultiversionSpec '" << root_r << "' = " << ret << endl;
725 }
726 return ret;
727 }
728
729 MultiversionSpec & getDefaultSpec() // Spec from zypp.conf parsing; called before any getSpec
730 { return _specMap[Pathname()]; }
731
732 private:
733 bool scanConfAt( const Pathname& root_r, MultiversionSpec & spec_r, const Impl & zConfImpl_r )
734 {
735 ZyppConfIniMap iniMap { root_r }; // Scan the zypp.conf settings for root
736 // TODO: iniDict lacks direct value access :(
737 for ( const auto & section : iniMap.sections() ) {
738 for ( const auto & [entry,value] : iniMap.entries( section ) ) {
739 if ( entry == "multiversion" ) {
740 str::splitEscaped( value, std::inserter( spec_r, spec_r.end() ), ", \t" );
741 return true;
742 }
743 }
744 }
745 return false;
746 }
747
748 void scanDirAt( const Pathname& root_r, MultiversionSpec & spec_r, const Impl & zConfImpl_r )
749 {
750 // NOTE: Actually we'd need to scan and use the root_r! zypp.conf values.
751 Pathname multiversionDir( zConfImpl_r.cfg_multiversion_path );
752 if ( multiversionDir.empty() )
753 multiversionDir = ( zConfImpl_r.cfg_config_path.empty()
754 ? Pathname("/etc/zypp")
755 : zConfImpl_r.cfg_config_path ) / "multiversion.d";
756
757 filesystem::dirForEach( Pathname::assertprefix( root_r, multiversionDir ),
758 [&spec_r]( const Pathname & dir_r, const char *const & name_r )->bool
759 {
760 MIL << "Parsing " << dir_r/name_r << endl;
761 iostr::simpleParseFile( InputStream( dir_r/name_r ),
762 [&spec_r]( int num_r, std::string line_r )->bool
763 {
764 DBG << " found " << line_r << endl;
765 spec_r.insert( std::move(line_r) );
766 return true;
767 } );
768 return true;
769 } );
770 }
771
772 private:
773 SpecMap _specMap;
774 };
775
776 MultiversionSpec & getMultiversion() const
777 { return _multiversionMap.getSpec( _autodetectSystemRoot(), *this ); }
778
779 mutable MultiversionMap _multiversionMap;
780 };
781
782
784 //
785 // METHOD NAME : ZConfig::instance
786 // METHOD TYPE : ZConfig &
787 //
788 ZConfig & ZConfig::instance()
789 {
790 static ZConfig _instance; // The singleton
791 return _instance;
792 }
793
795 //
796 // METHOD NAME : ZConfig::ZConfig
797 // METHOD TYPE : Ctor
798 //
799 ZConfig::ZConfig()
800 : _pimpl( new Impl )
801 {
802 about( MIL );
803 }
804
806 //
807 // METHOD NAME : ZConfig::~ZConfig
808 // METHOD TYPE : Dtor
809 //
810 ZConfig::~ZConfig( )
811 {}
812
813 long ZConfig::lockTimeout() const
814 {
815 const char * env = getenv("ZYPP_LOCK_TIMEOUT");
816 if ( env ) {
817 return str::strtonum<long>( env );
818 }
819 return _pimpl->cfg_lockTimeout;
820 }
821
822 void ZConfig::notifyTargetChanged()
823 { return _pimpl->notifyTargetChanged(); }
824
825 Pathname ZConfig::systemRoot() const
826 { return _pimpl->_autodetectSystemRoot(); }
827
828 Pathname ZConfig::repoManagerRoot() const
829 {
830 return ( _pimpl->cfg_repo_mgr_root_path.empty()
831 ? systemRoot() : _pimpl->cfg_repo_mgr_root_path );
832 }
833
834 void ZConfig::setRepoManagerRoot(const zypp::filesystem::Pathname &root)
835 { _pimpl->cfg_repo_mgr_root_path = root; }
836
837 void ZConfig::announceSystemRoot( const Pathname & root_r )
838 { _pimpl->_announced_root_path = root_r; }
839
841 //
842 // system architecture
843 //
845
846 Arch ZConfig::defaultSystemArchitecture()
847 {
848 return Arch::detectSystemArchitecture();
849 }
850
851 Arch ZConfig::systemArchitecture() const
852 { return _pimpl->cfg_arch; }
853
854 void ZConfig::setSystemArchitecture( const Arch & arch_r )
855 {
856 if ( arch_r != _pimpl->cfg_arch )
857 {
858 WAR << "Overriding system architecture (" << _pimpl->cfg_arch << "): " << arch_r << endl;
859 _pimpl->cfg_arch = arch_r;
860 }
861 }
862
864 //
865 // text locale
866 //
868
869 Locale ZConfig::defaultTextLocale()
870 {
871 static Locale _val( _autodetectTextLocale() );
872 return _val;
873 }
874
875 Locale ZConfig::textLocale() const
876 { return _pimpl->cfg_textLocale; }
877
878 void ZConfig::setTextLocale( const Locale & locale_r )
879 {
880 if ( locale_r != _pimpl->cfg_textLocale )
881 {
882 WAR << "Overriding text locale (" << _pimpl->cfg_textLocale << "): " << locale_r << endl;
883 _pimpl->cfg_textLocale = locale_r;
884 // Propagate changes
885 sat::Pool::instance().setTextLocale( locale_r );
886 }
887 }
888
890 // user data
892
893 bool ZConfig::hasUserData() const
894 { return !_pimpl->userData.empty(); }
895
896 std::string ZConfig::userData() const
897 { return _pimpl->userData; }
898
899 bool ZConfig::setUserData( const std::string & str_r )
900 {
901 for_( ch, str_r.begin(), str_r.end() )
902 {
903 if ( *ch < ' ' && *ch != '\t' )
904 {
905 ERR << "New user data string rejectded: char " << (int)*ch << " at position " << (ch - str_r.begin()) << endl;
906 return false;
907 }
908 }
909 MIL << "Set user data string to '" << str_r << "'" << endl;
910 _pimpl->userData = str_r;
911 return true;
912 }
913
915
916 Pathname ZConfig::repoCachePath() const
917 {
918 return ( _pimpl->cfg_cache_path.get().empty()
919 ? Pathname("/var/cache/zypp") : _pimpl->cfg_cache_path.get() );
920 }
921
922 Pathname ZConfig::pubkeyCachePath() const
923 {
924 return repoCachePath()/"pubkeys";
925 }
926
927 void ZConfig::setRepoCachePath(const zypp::filesystem::Pathname &path_r)
928 {
929 _pimpl->cfg_cache_path = path_r;
930 }
931
932 Pathname ZConfig::repoMetadataPath() const
933 {
934 return ( _pimpl->cfg_metadata_path.get().empty()
935 ? (repoCachePath()/"raw") : _pimpl->cfg_metadata_path.get() );
936 }
937
938 void ZConfig::setRepoMetadataPath(const zypp::filesystem::Pathname &path_r)
939 {
940 _pimpl->cfg_metadata_path = path_r;
941 }
942
943 Pathname ZConfig::repoSolvfilesPath() const
944 {
945 return ( _pimpl->cfg_solvfiles_path.get().empty()
946 ? (repoCachePath()/"solv") : _pimpl->cfg_solvfiles_path.get() );
947 }
948
949 void ZConfig::setRepoSolvfilesPath(const zypp::filesystem::Pathname &path_r)
950 {
951 _pimpl->cfg_solvfiles_path = path_r;
952 }
953
954 Pathname ZConfig::repoPackagesPath() const
955 {
956 return ( _pimpl->cfg_packages_path.get().empty()
957 ? (repoCachePath()/"packages") : _pimpl->cfg_packages_path.get() );
958 }
959
960 void ZConfig::setRepoPackagesPath(const zypp::filesystem::Pathname &path_r)
961 {
962 _pimpl->cfg_packages_path = path_r;
963 }
964
965 Pathname ZConfig::builtinRepoCachePath() const
966 { return _pimpl->cfg_cache_path.getDefault().empty() ? Pathname("/var/cache/zypp") : _pimpl->cfg_cache_path.getDefault(); }
967
968 Pathname ZConfig::builtinRepoMetadataPath() const
969 { return _pimpl->cfg_metadata_path.getDefault().empty() ? (builtinRepoCachePath()/"raw") : _pimpl->cfg_metadata_path.getDefault(); }
970
971 Pathname ZConfig::builtinRepoSolvfilesPath() const
972 { return _pimpl->cfg_solvfiles_path.getDefault().empty() ? (builtinRepoCachePath()/"solv") : _pimpl->cfg_solvfiles_path.getDefault(); }
973
974 Pathname ZConfig::builtinRepoPackagesPath() const
975 { return _pimpl->cfg_packages_path.getDefault().empty() ? (builtinRepoCachePath()/"packages") : _pimpl->cfg_packages_path.getDefault(); }
976
978
979 Pathname ZConfig::configPath() const
980 {
981 return ( _pimpl->cfg_config_path.empty()
982 ? Pathname("/etc/zypp") : _pimpl->cfg_config_path );
983 }
984
985 Pathname ZConfig::knownReposPath() const
986 {
987 return ( _pimpl->cfg_known_repos_path.empty()
988 ? (configPath()/"repos.d") : _pimpl->cfg_known_repos_path );
989 }
990
991 Pathname ZConfig::knownServicesPath() const
992 {
993 return ( _pimpl->cfg_known_services_path.empty()
994 ? (configPath()/"services.d") : _pimpl->cfg_known_services_path );
995 }
996
997 Pathname ZConfig::needrebootFile() const
998 { return configPath()/"needreboot"; }
999
1000 Pathname ZConfig::needrebootPath() const
1001 { return configPath()/"needreboot.d"; }
1002
1003 void ZConfig::setGeoipEnabled( bool enable )
1004 { _pimpl->geoipEnabled = enable; }
1005
1006 bool ZConfig::geoipEnabled () const
1007 { return _pimpl->geoipEnabled; }
1008
1009 Pathname ZConfig::geoipCachePath() const
1010 { return builtinRepoCachePath()/"geoip.d"; }
1011
1012 const std::vector<std::string> ZConfig::geoipHostnames () const
1013 { return _pimpl->geoipHosts; }
1014
1015 Pathname ZConfig::varsPath() const
1016 {
1017 return ( _pimpl->cfg_vars_path.empty()
1018 ? (configPath()/"vars.d") : _pimpl->cfg_vars_path );
1019 }
1020
1021 Pathname ZConfig::vendorPath() const
1022 {
1023 return ( _pimpl->cfg_vendor_path.empty()
1024 ? (configPath()/"vendors.d") : _pimpl->cfg_vendor_path );
1025 }
1026
1027 Pathname ZConfig::locksFile() const
1028 {
1029 return ( _pimpl->locks_file.empty()
1030 ? (configPath()/"locks") : _pimpl->locks_file );
1031 }
1032
1034
1035 bool ZConfig::repo_add_probe() const
1036 { return _pimpl->repo_add_probe; }
1037
1038 unsigned ZConfig::repo_refresh_delay() const
1039 { return _pimpl->repo_refresh_delay; }
1040
1041 LocaleSet ZConfig::repoRefreshLocales() const
1042 { return _pimpl->repoRefreshLocales.empty() ? Target::requestedLocales("") :_pimpl->repoRefreshLocales; }
1043
1044 bool ZConfig::repoLabelIsAlias() const
1045 { return _pimpl->repoLabelIsAlias; }
1046
1047 void ZConfig::repoLabelIsAlias( bool yesno_r )
1048 { _pimpl->repoLabelIsAlias = yesno_r; }
1049
1050 bool ZConfig::download_use_deltarpm() const
1051 { return _pimpl->download_use_deltarpm; }
1052
1053 bool ZConfig::download_use_deltarpm_always() const
1054 { return download_use_deltarpm() && _pimpl->download_use_deltarpm_always; }
1055
1056 bool ZConfig::download_media_prefer_download() const
1057 { return _pimpl->download_media_prefer_download; }
1058
1059 void ZConfig::set_download_media_prefer_download( bool yesno_r )
1060 { _pimpl->download_media_prefer_download.set( yesno_r ); }
1061
1062 void ZConfig::set_default_download_media_prefer_download()
1063 { _pimpl->download_media_prefer_download.restoreToDefault(); }
1064
1065 long ZConfig::download_max_concurrent_connections() const
1066 { return _pimpl->_mediaConf.download_max_concurrent_connections(); }
1067
1068 long ZConfig::download_min_download_speed() const
1069 { return _pimpl->_mediaConf.download_min_download_speed(); }
1070
1071 long ZConfig::download_max_download_speed() const
1072 { return _pimpl->_mediaConf.download_max_download_speed(); }
1073
1074 long ZConfig::download_max_silent_tries() const
1075 { return _pimpl->_mediaConf.download_max_silent_tries(); }
1076
1077 long ZConfig::download_transfer_timeout() const
1078 { return _pimpl->_mediaConf.download_transfer_timeout(); }
1079
1080 Pathname ZConfig::download_mediaMountdir() const { return _pimpl->download_mediaMountdir; }
1081 void ZConfig::set_download_mediaMountdir( Pathname newval_r ) { _pimpl->download_mediaMountdir.set( std::move(newval_r) ); }
1082 void ZConfig::set_default_download_mediaMountdir() { _pimpl->download_mediaMountdir.restoreToDefault(); }
1083
1084 DownloadMode ZConfig::commit_downloadMode() const
1085 { return _pimpl->commit_downloadMode; }
1086
1087
1088 bool ZConfig::gpgCheck() const { return _pimpl->gpgCheck; }
1089 TriBool ZConfig::repoGpgCheck() const { return _pimpl->repoGpgCheck; }
1090 TriBool ZConfig::pkgGpgCheck() const { return _pimpl->pkgGpgCheck; }
1091
1092 void ZConfig::setGpgCheck( bool val_r ) { _pimpl->gpgCheck.set( val_r ); }
1093 void ZConfig::setRepoGpgCheck( TriBool val_r ) { _pimpl->repoGpgCheck.set( val_r ); }
1094 void ZConfig::setPkgGpgCheck( TriBool val_r ) { _pimpl->pkgGpgCheck.set( val_r ); }
1095
1096 void ZConfig::resetGpgCheck() { _pimpl->gpgCheck.restoreToDefault(); }
1097 void ZConfig::resetRepoGpgCheck() { _pimpl->repoGpgCheck.restoreToDefault(); }
1098 void ZConfig::resetPkgGpgCheck() { _pimpl->pkgGpgCheck.restoreToDefault(); }
1099
1100
1101 ResolverFocus ZConfig::solver_focus() const { return _pimpl->targetDefaults().solver_focus; }
1102 bool ZConfig::solver_onlyRequires() const { return _pimpl->targetDefaults().solver_onlyRequires; }
1103 bool ZConfig::solver_allowVendorChange() const { return _pimpl->targetDefaults().solver_allowVendorChange; }
1104 bool ZConfig::solver_dupAllowDowngrade() const { return _pimpl->targetDefaults().solver_dupAllowDowngrade; }
1105 bool ZConfig::solver_dupAllowNameChange() const { return _pimpl->targetDefaults().solver_dupAllowNameChange; }
1106 bool ZConfig::solver_dupAllowArchChange() const { return _pimpl->targetDefaults().solver_dupAllowArchChange; }
1107 bool ZConfig::solver_dupAllowVendorChange() const { return _pimpl->targetDefaults().solver_dupAllowVendorChange; }
1108 bool ZConfig::solver_cleandepsOnRemove() const { return _pimpl->targetDefaults().solver_cleandepsOnRemove; }
1109 unsigned ZConfig::solver_upgradeTestcasesToKeep() const { return _pimpl->targetDefaults().solver_upgradeTestcasesToKeep; }
1110
1111 bool ZConfig::solverUpgradeRemoveDroppedPackages() const { return _pimpl->targetDefaults().solverUpgradeRemoveDroppedPackages; }
1112 void ZConfig::setSolverUpgradeRemoveDroppedPackages( bool val_r ) { _pimpl->targetDefaults().solverUpgradeRemoveDroppedPackages.set( val_r ); }
1113 void ZConfig::resetSolverUpgradeRemoveDroppedPackages() { _pimpl->targetDefaults().solverUpgradeRemoveDroppedPackages.restoreToDefault(); }
1114
1115
1116 Pathname ZConfig::solver_checkSystemFile() const
1117 { return ( _pimpl->solver_checkSystemFile.empty()
1118 ? (configPath()/"systemCheck") : _pimpl->solver_checkSystemFile ); }
1119
1120 Pathname ZConfig::solver_checkSystemFileDir() const
1121 { return ( _pimpl->solver_checkSystemFileDir.empty()
1122 ? (configPath()/"systemCheck.d") : _pimpl->solver_checkSystemFileDir ); }
1123
1124
1125 namespace
1126 {
1127 inline void sigMultiversionSpecChanged()
1128 {
1129 if ( sat::detail::PoolMember::poolValid () )
1130 sat::detail::PoolMember::myPool().multiversionSpecChanged();
1131 }
1132 }
1133
1134 const std::set<std::string> & ZConfig::multiversionSpec() const { return _pimpl->multiversion(); }
1135 void ZConfig::multiversionSpec( std::set<std::string> new_r ) { _pimpl->multiversion().swap( new_r ); sigMultiversionSpecChanged(); }
1136 void ZConfig::clearMultiversionSpec() { _pimpl->multiversion().clear(); sigMultiversionSpecChanged(); }
1137 void ZConfig::addMultiversionSpec( const std::string & name_r ) { _pimpl->multiversion().insert( name_r ); sigMultiversionSpecChanged(); }
1138 void ZConfig::removeMultiversionSpec( const std::string & name_r ) { _pimpl->multiversion().erase( name_r ); sigMultiversionSpecChanged(); }
1139
1140 bool ZConfig::apply_locks_file() const
1141 { return _pimpl->apply_locks_file; }
1142
1143 Pathname ZConfig::update_dataPath()
1144#if LEGACY(1735)
1145 const
1146#endif
1147 {
1148 return Pathname("/var/adm");
1149 }
1150
1151 Pathname ZConfig::update_messagesPath()
1152#if LEGACY(1735)
1153 const
1154#endif
1155 {
1156 return Pathname(update_dataPath()/"update-messages");
1157 }
1158
1159 Pathname ZConfig::update_scriptsPath()
1160#if LEGACY(1735)
1161 const
1162#endif
1163 {
1164 return Pathname(update_dataPath()/"update-scripts");
1165 }
1166
1167 std::string ZConfig::updateMessagesNotify() const
1168 { return _pimpl->updateMessagesNotify; }
1169
1170 void ZConfig::setUpdateMessagesNotify( const std::string & val_r )
1171 { _pimpl->updateMessagesNotify.set( val_r ); }
1172
1173 void ZConfig::resetUpdateMessagesNotify()
1174 { _pimpl->updateMessagesNotify.restoreToDefault(); }
1175
1177
1178 target::rpm::RpmInstFlags ZConfig::rpmInstallFlags() const
1179 { return _pimpl->rpmInstallFlags; }
1180
1181
1182 Pathname ZConfig::historyLogFile() const
1183 {
1184 return ( _pimpl->history_log_path.empty() ?
1185 Pathname("/var/log/zypp/history") : _pimpl->history_log_path );
1186 }
1187
1188 Pathname ZConfig::credentialsGlobalDir() const
1189 {
1190 return _pimpl->_mediaConf.credentialsGlobalDir();
1191 }
1192
1193 Pathname ZConfig::credentialsGlobalFile() const
1194 {
1195 return _pimpl->_mediaConf.credentialsGlobalFile();
1196 }
1197
1199
1200 std::string ZConfig::distroverpkg() const
1201 { return "system-release"; }
1202
1204
1205 Pathname ZConfig::pluginsPath() const
1206 { return _pimpl->pluginsPath.get(); }
1207
1208 std::string ZConfig::multiversionKernels() const
1209 {
1210 return _pimpl->cfg_kernel_keep_spec;
1211 }
1212
1214
1215 std::ostream & ZConfig::about( std::ostream & str ) const
1216 {
1217 str << "libzypp: " LIBZYPP_VERSION_STRING << " (" << LIBZYPP_CODESTREAM << ")" << endl;
1218
1219 str << "libsolv: " << solv_version;
1220 if ( ::strcmp( solv_version, LIBSOLV_VERSION_STRING ) )
1221 str << " (built against " << LIBSOLV_VERSION_STRING << ")";
1222 str << endl;
1223
1224 str << "TextLocale: '" << textLocale() << "' (" << defaultTextLocale() << ")" << endl;
1225 str << "SystemArchitecture: '" << systemArchitecture() << "' (" << defaultSystemArchitecture() << ")" << endl;
1226 return str;
1227 }
1228
1230} // namespace zypp
for_
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition Easy.h:27
Errno.h
IOStream.h
LogTools.h
pWAR
#define pWAR
Definition LogTools.h:316
pMIL
#define pMIL
Definition LogTools.h:315
pDBG
#define pDBG
Definition LogTools.h:314
DBG
#define DBG
Definition Logger.h:102
MIL
#define MIL
Definition Logger.h:103
ERR
#define ERR
Definition Logger.h:105
WAR
#define WAR
Definition Logger.h:104
Pool.h
Regex.h
String.h
ZConfig.h
ZYppFactory.h
Target_Ptr
zypp::Arch
Architecture.
Definition Arch.h:37
zypp::Arch::detectSystemArchitecture
static Arch detectSystemArchitecture()
Determine system architecture evaluating uname and /proc/cpuinfo.
Definition Arch.cc:701
zypp::Errno
Convenience errno wrapper.
Definition Errno.h:26
zypp::InputStream
Helper to create and pass std::istream.
Definition inputstream.h:57
zypp::Locale
'Language[_Country]' codes.
Definition Locale.h:51
zypp::Locale::enCode
static const Locale enCode
Last resort "en".
Definition Locale.h:78
zypp::MediaConfig
Definition mediaconfig.h:43
zypp::MediaConfig::instance
static MediaConfig & instance()
Definition mediaconfig.cc:46
zypp::Pathname::assertprefix
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.
Definition Pathname.cc:272
zypp::Target::requestedLocales
LocaleSet requestedLocales() const
Languages to be supported by the system.
Definition Target.cc:94
zypp::ZConfig::Impl
ZConfig implementation.
Definition ZConfig.cc:236
zypp::ZConfig::Impl::cfg_multiversion_path
Pathname cfg_multiversion_path
Definition ZConfig.cc:639
zypp::ZConfig::Impl::download_mediaMountdir
DefaultOption< Pathname > download_mediaMountdir
Definition ZConfig.cc:653
zypp::ZConfig::Impl::_mediaConf
MediaConfig & _mediaConf
Definition ZConfig.cc:682
zypp::ZConfig::Impl::cfg_metadata_path
DefaultOption< Pathname > cfg_metadata_path
Definition ZConfig.cc:628
zypp::ZConfig::Impl::cfg_known_repos_path
Pathname cfg_known_repos_path
Definition ZConfig.cc:633
zypp::ZConfig::Impl::cfg_known_services_path
Pathname cfg_known_services_path
Definition ZConfig.cc:634
zypp::ZConfig::Impl::_autodetectSystemRoot
Pathname _autodetectSystemRoot() const
bsc#1237044: Provide announceSystemRoot to allow commands using –root without launching a Target.
Definition ZConfig.cc:592
zypp::ZConfig::Impl::cfg_vars_path
Pathname cfg_vars_path
Definition ZConfig.cc:635
zypp::ZConfig::Impl::operator=
Impl & operator=(const Impl &)=delete
zypp::ZConfig::Impl::operator=
Impl & operator=(Impl &&)=delete
zypp::ZConfig::Impl::cfg_packages_path
DefaultOption< Pathname > cfg_packages_path
Definition ZConfig.cc:630
zypp::ZConfig::Impl::download_use_deltarpm_always
bool download_use_deltarpm_always
Definition ZConfig.cc:651
zypp::ZConfig::Impl::notifyTargetChanged
void notifyTargetChanged()
Definition ZConfig.cc:598
zypp::ZConfig::Impl::solver_checkSystemFile
Pathname solver_checkSystemFile
Definition ZConfig.cc:661
zypp::ZConfig::Impl::Impl
Impl(const Impl &)=delete
zypp::ZConfig::Impl::_multiversionMap
MultiversionMap _multiversionMap
Definition ZConfig.cc:779
zypp::ZConfig::Impl::apply_locks_file
bool apply_locks_file
Definition ZConfig.cc:667
zypp::ZConfig::Impl::history_log_path
Pathname history_log_path
Definition ZConfig.cc:671
zypp::ZConfig::Impl::locks_file
Pathname locks_file
Definition ZConfig.cc:641
zypp::ZConfig::Impl::targetDefaults
const TargetDefaults & targetDefaults() const
Definition ZConfig.cc:686
zypp::ZConfig::Impl::getMultiversion
MultiversionSpec & getMultiversion() const
Definition ZConfig.cc:776
zypp::ZConfig::Impl::Impl
Impl(Impl &&)=delete
zypp::ZConfig::Impl::repoRefreshLocales
LocaleSet repoRefreshLocales
Definition ZConfig.cc:647
zypp::ZConfig::Impl::cfg_cache_path
DefaultOption< Pathname > cfg_cache_path
Definition ZConfig.cc:627
zypp::ZConfig::Impl::geoipHosts
std::vector< std::string > geoipHosts
Definition ZConfig.cc:679
zypp::ZConfig::Impl::targetDefaults
TargetDefaults & targetDefaults()
Definition ZConfig.cc:687
zypp::ZConfig::Impl::~Impl
~Impl()
Definition ZConfig.cc:583
zypp::ZConfig::Impl::_announced_root_path
Pathname _announced_root_path
Definition ZConfig.cc:620
zypp::ZConfig::Impl::pluginsPath
Option< Pathname > pluginsPath
Definition ZConfig.cc:675
zypp::ZConfig::Impl::userData
std::string userData
Definition ZConfig.cc:673
zypp::ZConfig::Impl::cfg_kernel_keep_spec
std::string cfg_kernel_keep_spec
Definition ZConfig.cc:640
zypp::ZConfig::Impl::cfg_lockTimeout
long cfg_lockTimeout
Definition ZConfig.cc:622
zypp::ZConfig::Impl::repoGpgCheck
DefaultOption< TriBool > repoGpgCheck
Definition ZConfig.cc:658
zypp::ZConfig::Impl::repo_refresh_delay
unsigned repo_refresh_delay
Definition ZConfig.cc:646
zypp::ZConfig::Impl::commit_downloadMode
Option< DownloadMode > commit_downloadMode
Definition ZConfig.cc:655
zypp::ZConfig::Impl::_currentTargetDefaults
std::optional< TargetDefaults > _currentTargetDefaults
TargetDefaults while –root.
Definition ZConfig.cc:690
zypp::ZConfig::Impl::repo_add_probe
bool repo_add_probe
Definition ZConfig.cc:645
zypp::ZConfig::Impl::multiversion
MultiversionSpec & multiversion()
Definition ZConfig.cc:664
zypp::ZConfig::Impl::cfg_textLocale
Locale cfg_textLocale
Definition ZConfig.cc:625
zypp::ZConfig::Impl::cfg_arch
Arch cfg_arch
Definition ZConfig.cc:624
zypp::ZConfig::Impl::geoipEnabled
bool geoipEnabled
Definition ZConfig.cc:677
zypp::ZConfig::Impl::download_media_prefer_download
DefaultOption< bool > download_media_prefer_download
Definition ZConfig.cc:652
zypp::ZConfig::Impl::download_use_deltarpm
bool download_use_deltarpm
Definition ZConfig.cc:650
zypp::ZConfig::Impl::MultiversionSpec
std::set< std::string > MultiversionSpec
Definition ZConfig.cc:237
zypp::ZConfig::Impl::repoLabelIsAlias
bool repoLabelIsAlias
Definition ZConfig.cc:648
zypp::ZConfig::Impl::solver_checkSystemFileDir
Pathname solver_checkSystemFileDir
Definition ZConfig.cc:662
zypp::ZConfig::Impl::cfg_config_path
Pathname cfg_config_path
Definition ZConfig.cc:632
zypp::ZConfig::Impl::_initialTargetDefaults
TargetDefaults _initialTargetDefaults
Initial TargetDefaults from /.
Definition ZConfig.cc:689
zypp::ZConfig::Impl::rpmInstallFlags
target::rpm::RpmInstFlags rpmInstallFlags
Definition ZConfig.cc:669
zypp::ZConfig::Impl::multiversion
const MultiversionSpec & multiversion() const
Definition ZConfig.cc:665
zypp::ZConfig::Impl::cfg_repo_mgr_root_path
Pathname cfg_repo_mgr_root_path
Definition ZConfig.cc:636
zypp::ZConfig::Impl::pkgGpgCheck
DefaultOption< TriBool > pkgGpgCheck
Definition ZConfig.cc:659
zypp::ZConfig::Impl::updateMessagesNotify
DefaultOption< std::string > updateMessagesNotify
Definition ZConfig.cc:643
zypp::ZConfig::Impl::cfg_vendor_path
Pathname cfg_vendor_path
Definition ZConfig.cc:638
zypp::ZConfig::Impl::cfg_solvfiles_path
DefaultOption< Pathname > cfg_solvfiles_path
Definition ZConfig.cc:629
zypp::ZConfig::Impl::Impl
Impl()
Definition ZConfig.cc:319
zypp::ZConfig::Impl::gpgCheck
DefaultOption< bool > gpgCheck
Definition ZConfig.cc:657
zypp::ZConfig::hasUserData
bool hasUserData() const
Whether a (non empty) user data sting is defined.
Definition ZConfig.cc:893
zypp::ZConfig::solver_cleandepsOnRemove
bool solver_cleandepsOnRemove() const
Whether removing a package should also remove no longer needed requirements.
Definition ZConfig.cc:1108
zypp::ZConfig::userData
std::string userData() const
User defined string value to be passed to log, history, plugins...
Definition ZConfig.cc:896
zypp::ZConfig::knownServicesPath
Pathname knownServicesPath() const
Path where the known services .service files are kept (configPath()/services.d).
Definition ZConfig.cc:991
zypp::ZConfig::removeMultiversionSpec
void removeMultiversionSpec(const std::string &name_r)
Definition ZConfig.cc:1138
zypp::ZConfig::repoPackagesPath
Pathname repoPackagesPath() const
Path where the repo packages are downloaded and kept (repoCachePath()/packages).
Definition ZConfig.cc:954
zypp::ZConfig::repo_refresh_delay
unsigned repo_refresh_delay() const
Amount of time in minutes that must pass before another refresh.
Definition ZConfig.cc:1038
zypp::ZConfig::systemArchitecture
Arch systemArchitecture() const
The system architecture zypp uses.
Definition ZConfig.cc:851
zypp::ZConfig::textLocale
Locale textLocale() const
The locale for translated texts zypp uses.
Definition ZConfig.cc:875
zypp::ZConfig::geoipHostnames
const std::vector< std::string > geoipHostnames() const
All hostnames we want to rewrite using the geoip feature.
Definition ZConfig.cc:1012
zypp::ZConfig::ZConfig
ZConfig(const ZConfig &)=delete
zypp::ZConfig::update_dataPath
static Pathname update_dataPath()
Path where the update items are kept (/var/adm).
Definition ZConfig.cc:1143
zypp::ZConfig::solver_focus
ResolverFocus solver_focus() const
The resolver's general attitude when resolving jobs.
Definition ZConfig.cc:1101
zypp::ZConfig::builtinRepoSolvfilesPath
Pathname builtinRepoSolvfilesPath() const
The builtin config file value.
Definition ZConfig.cc:971
zypp::ZConfig::pluginsPath
Pathname pluginsPath() const
Defaults to /usr/lib/zypp/plugins.
Definition ZConfig.cc:1205
zypp::ZConfig::repoManagerRoot
Pathname repoManagerRoot() const
The RepoManager root directory.
Definition ZConfig.cc:828
zypp::ZConfig::resetRepoGpgCheck
void resetRepoGpgCheck()
Reset to the zconfig default.
Definition ZConfig.cc:1097
zypp::ZConfig::gpgCheck
bool gpgCheck() const
Turn signature checking on/off (on).
Definition ZConfig.cc:1088
zypp::ZConfig::knownReposPath
Pathname knownReposPath() const
Path where the known repositories .repo files are kept (configPath()/repos.d).
Definition ZConfig.cc:985
zypp::ZConfig::download_transfer_timeout
long download_transfer_timeout() const
Maximum time in seconds that you allow a transfer operation to take.
Definition ZConfig.cc:1077
zypp::ZConfig::setRepoManagerRoot
void setRepoManagerRoot(const Pathname &root)
Sets the RepoManager root directory.
Definition ZConfig.cc:834
zypp::ZConfig::solver_dupAllowArchChange
bool solver_dupAllowArchChange() const
DUP tune: Whether to allow package arch changes upon DUP.
Definition ZConfig.cc:1106
zypp::ZConfig::setTextLocale
void setTextLocale(const Locale &locale_r)
Set the preferred locale for translated texts.
Definition ZConfig.cc:878
zypp::ZConfig::solverUpgradeRemoveDroppedPackages
bool solverUpgradeRemoveDroppedPackages() const
Whether dist upgrade should remove a products dropped packages (true).
Definition ZConfig.cc:1111
zypp::ZConfig::notifyTargetChanged
void notifyTargetChanged()
internal
Definition ZConfig.cc:822
zypp::ZConfig::defaultTextLocale
static Locale defaultTextLocale()
The autodetected preferred locale for translated texts.
Definition ZConfig.cc:869
zypp::ZConfig::download_mediaMountdir
Pathname download_mediaMountdir() const
Path where media are preferably mounted or downloaded.
Definition ZConfig.cc:1080
zypp::ZConfig::update_scriptsPath
static Pathname update_scriptsPath()
Path where the update scripts are stored ( /var/adm/update-scripts ).
Definition ZConfig.cc:1159
zypp::ZConfig::resetSolverUpgradeRemoveDroppedPackages
void resetSolverUpgradeRemoveDroppedPackages()
Reset solverUpgradeRemoveDroppedPackages to the zypp.conf default.
Definition ZConfig.cc:1113
zypp::ZConfig::apply_locks_file
bool apply_locks_file() const
Whether locks file should be read and applied after start (true).
Definition ZConfig.cc:1140
zypp::ZConfig::solver_allowVendorChange
bool solver_allowVendorChange() const
Whether vendor check is by default enabled.
Definition ZConfig.cc:1103
zypp::ZConfig::set_default_download_mediaMountdir
void set_default_download_mediaMountdir()
Reset to zypp.cong default.
Definition ZConfig.cc:1082
zypp::ZConfig::repoCachePath
Pathname repoCachePath() const
Path where the caches are kept (/var/cache/zypp).
Definition ZConfig.cc:916
zypp::ZConfig::setPkgGpgCheck
void setPkgGpgCheck(TriBool val_r)
Change the value.
Definition ZConfig.cc:1094
zypp::ZConfig::needrebootPath
Pathname needrebootPath() const
Path where the custom needreboot config files are kept (configPath()/needreboot.d).
Definition ZConfig.cc:1000
zypp::ZConfig::setUserData
bool setUserData(const std::string &str_r)
Set a new userData string.
Definition ZConfig.cc:899
zypp::ZConfig::systemRoot
Pathname systemRoot() const
The target root directory.
Definition ZConfig.cc:825
zypp::ZConfig::download_max_silent_tries
long download_max_silent_tries() const
Maximum silent tries.
Definition ZConfig.cc:1074
zypp::ZConfig::repo_add_probe
bool repo_add_probe() const
Whether repository urls should be probed.
Definition ZConfig.cc:1035
zypp::ZConfig::rpmInstallFlags
target::rpm::RpmInstFlags rpmInstallFlags() const
The default target::rpm::RpmInstFlags for ZYppCommitPolicy.
Definition ZConfig.cc:1178
zypp::ZConfig::setUpdateMessagesNotify
void setUpdateMessagesNotify(const std::string &val_r)
Set a new command definition (see update.messages.notify in zypp.conf).
Definition ZConfig.cc:1170
zypp::ZConfig::solver_upgradeTestcasesToKeep
unsigned solver_upgradeTestcasesToKeep() const
When committing a dist upgrade (e.g.
Definition ZConfig.cc:1109
zypp::ZConfig::repoMetadataPath
Pathname repoMetadataPath() const
Path where the repo metadata is downloaded and kept (repoCachePath()/raw).
Definition ZConfig.cc:932
zypp::ZConfig::geoipCachePath
Pathname geoipCachePath() const
Path where the geoip caches are kept (/var/cache/zypp/geoip).
Definition ZConfig.cc:1009
zypp::ZConfig::vendorPath
Pathname vendorPath() const
Directory for equivalent vendor definitions (configPath()/vendors.d).
Definition ZConfig.cc:1021
zypp::ZConfig::download_min_download_speed
long download_min_download_speed() const
Minimum download speed (bytes per second) until the connection is dropped.
Definition ZConfig.cc:1068
zypp::ZConfig::commit_downloadMode
DownloadMode commit_downloadMode() const
Commit download policy to use as default.
Definition ZConfig.cc:1084
zypp::ZConfig::needrebootFile
Pathname needrebootFile() const
Path of the default needreboot config file (configPath()/needreboot).
Definition ZConfig.cc:997
zypp::ZConfig::setGpgCheck
void setGpgCheck(bool val_r)
Change the value.
Definition ZConfig.cc:1092
zypp::ZConfig::solver_dupAllowVendorChange
bool solver_dupAllowVendorChange() const
DUP tune: Whether to allow package vendor changes upon DUP.
Definition ZConfig.cc:1107
zypp::ZConfig::~ZConfig
~ZConfig()
Dtor.
Definition ZConfig.cc:810
zypp::ZConfig::setGeoipEnabled
void setGeoipEnabled(bool enable=true)
Enables or disables the use of the geoip feature of download.opensuse.org.
Definition ZConfig.cc:1003
zypp::ZConfig::locksFile
Pathname locksFile() const
Path where zypp can find or create lock file (configPath()/locks).
Definition ZConfig.cc:1027
zypp::ZConfig::_pimpl
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
Pointer to implementation.
Definition ZConfig.h:644
zypp::ZConfig::repoSolvfilesPath
Pathname repoSolvfilesPath() const
Path where the repo solv files are created and kept (repoCachePath()/solv).
Definition ZConfig.cc:943
zypp::ZConfig::geoipEnabled
bool geoipEnabled() const
Returns true if zypp should use the geoip feature of download.opensuse.org.
Definition ZConfig.cc:1006
zypp::ZConfig::update_messagesPath
static Pathname update_messagesPath()
Path where the update messages are stored ( /var/adm/update-messages ).
Definition ZConfig.cc:1151
zypp::ZConfig::historyLogFile
Pathname historyLogFile() const
Path where ZYpp install history is logged.
Definition ZConfig.cc:1182
zypp::ZConfig::setSystemArchitecture
void setSystemArchitecture(const Arch &arch_r)
Override the zypp system architecture.
Definition ZConfig.cc:854
zypp::ZConfig::pkgGpgCheck
TriBool pkgGpgCheck() const
Check rpm package signatures (indeterminate - according to gpgcheck).
Definition ZConfig.cc:1090
zypp::ZConfig::instance
static ZConfig & instance()
Singleton ctor.
Definition ZConfig.cc:788
zypp::ZConfig::setRepoPackagesPath
void setRepoPackagesPath(const Pathname &path_r)
Set a new path as the default repo cache path.
Definition ZConfig.cc:960
zypp::ZConfig::setRepoSolvfilesPath
void setRepoSolvfilesPath(const Pathname &path_r)
Set a new path as the default repo cache path.
Definition ZConfig.cc:949
zypp::ZConfig::resetUpdateMessagesNotify
void resetUpdateMessagesNotify()
Reset to the zypp.conf default.
Definition ZConfig.cc:1173
zypp::ZConfig::about
std::ostream & about(std::ostream &str) const
Print some detail about the current libzypp version.
Definition ZConfig.cc:1215
zypp::ZConfig::multiversionSpec
const std::set< std::string > & multiversionSpec() const
Definition ZConfig.cc:1134
zypp::ZConfig::set_download_mediaMountdir
void set_download_mediaMountdir(Pathname newval_r)
Set alternate value.
Definition ZConfig.cc:1081
zypp::ZConfig::download_use_deltarpm
bool download_use_deltarpm() const
Whether to consider using a deltarpm when downloading a package.
Definition ZConfig.cc:1050
zypp::ZConfig::repoGpgCheck
TriBool repoGpgCheck() const
Check repo matadata signatures (indeterminate - according to gpgcheck).
Definition ZConfig.cc:1089
zypp::ZConfig::set_download_media_prefer_download
void set_download_media_prefer_download(bool yesno_r)
Set download_media_prefer_download to a specific value.
Definition ZConfig.cc:1059
zypp::ZConfig::updateMessagesNotify
std::string updateMessagesNotify() const
Command definition for sending update messages.
Definition ZConfig.cc:1167
zypp::ZConfig::addMultiversionSpec
void addMultiversionSpec(const std::string &name_r)
Definition ZConfig.cc:1137
zypp::ZConfig::builtinRepoCachePath
Pathname builtinRepoCachePath() const
The builtin config file value.
Definition ZConfig.cc:965
zypp::ZConfig::builtinRepoPackagesPath
Pathname builtinRepoPackagesPath() const
The builtin config file value.
Definition ZConfig.cc:974
zypp::ZConfig::solver_checkSystemFile
Pathname solver_checkSystemFile() const
File in which dependencies described which has to be fulfilled for a running system.
Definition ZConfig.cc:1116
zypp::ZConfig::builtinRepoMetadataPath
Pathname builtinRepoMetadataPath() const
The builtin config file value.
Definition ZConfig.cc:968
zypp::ZConfig::set_default_download_media_prefer_download
void set_default_download_media_prefer_download()
Set download_media_prefer_download to the configfiles default.
Definition ZConfig.cc:1062
zypp::ZConfig::lockTimeout
long lockTimeout() const
The number of seconds to wait for the zypp lock to become available.
Definition ZConfig.cc:813
zypp::ZConfig::solver_checkSystemFileDir
Pathname solver_checkSystemFileDir() const
Directory, which may or may not contain files in which dependencies described which has to be fulfill...
Definition ZConfig.cc:1120
zypp::ZConfig::resetGpgCheck
void resetGpgCheck()
Reset to the zconfig default.
Definition ZConfig.cc:1096
zypp::ZConfig::setSolverUpgradeRemoveDroppedPackages
void setSolverUpgradeRemoveDroppedPackages(bool val_r)
Set solverUpgradeRemoveDroppedPackages to val_r.
Definition ZConfig.cc:1112
zypp::ZConfig::configPath
Pathname configPath() const
Path where the configfiles are kept (/etc/zypp).
Definition ZConfig.cc:979
zypp::ZConfig::defaultSystemArchitecture
static Arch defaultSystemArchitecture()
The autodetected system architecture.
Definition ZConfig.cc:846
zypp::ZConfig::pubkeyCachePath
Pathname pubkeyCachePath() const
Path where the pubkey caches.
Definition ZConfig.cc:922
zypp::ZConfig::download_max_concurrent_connections
long download_max_concurrent_connections() const
Maximum number of concurrent connections for a single transfer.
Definition ZConfig.cc:1065
zypp::ZConfig::resetPkgGpgCheck
void resetPkgGpgCheck()
Reset to the zconfig default.
Definition ZConfig.cc:1098
zypp::ZConfig::announceSystemRoot
void announceSystemRoot(const Pathname &root_r)
Announce a target root directory without launching the Target.
Definition ZConfig.cc:837
zypp::ZConfig::solver_onlyRequires
bool solver_onlyRequires() const
Solver regards required packages,patterns,... only.
Definition ZConfig.cc:1102
zypp::ZConfig::varsPath
Pathname varsPath() const
Path containing custom repo variable definitions (configPath()/vars.d).
Definition ZConfig.cc:1015
zypp::ZConfig::solver_dupAllowNameChange
bool solver_dupAllowNameChange() const
DUP tune: Whether to follow package renames upon DUP.
Definition ZConfig.cc:1105
zypp::ZConfig::repoLabelIsAlias
bool repoLabelIsAlias() const
Whether to use repository alias or name in user messages (progress, exceptions, .....
Definition ZConfig.cc:1044
zypp::ZConfig::clearMultiversionSpec
void clearMultiversionSpec()
Definition ZConfig.cc:1136
zypp::ZConfig::repoRefreshLocales
LocaleSet repoRefreshLocales() const
List of locales for which translated package descriptions should be downloaded.
Definition ZConfig.cc:1041
zypp::ZConfig::download_max_download_speed
long download_max_download_speed() const
Maximum download speed (bytes per second).
Definition ZConfig.cc:1071
zypp::ZConfig::setRepoMetadataPath
void setRepoMetadataPath(const Pathname &path_r)
Set a new path as the default repo cache path.
Definition ZConfig.cc:938
zypp::ZConfig::solver_dupAllowDowngrade
bool solver_dupAllowDowngrade() const
DUP tune: Whether to allow version downgrades upon DUP.
Definition ZConfig.cc:1104
zypp::ZConfig::multiversionKernels
std::string multiversionKernels() const
Definition ZConfig.cc:1208
zypp::ZConfig::distroverpkg
std::string distroverpkg() const
Package telling the "product version" on systems not using /etc/product.d/baseproduct.
Definition ZConfig.cc:1200
zypp::ZConfig::download_use_deltarpm_always
bool download_use_deltarpm_always() const
Whether to consider using a deltarpm even when rpm is local.
Definition ZConfig.cc:1053
zypp::ZConfig::setRepoCachePath
void setRepoCachePath(const Pathname &path_r)
Set a new path as the default repo cache path.
Definition ZConfig.cc:927
zypp::ZConfig::setRepoGpgCheck
void setRepoGpgCheck(TriBool val_r)
Change the value.
Definition ZConfig.cc:1093
zypp::ZConfig::credentialsGlobalDir
Pathname credentialsGlobalDir() const
Defaults to /etc/zypp/credentials.d.
Definition ZConfig.cc:1188
zypp::ZConfig::download_media_prefer_download
bool download_media_prefer_download() const
Hint which media to prefer when installing packages (download vs.
Definition ZConfig.cc:1056
zypp::ZConfig::credentialsGlobalFile
Pathname credentialsGlobalFile() const
Defaults to /etc/zypp/credentials.cat.
Definition ZConfig.cc:1193
zypp::filesystem::PathInfo::path
const Pathname & path() const
Return current Pathname.
Definition PathInfo.h:251
zypp::filesystem::PathInfo::isFile
bool isFile() const
Definition PathInfo.h:295
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:48
zypp::filesystem::Pathname::emptyOrRoot
bool emptyOrRoot() const
Test for "" or "/".
Definition Pathname.h:127
zypp::filesystem::Pathname::empty
bool empty() const
Test for an empty path.
Definition Pathname.h:117
zypp::sat::Pool::setTextLocale
void setTextLocale(const Locale &locale_r)
Set the default language for retrieving translated texts.
Definition Pool.cc:233
zypp::sat::Pool::instance
static Pool instance()
Singleton ctor.
Definition Pool.h:55
zypp::sat::detail::PoolImpl::multiversionSpecChanged
void multiversionSpecChanged()
Definition PoolImpl.cc:626
zypp::TriBool
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition String.h:31
std
Definition ansi.h:855
str
String related utilities and Regular expression matching.
zypp::env
Namespace intended to collect all environment variables we use.
Definition RepoVariables.cc:34
zypp::env::ZYPP_CONF
std::optional< Pathname > ZYPP_CONF()
Definition ZConfig.cc:46
zypp::filesystem
Types and functions for filesystem operations.
Definition Glob.cc:24
zypp::filesystem::dirForEach
int dirForEach(const Pathname &dir_r, const StrMatcher &matcher_r, function< bool(const Pathname &, const char *const)> fnc_r)
Definition PathInfo.cc:32
zypp::iostr::simpleParseFile
int simpleParseFile(std::istream &str_r, ParseFlags flags_r, function< bool(int, std::string)> consume_r)
Simple lineparser optionally trimming and skipping comments.
Definition IOStream.cc:124
zypp::parser
Definition HistoryLogReader.cc:30
zypp::str::strToBool
bool strToBool(const C_Str &str, bool default_r)
Parse str into a bool depending on the default value.
Definition String.h:500
zypp::str::strtonum
TInt strtonum(const C_Str &str)
Parsing numbers from string.
zypp::str::sconcat
std::string sconcat(Args &&... args)
Concat words as string.
Definition LogTools.h:276
zypp::str::splitEscaped
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.
Definition String.h:665
zypp::target
Definition KeyRing.h:325
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::LocaleSet
std::unordered_set< Locale > LocaleSet
Definition Locale.h:29
zypp::ResolverFocus
ResolverFocus
The resolver's general attitude.
Definition ResolverFocus.h:24
zypp::ResolverFocus::Default
@ Default
Request the standard behavior (as defined in zypp.conf or 'Job').
Definition ResolverFocus.h:25
zypp::fromString
bool fromString(const std::string &val_r, ResolverFocus &ret_r)
relates: ResolverFocus Conversion from string (enumerator name, case insensitive, empty string is Def...
Definition ResolverFocus.cc:39
zypp::getZYpp
ZYpp::Ptr getZYpp()
relates: ZYppFactory Convenience to get the Pointer to the ZYpp instance.
Definition ZYppFactory.h:77
zypp::dump
detail::Dump< Tp > dump(const Tp &obj_r)
Definition LogTools.h:772
zypp::DownloadMode
DownloadMode
Supported commit download policies.
Definition DownloadMode.h:25
zypp::DownloadDefault
@ DownloadDefault
libzypp will decide what to do.
Definition DownloadMode.h:26
PoolImpl.h
zypp::DefaultOption
Mutable option with initial value also remembering a config value.
Definition ZConfig.cc:194
zypp::DefaultOption::DefaultOption
DefaultOption(value_type initial_r)
Definition ZConfig.cc:198
zypp::DefaultOption::_default
option_type _default
Definition ZConfig.cc:223
zypp::DefaultOption::setDefault
void setDefault(value_type newval_r)
Set a new default value.
Definition ZConfig.cc:219
zypp::DefaultOption::value_type
Tp value_type
Definition ZConfig.cc:195
zypp::DefaultOption::restoreToDefault
void restoreToDefault(value_type newval_r)
Reset value to a new default.
Definition ZConfig.cc:211
zypp::DefaultOption::operator=
DefaultOption & operator=(value_type newval_r)
Definition ZConfig.cc:203
zypp::DefaultOption::restoreToDefault
void restoreToDefault()
Reset value to the current default.
Definition ZConfig.cc:207
zypp::DefaultOption::option_type
Option< Tp > option_type
Definition ZConfig.cc:196
zypp::DefaultOption::getDefault
const value_type & getDefault() const
Get the current default value.
Definition ZConfig.cc:215
zypp::Option
Mutable option.
Definition ZConfig.cc:164
zypp::Option::get
const value_type & get() const
Get the value.
Definition ZConfig.cc:176
zypp::Option::operator=
Option & operator=(value_type newval_r)
Definition ZConfig.cc:172
zypp::Option::set
void set(value_type newval_r)
Set a new value.
Definition ZConfig.cc:184
zypp::Option::Option
Option(value_type initial_r)
No default ctor, explicit initialisation!
Definition ZConfig.cc:168
zypp::Option::value_type
Tp value_type
Definition ZConfig.cc:165
zypp::Option::_val
value_type _val
Definition ZConfig.cc:188
zypp::ZConfig::Impl::MultiversionMap
Definition ZConfig.cc:699
zypp::ZConfig::Impl::MultiversionMap::getSpec
MultiversionSpec & getSpec(Pathname root_r, const Impl &zConfImpl_r)
Definition ZConfig.cc:702
zypp::ZConfig::Impl::MultiversionMap::getDefaultSpec
MultiversionSpec & getDefaultSpec()
Definition ZConfig.cc:729
zypp::ZConfig::Impl::MultiversionMap::scanDirAt
void scanDirAt(const Pathname &root_r, MultiversionSpec &spec_r, const Impl &zConfImpl_r)
Definition ZConfig.cc:748
zypp::ZConfig::Impl::MultiversionMap::_specMap
SpecMap _specMap
Definition ZConfig.cc:773
zypp::ZConfig::Impl::MultiversionMap::scanConfAt
bool scanConfAt(const Pathname &root_r, MultiversionSpec &spec_r, const Impl &zConfImpl_r)
Definition ZConfig.cc:733
zypp::ZConfig::Impl::MultiversionMap::SpecMap
std::map< Pathname, MultiversionSpec > SpecMap
Definition ZConfig.cc:700
zypp::ZConfig::Impl::TargetDefaults
Settings that follow a changed Target.
Definition ZConfig.cc:241
zypp::ZConfig::Impl::TargetDefaults::solver_dupAllowVendorChange
Option< bool > solver_dupAllowVendorChange
Definition ZConfig.cc:312
zypp::ZConfig::Impl::TargetDefaults::solverUpgradeRemoveDroppedPackages
DefaultOption< bool > solverUpgradeRemoveDroppedPackages
Definition ZConfig.cc:315
zypp::ZConfig::Impl::TargetDefaults::TargetDefaults
TargetDefaults()
Definition ZConfig.cc:242
zypp::ZConfig::Impl::TargetDefaults::solver_upgradeTestcasesToKeep
Option< unsigned > solver_upgradeTestcasesToKeep
Definition ZConfig.cc:314
zypp::ZConfig::Impl::TargetDefaults::solver_dupAllowDowngrade
Option< bool > solver_dupAllowDowngrade
Definition ZConfig.cc:309
zypp::ZConfig::Impl::TargetDefaults::consume
bool consume(const std::string &section, const std::string &entry, const std::string &value)
Definition ZConfig.cc:255
zypp::ZConfig::Impl::TargetDefaults::solver_dupAllowArchChange
Option< bool > solver_dupAllowArchChange
Definition ZConfig.cc:311
zypp::ZConfig::Impl::TargetDefaults::solver_onlyRequires
Option< bool > solver_onlyRequires
Definition ZConfig.cc:307
zypp::ZConfig::Impl::TargetDefaults::solver_focus
ResolverFocus solver_focus
Definition ZConfig.cc:306
zypp::ZConfig::Impl::TargetDefaults::solver_cleandepsOnRemove
Option< bool > solver_cleandepsOnRemove
Definition ZConfig.cc:313
zypp::ZConfig::Impl::TargetDefaults::solver_allowVendorChange
Option< bool > solver_allowVendorChange
Definition ZConfig.cc:308
zypp::ZConfig::Impl::TargetDefaults::solver_dupAllowNameChange
Option< bool > solver_dupAllowNameChange
Definition ZConfig.cc:310
zypp::sat::detail::PoolMember::myPool
static PoolImpl & myPool()
Definition PoolMember.cc:41
zypp::sat::detail::PoolMember::poolValid
static bool poolValid()
Definition PoolMember.cc:48
PathInfo.h