libzypp: zypp/ZConfig.cc Source File

libzypp 17.36.6

ZConfig.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12extern "C"
13{
14#include <features.h>
15#include <sys/utsname.h>
16#if __GLIBC_PREREQ (2,16)
17#include <sys/auxv.h> // getauxval for PPC64P7 detection
18#endif
19#include <unistd.h>
20#include <solv/solvversion.h>
21}
22#include <iostream>
23#include <fstream>
24#include <optional>
25#include <zypp-core/APIConfig.h>
26#include <zypp/base/LogTools.h>
27#include <zypp/base/IOStream.h>
28#include <zypp-core/base/InputStream>
29#include <zypp/base/String.h>
30#include <zypp/base/Regex.h>
31
32#include <zypp/ZConfig.h>
33#include <zypp/ZYppFactory.h>
34#include <zypp/PathInfo.h>
35#include <zypp-core/parser/IniDict>
36
37#include <zypp/sat/Pool.h>
38#include <zypp/sat/detail/PoolImpl.h>
39
40#include <zypp-media/MediaConfig>
41
42using std::endl;
43using namespace zypp::filesystem;
44using namespace zypp::parser;
45
46#undef ZYPP_BASE_LOGGER_LOGGROUP
47#define ZYPP_BASE_LOGGER_LOGGROUP "zconfig"
48
50namespace zypp
51{
62 namespace
63 {
64
66 // From rpm's lib/rpmrc.c
67# if defined(__linux__) && defined(__x86_64__)
68 static inline void cpuid(uint32_t op, uint32_t op2, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
69 {
70 asm volatile (
71 "cpuid\n"
72 : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
73 : "a" (op), "c" (op2));
74 }
75
76 /* From gcc's gcc/config/i386/cpuid.h */
77 /* Features (%eax == 1) */
78 /* %ecx */
79 #define bit_SSE3 (1 << 0)
80 #define bit_SSSE3 (1 << 9)
81 #define bit_FMA (1 << 12)
82 #define bit_CMPXCHG16B (1 << 13)
83 #define bit_SSE4_1 (1 << 19)
84 #define bit_SSE4_2 (1 << 20)
85 #define bit_MOVBE (1 << 22)
86 #define bit_POPCNT (1 << 23)
87 #define bit_OSXSAVE (1 << 27)
88 #define bit_AVX (1 << 28)
89 #define bit_F16C (1 << 29)
90
91 /* Extended Features (%eax == 0x80000001) */
92 /* %ecx */
93 #define bit_LAHF_LM (1 << 0)
94 #define bit_LZCNT (1 << 5)
95
96 /* Extended Features (%eax == 7) */
97 /* %ebx */
98 #define bit_BMI (1 << 3)
99 #define bit_AVX2 (1 << 5)
100 #define bit_BMI2 (1 << 8)
101 #define bit_AVX512F (1 << 16)
102 #define bit_AVX512DQ (1 << 17)
103 #define bit_AVX512CD (1 << 28)
104 #define bit_AVX512BW (1 << 30)
105 #define bit_AVX512VL (1u << 31)
106
107 static int get_x86_64_level(void)
108 {
109 int level = 1;
110
111 unsigned int op_1_ecx = 0, op_80000001_ecx = 0, op_7_ebx = 0, unused = 0;
112 cpuid(1, 0, &unused, &unused, &op_1_ecx, &unused);
113 cpuid(0x80000001, 0, &unused, &unused, &op_80000001_ecx, &unused);
114 cpuid(7, 0, &unused, &op_7_ebx, &unused, &unused);
115
116 const unsigned int op_1_ecx_lv2 = bit_SSE3 | bit_SSSE3 | bit_CMPXCHG16B | bit_SSE4_1 | bit_SSE4_2 | bit_POPCNT;
117 if ((op_1_ecx & op_1_ecx_lv2) == op_1_ecx_lv2 && (op_80000001_ecx & bit_LAHF_LM))
118 level = 2;
119
120 const unsigned int op_1_ecx_lv3 = bit_FMA | bit_MOVBE | bit_OSXSAVE | bit_AVX | bit_F16C;
121 const unsigned int op_7_ebx_lv3 = bit_BMI | bit_AVX2 | bit_BMI2;
122 if (level == 2 && (op_1_ecx & op_1_ecx_lv3) == op_1_ecx_lv3 && (op_7_ebx & op_7_ebx_lv3) == op_7_ebx_lv3
123 && (op_80000001_ecx & bit_LZCNT))
124 level = 3;
125
126 const unsigned int op_7_ebx_lv4 = bit_AVX512F | bit_AVX512DQ | bit_AVX512CD | bit_AVX512BW | bit_AVX512VL;
127 if (level == 3 && (op_7_ebx & op_7_ebx_lv4) == op_7_ebx_lv4)
128 level = 4;
129
130 return level;
131 }
132# endif
134
137 Arch _autodetectSystemArchitecture()
138 {
139 struct ::utsname buf;
140 if ( ::uname( &buf ) < 0 )
141 {
142 ERR << "Can't determine system architecture" << endl;
143 return Arch_noarch;
144 }
145
146 Arch architecture( buf.machine );
147 MIL << "Uname architecture is '" << buf.machine << "'" << endl;
148
149 if ( architecture == Arch_x86_64 )
150 {
151#if defined(__linux__) && defined(__x86_64__)
152 switch ( get_x86_64_level() )
153 {
154 case 2:
155 architecture = Arch_x86_64_v2;
156 WAR << "CPU has 'x86_64': architecture upgraded to '" << architecture << "'" << endl;
157 break;
158 case 3:
159 architecture = Arch_x86_64_v3;
160 WAR << "CPU has 'x86_64': architecture upgraded to '" << architecture << "'" << endl;
161 break;
162 case 4:
163 architecture = Arch_x86_64_v4;
164 WAR << "CPU has 'x86_64': architecture upgraded to '" << architecture << "'" << endl;
165 break;
166 }
167# endif
168 }
169 else if ( architecture == Arch_i686 )
170 {
171 // some CPUs report i686 but dont implement cx8 and cmov
172 // check for both flags in /proc/cpuinfo and downgrade
173 // to i586 if either is missing (cf bug #18885)
174 std::ifstream cpuinfo( "/proc/cpuinfo" );
175 if ( cpuinfo )
176 {
177 for( iostr::EachLine in( cpuinfo ); in; in.next() )
178 {
179 if ( str::hasPrefix( *in, "flags" ) )
180 {
181 if ( in->find( "cx8" ) == std::string::npos
182 || in->find( "cmov" ) == std::string::npos )
183 {
184 architecture = Arch_i586;
185 WAR << "CPU lacks 'cx8' or 'cmov': architecture downgraded to '" << architecture << "'" << endl;
186 }
187 break;
188 }
189 }
190 }
191 else
192 {
193 ERR << "Cant open " << PathInfo("/proc/cpuinfo") << endl;
194 }
195 }
196 else if ( architecture == Arch_sparc || architecture == Arch_sparc64 )
197 {
198 // Check for sun4[vum] to get the real arch. (bug #566291)
199 std::ifstream cpuinfo( "/proc/cpuinfo" );
200 if ( cpuinfo )
201 {
202 for( iostr::EachLine in( cpuinfo ); in; in.next() )
203 {
204 if ( str::hasPrefix( *in, "type" ) )
205 {
206 if ( in->find( "sun4v" ) != std::string::npos )
207 {
208 architecture = ( architecture == Arch_sparc64 ? Arch_sparc64v : Arch_sparcv9v );
209 WAR << "CPU has 'sun4v': architecture upgraded to '" << architecture << "'" << endl;
210 }
211 else if ( in->find( "sun4u" ) != std::string::npos )
212 {
213 architecture = ( architecture == Arch_sparc64 ? Arch_sparc64 : Arch_sparcv9 );
214 WAR << "CPU has 'sun4u': architecture upgraded to '" << architecture << "'" << endl;
215 }
216 else if ( in->find( "sun4m" ) != std::string::npos )
217 {
218 architecture = Arch_sparcv8;
219 WAR << "CPU has 'sun4m': architecture upgraded to '" << architecture << "'" << endl;
220 }
221 break;
222 }
223 }
224 }
225 else
226 {
227 ERR << "Cant open " << PathInfo("/proc/cpuinfo") << endl;
228 }
229 }
230 else if ( architecture == Arch_armv8l || architecture == Arch_armv7l || architecture == Arch_armv6l )
231 {
232 std::ifstream platform( "/etc/rpm/platform" );
233 if (platform)
234 {
235 for( iostr::EachLine in( platform ); in; in.next() )
236 {
237 if ( str::hasPrefix( *in, "armv8hl-" ) )
238 {
239 architecture = Arch_armv8hl;
240 WAR << "/etc/rpm/platform contains armv8hl-: architecture upgraded to '" << architecture << "'" << endl;
241 break;
242 }
243 if ( str::hasPrefix( *in, "armv7hl-" ) )
244 {
245 architecture = Arch_armv7hl;
246 WAR << "/etc/rpm/platform contains armv7hl-: architecture upgraded to '" << architecture << "'" << endl;
247 break;
248 }
249 if ( str::hasPrefix( *in, "armv6hl-" ) )
250 {
251 architecture = Arch_armv6hl;
252 WAR << "/etc/rpm/platform contains armv6hl-: architecture upgraded to '" << architecture << "'" << endl;
253 break;
254 }
255 }
256 }
257 }
258#if __GLIBC_PREREQ (2,16)
259 else if ( architecture == Arch_ppc64 )
260 {
261 const char * platform = (const char *)getauxval( AT_PLATFORM );
262 int powerlvl = 0;
263 if ( platform && sscanf( platform, "power%d", &powerlvl ) == 1 && powerlvl > 6 )
264 architecture = Arch_ppc64p7;
265 }
266#endif
267 return architecture;
268 }
269
287 Locale _autodetectTextLocale()
288 {
289 Locale ret( Locale::enCode );
290 const char * envlist[] = { "LC_ALL", "LC_MESSAGES", "LANG", NULL };
291 for ( const char ** envvar = envlist; *envvar; ++envvar )
292 {
293 const char * envlang = getenv( *envvar );
294 if ( envlang )
295 {
296 std::string envstr( envlang );
297 if ( envstr != "POSIX" && envstr != "C" )
298 {
299 Locale lang( envstr );
300 if ( lang )
301 {
302 MIL << "Found " << *envvar << "=" << envstr << endl;
303 ret = lang;
304 break;
305 }
306 }
307 }
308 }
309 MIL << "Default text locale is '" << ret << "'" << endl;
310#warning HACK AROUND BOOST_TEST_CATCH_SYSTEM_ERRORS
311 setenv( "BOOST_TEST_CATCH_SYSTEM_ERRORS", "no", 1 );
312 return ret;
313 }
314
315 inline Pathname _autodetectZyppConfPath()
316 {
317 const char *env_confpath = getenv( "ZYPP_CONF" );
318 return env_confpath ? env_confpath : "/etc/zypp/zypp.conf";
319 }
320
322 } // namespace zypp
324
326 template<class Tp>
327 struct Option
328 {
329 using value_type = Tp;
330
332 Option( value_type initial_r )
333 : _val( std::move(initial_r) )
334 {}
335
336 Option & operator=( value_type newval_r )
337 { set( std::move(newval_r) ); return *this; }
338
340 const value_type & get() const
341 { return _val; }
342
344 operator const value_type &() const
345 { return _val; }
346
348 void set( value_type newval_r )
349 { _val = std::move(newval_r); }
350
351 private:
352 value_type _val;
353 };
354
356 template<class Tp>
357 struct DefaultOption : public Option<Tp>
358 {
359 using value_type = Tp;
360 using option_type = Option<Tp>;
361
362 explicit DefaultOption( value_type initial_r )
363 : Option<Tp>( initial_r )
364 , _default( std::move(initial_r) )
365 {}
366
367 DefaultOption & operator=( value_type newval_r )
368 { this->set( std::move(newval_r) ); return *this; }
369
371 void restoreToDefault()
372 { this->set( _default.get() ); }
373
375 void restoreToDefault( value_type newval_r )
376 { setDefault( std::move(newval_r) ); restoreToDefault(); }
377
379 const value_type & getDefault() const
380 { return _default.get(); }
381
383 void setDefault( value_type newval_r )
384 { _default.set( std::move(newval_r) ); }
385
386 private:
387 option_type _default;
388 };
389
391 //
392 // CLASS NAME : ZConfig::Impl
393 //
399 class ZConfig::Impl
400 {
401 using MultiversionSpec = std::set<std::string>;
402
404 struct TargetDefaults
405 {
406 TargetDefaults()
407 : solver_focus ( ResolverFocus::Default )
408 , solver_onlyRequires ( false )
409 , solver_allowVendorChange ( false )
410 , solver_dupAllowDowngrade ( true )
411 , solver_dupAllowNameChange ( true )
412 , solver_dupAllowArchChange ( true )
413 , solver_dupAllowVendorChange ( false )
414 , solver_cleandepsOnRemove ( false )
415 , solver_upgradeTestcasesToKeep ( 2 )
416 , solverUpgradeRemoveDroppedPackages ( true )
417 {}
418
419 bool consume( const std::string & entry, const std::string & value )
420 {
421 if ( entry == "solver.focus" )
422 {
423 fromString( value, solver_focus );
424 }
425 else if ( entry == "solver.onlyRequires" )
426 {
427 solver_onlyRequires.set( str::strToBool( value, solver_onlyRequires ) );
428 }
429 else if ( entry == "solver.allowVendorChange" )
430 {
431 solver_allowVendorChange.set( str::strToBool( value, solver_allowVendorChange ) );
432 }
433 else if ( entry == "solver.dupAllowDowngrade" )
434 {
435 solver_dupAllowDowngrade.set( str::strToBool( value, solver_dupAllowDowngrade ) );
436 }
437 else if ( entry == "solver.dupAllowNameChange" )
438 {
439 solver_dupAllowNameChange.set( str::strToBool( value, solver_dupAllowNameChange ) );
440 }
441 else if ( entry == "solver.dupAllowArchChange" )
442 {
443 solver_dupAllowArchChange.set( str::strToBool( value, solver_dupAllowArchChange ) );
444 }
445 else if ( entry == "solver.dupAllowVendorChange" )
446 {
447 solver_dupAllowVendorChange.set( str::strToBool( value, solver_dupAllowVendorChange ) );
448 }
449 else if ( entry == "solver.cleandepsOnRemove" )
450 {
451 solver_cleandepsOnRemove.set( str::strToBool( value, solver_cleandepsOnRemove ) );
452 }
453 else if ( entry == "solver.upgradeTestcasesToKeep" )
454 {
455 solver_upgradeTestcasesToKeep.set( str::strtonum<unsigned>( value ) );
456 }
457 else if ( entry == "solver.upgradeRemoveDroppedPackages" )
458 {
459 solverUpgradeRemoveDroppedPackages.restoreToDefault( str::strToBool( value, solverUpgradeRemoveDroppedPackages.getDefault() ) );
460 }
461 else
462 return false;
463
464 return true;
465 }
466
467 ResolverFocus solver_focus;
468 Option<bool> solver_onlyRequires;
469 Option<bool> solver_allowVendorChange;
470 Option<bool> solver_dupAllowDowngrade;
471 Option<bool> solver_dupAllowNameChange;
472 Option<bool> solver_dupAllowArchChange;
473 Option<bool> solver_dupAllowVendorChange;
474 Option<bool> solver_cleandepsOnRemove;
475 Option<unsigned> solver_upgradeTestcasesToKeep;
476 DefaultOption<bool> solverUpgradeRemoveDroppedPackages;
477 };
478
479 public:
480 Impl()
481 : _parsedZyppConf ( _autodetectZyppConfPath() )
482 , cfg_arch ( defaultSystemArchitecture() )
483 , cfg_textLocale ( defaultTextLocale() )
484 , cfg_cache_path { "/var/cache/zypp" }
485 , cfg_metadata_path { "" } // empty - follows cfg_cache_path
486 , cfg_solvfiles_path { "" } // empty - follows cfg_cache_path
487 , cfg_packages_path { "" } // empty - follows cfg_cache_path
488 , updateMessagesNotify ( "" )
489 , repo_add_probe ( false )
490 , repo_refresh_delay ( 10 )
491 , repoLabelIsAlias ( false )
492 , download_use_deltarpm ( LIBZYPP_CONFIG_USE_DELTARPM_BY_DEFAULT )
493 , download_use_deltarpm_always ( false )
494 , download_media_prefer_download( true )
495 , download_mediaMountdir ( "/var/adm/mount" )
496 , commit_downloadMode ( DownloadDefault )
497 , gpgCheck ( true )
498 , repoGpgCheck ( indeterminate )
499 , pkgGpgCheck ( indeterminate )
500 , apply_locks_file ( true )
501 , pluginsPath ( "/usr/lib/zypp/plugins" )
502 , geoipEnabled ( true )
503 , geoipHosts { "download.opensuse.org" }
504 {
505 MIL << "libzypp: " LIBZYPP_VERSION_STRING << " (" << LIBZYPP_CODESTREAM << ")" << endl;
506 if ( PathInfo(_parsedZyppConf).isExist() )
507 {
508 parser::IniDict dict( _parsedZyppConf );
509 for ( IniDict::section_const_iterator sit = dict.sectionsBegin();
510 sit != dict.sectionsEnd();
511 ++sit )
512 {
513 const std::string& section(*sit);
514 //MIL << section << endl;
515 for ( IniDict::entry_const_iterator it = dict.entriesBegin(*sit);
516 it != dict.entriesEnd(*sit);
517 ++it )
518 {
519 std::string entry(it->first);
520 std::string value(it->second);
521
522 if ( _mediaConf.setConfigValue( section, entry, value ) )
523 continue;
524
525 //DBG << (*it).first << "=" << (*it).second << endl;
526 if ( section == "main" )
527 {
528 if ( _initialTargetDefaults.consume( entry, value ) )
529 continue;
530
531 if ( entry == "lock_timeout" ) {
532 str::strtonum( value, cfg_lockTimeout );
533 }
534 else if ( entry == "arch" )
535 {
536 Arch carch( value );
537 if ( carch != cfg_arch )
538 {
539 WAR << "Overriding system architecture (" << cfg_arch << "): " << carch << endl;
540 cfg_arch = carch;
541 }
542 }
543 else if ( entry == "cachedir" )
544 {
545 cfg_cache_path.restoreToDefault( value );
546 }
547 else if ( entry == "metadatadir" )
548 {
549 cfg_metadata_path.restoreToDefault( value );
550 }
551 else if ( entry == "solvfilesdir" )
552 {
553 cfg_solvfiles_path.restoreToDefault( value );
554 }
555 else if ( entry == "packagesdir" )
556 {
557 cfg_packages_path.restoreToDefault( value );
558 }
559 else if ( entry == "configdir" )
560 {
561 cfg_config_path = Pathname(value);
562 }
563 else if ( entry == "reposdir" )
564 {
565 cfg_known_repos_path = Pathname(value);
566 }
567 else if ( entry == "servicesdir" )
568 {
569 cfg_known_services_path = Pathname(value);
570 }
571 else if ( entry == "varsdir" )
572 {
573 cfg_vars_path = Pathname(value);
574 }
575 else if ( entry == "repo.add.probe" )
576 {
577 repo_add_probe = str::strToBool( value, repo_add_probe );
578 }
579 else if ( entry == "repo.refresh.delay" )
580 {
581 str::strtonum(value, repo_refresh_delay);
582 }
583 else if ( entry == "repo.refresh.locales" )
584 {
585 std::vector<std::string> tmp;
586 str::split( value, back_inserter( tmp ), ", \t" );
587
588 boost::function<Locale(const std::string &)> transform(
589 [](const std::string & str_r)->Locale{ return Locale(str_r); }
590 );
591 repoRefreshLocales.insert( make_transform_iterator( tmp.begin(), transform ),
592 make_transform_iterator( tmp.end(), transform ) );
593 }
594 else if ( entry == "download.use_deltarpm" )
595 {
596 download_use_deltarpm = str::strToBool( value, download_use_deltarpm );
597 }
598 else if ( entry == "download.use_deltarpm.always" )
599 {
600 download_use_deltarpm_always = str::strToBool( value, download_use_deltarpm_always );
601 }
602 else if ( entry == "download.media_preference" )
603 {
604 download_media_prefer_download.restoreToDefault( str::compareCI( value, "volatile" ) != 0 );
605 }
606 else if ( entry == "download.media_mountdir" )
607 {
608 download_mediaMountdir.restoreToDefault( Pathname(value) );
609 }
610 else if ( entry == "download.use_geoip_mirror") {
611 geoipEnabled = str::strToBool( value, geoipEnabled );
612 }
613 else if ( entry == "commit.downloadMode" )
614 {
615 commit_downloadMode.set( deserializeDownloadMode( value ) );
616 }
617 else if ( entry == "gpgcheck" )
618 {
619 gpgCheck.restoreToDefault( str::strToBool( value, gpgCheck ) );
620 }
621 else if ( entry == "repo_gpgcheck" )
622 {
623 repoGpgCheck.restoreToDefault( str::strToTriBool( value ) );
624 }
625 else if ( entry == "pkg_gpgcheck" )
626 {
627 pkgGpgCheck.restoreToDefault( str::strToTriBool( value ) );
628 }
629 else if ( entry == "vendordir" )
630 {
631 cfg_vendor_path = Pathname(value);
632 }
633 else if ( entry == "multiversiondir" )
634 {
635 cfg_multiversion_path = Pathname(value);
636 }
637 else if ( entry == "multiversion.kernels" )
638 {
639 cfg_kernel_keep_spec = value;
640 }
641 else if ( entry == "solver.checkSystemFile" )
642 {
643 solver_checkSystemFile = Pathname(value);
644 }
645 else if ( entry == "solver.checkSystemFileDir" )
646 {
647 solver_checkSystemFileDir = Pathname(value);
648 }
649 else if ( entry == "multiversion" )
650 {
651 MultiversionSpec & defSpec( _multiversionMap.getDefaultSpec() );
652 str::splitEscaped( value, std::inserter( defSpec, defSpec.end() ), ", \t" );
653 }
654 else if ( entry == "locksfile.path" )
655 {
656 locks_file = Pathname(value);
657 }
658 else if ( entry == "locksfile.apply" )
659 {
660 apply_locks_file = str::strToBool( value, apply_locks_file );
661 }
662 else if ( entry == "update.datadir" )
663 {
664 // ignore, this is a constant anyway and should not be user configurabe
665 // update_data_path = Pathname(value);
666 }
667 else if ( entry == "update.scriptsdir" )
668 {
669 // ignore, this is a constant anyway and should not be user configurabe
670 // update_scripts_path = Pathname(value);
671 }
672 else if ( entry == "update.messagessdir" )
673 {
674 // ignore, this is a constant anyway and should not be user configurabe
675 // update_messages_path = Pathname(value);
676 }
677 else if ( entry == "update.messages.notify" )
678 {
679 updateMessagesNotify.set( value );
680 }
681 else if ( entry == "rpm.install.excludedocs" )
682 {
683 rpmInstallFlags.setFlag( target::rpm::RPMINST_EXCLUDEDOCS,
684 str::strToBool( value, false ) );
685 }
686 else if ( entry == "history.logfile" )
687 {
688 history_log_path = Pathname(value);
689 }
690 else if ( entry == "techpreview.ZYPP_SINGLE_RPMTRANS" )
691 {
692 DBG << "techpreview.ZYPP_SINGLE_RPMTRANS=" << value << endl;
693 ::setenv( "ZYPP_SINGLE_RPMTRANS", value.c_str(), 1 );
694 }
695 else if ( entry == "techpreview.ZYPP_MEDIANETWORK" )
696 {
697 DBG << "techpreview.ZYPP_MEDIANETWORK=" << value << endl;
698 ::setenv( "ZYPP_MEDIANETWORK", value.c_str(), 1 );
699 }
700 }
701 }
702 }
703 }
704 else
705 {
706 MIL << _parsedZyppConf << " not found, using defaults instead." << endl;
707 _parsedZyppConf = _parsedZyppConf.extend( " (NOT FOUND)" );
708 }
709
710 // legacy:
711 if ( getenv( "ZYPP_TESTSUITE_FAKE_ARCH" ) )
712 {
713 Arch carch( getenv( "ZYPP_TESTSUITE_FAKE_ARCH" ) );
714 if ( carch != cfg_arch )
715 {
716 WAR << "ZYPP_TESTSUITE_FAKE_ARCH: Overriding system architecture (" << cfg_arch << "): " << carch << endl;
717 cfg_arch = carch;
718 }
719 }
720 MIL << "ZConfig singleton created." << endl;
721 }
722
723 Impl(const Impl &) = delete;
724 Impl(Impl &&) = delete;
725 Impl &operator=(const Impl &) = delete;
726 Impl &operator=(Impl &&) = delete;
727 ~Impl() {}
728
736 Pathname _autodetectSystemRoot() const
737 {
738 Target_Ptr target( getZYpp()->getTarget() );
739 return target ? target->root() : _announced_root_path;
740 }
741
742 void notifyTargetChanged()
743 {
744 _announced_root_path = Pathname(); // first of all reset any previously _announced_root_path
745
746 Pathname newRoot { _autodetectSystemRoot() };
747 MIL << "notifyTargetChanged (" << newRoot << ")" << endl;
748
749 if ( newRoot.emptyOrRoot() ) {
750 _currentTargetDefaults.reset(); // to initial settigns from /
751 }
752 else {
753 _currentTargetDefaults = TargetDefaults();
754
755 Pathname newConf { newRoot/_autodetectZyppConfPath() };
756 if ( PathInfo(newConf).isExist() ) {
757 parser::IniDict dict( newConf );
758 for ( const auto & [entry,value] : dict.entries( "main" ) ) {
759 (*_currentTargetDefaults).consume( entry, value );
760 }
761 }
762 else {
763 MIL << _parsedZyppConf << " not found, using defaults." << endl;
764 }
765 }
766 }
767
768 public:
770 Pathname _parsedZyppConf;
771 Pathname _announced_root_path;
772
773 long cfg_lockTimeout = 0; // signed!
774
775 Arch cfg_arch;
776 Locale cfg_textLocale;
777
778 DefaultOption<Pathname> cfg_cache_path; // Settings from the config file are also remembered
779 DefaultOption<Pathname> cfg_metadata_path; // 'default'. Cleanup in RepoManager e.g needs to tell
780 DefaultOption<Pathname> cfg_solvfiles_path; // whether settings in effect are config values or
781 DefaultOption<Pathname> cfg_packages_path; // custom settings applied vie set...Path().
782
783 Pathname cfg_config_path;
784 Pathname cfg_known_repos_path;
785 Pathname cfg_known_services_path;
786 Pathname cfg_vars_path;
787 Pathname cfg_repo_mgr_root_path;
788
789 Pathname cfg_vendor_path;
790 Pathname cfg_multiversion_path;
791 std::string cfg_kernel_keep_spec;
792 Pathname locks_file;
793
794 DefaultOption<std::string> updateMessagesNotify;
795
796 bool repo_add_probe;
797 unsigned repo_refresh_delay;
798 LocaleSet repoRefreshLocales;
799 bool repoLabelIsAlias;
800
801 bool download_use_deltarpm;
802 bool download_use_deltarpm_always;
803 DefaultOption<bool> download_media_prefer_download;
804 DefaultOption<Pathname> download_mediaMountdir;
805
806 Option<DownloadMode> commit_downloadMode;
807
808 DefaultOption<bool> gpgCheck;
809 DefaultOption<TriBool> repoGpgCheck;
810 DefaultOption<TriBool> pkgGpgCheck;
811
812 Pathname solver_checkSystemFile;
813 Pathname solver_checkSystemFileDir;
814
815 MultiversionSpec & multiversion() { return getMultiversion(); }
816 const MultiversionSpec & multiversion() const { return getMultiversion(); }
817
818 bool apply_locks_file;
819
820 target::rpm::RpmInstFlags rpmInstallFlags;
821
822 Pathname history_log_path;
823
824 std::string userData;
825
826 Option<Pathname> pluginsPath;
827
828 bool geoipEnabled;
829
830 std::vector<std::string> geoipHosts;
831
832 /* Other config singleton instances */
833 MediaConfig &_mediaConf = MediaConfig::instance();
834
835
836 public:
837 const TargetDefaults & targetDefaults() const { return _currentTargetDefaults ? *_currentTargetDefaults : _initialTargetDefaults; }
838 TargetDefaults & targetDefaults() { return _currentTargetDefaults ? *_currentTargetDefaults : _initialTargetDefaults; }
839 private:
840 TargetDefaults _initialTargetDefaults;
841 std::optional<TargetDefaults> _currentTargetDefaults;
842
843 private:
844 // HACK for bnc#906096: let pool re-evaluate multiversion spec
845 // if target root changes. ZConfig returns data sensitive to
846 // current target root.
847 // TODO Actually we'd need to scan the target systems zypp.conf and
848 // overlay all system specific values.
849 struct MultiversionMap
850 {
851 using SpecMap = std::map<Pathname, MultiversionSpec>;
852
853 MultiversionSpec & getSpec( Pathname root_r, const Impl & zConfImpl_r ) // from system at root
854 {
855 // _specMap[] - the plain zypp.conf value
856 // _specMap[/] - combine [] and multiversion.d scan
857 // _specMap[root] - scan root/zypp.conf and root/multiversion.d
858
859 if ( root_r.empty() )
860 root_r = "/";
861 bool cacheHit = _specMap.count( root_r );
862 MultiversionSpec & ret( _specMap[root_r] ); // creates new entry on the fly
863
864 if ( ! cacheHit )
865 {
866 // bsc#1193488: If no (/root)/.../zypp.conf exists use the default zypp.conf
867 // multiversion settings. It is a legacy that the packaged multiversion setting
868 // in zypp.conf (the kernel) may differ from the builtin default (empty).
869 // But we want a missing config to behave similar to the default one, otherwise
870 // a bare metal install easily runs into trouble.
871 if ( root_r == "/" || scanConfAt( root_r, ret, zConfImpl_r ) == 0 )
872 ret = _specMap[Pathname()];
873 scanDirAt( root_r, ret, zConfImpl_r ); // add multiversion.d at root_r
874 using zypp::operator<<;
875 MIL << "MultiversionSpec '" << root_r << "' = " << ret << endl;
876 }
877 return ret;
878 }
879
880 MultiversionSpec & getDefaultSpec() // Spec from zypp.conf parsing; called before any getSpec
881 { return _specMap[Pathname()]; }
882
883 private:
884 int scanConfAt( const Pathname& root_r, MultiversionSpec & spec_r, const Impl & zConfImpl_r )
885 {
886 static const str::regex rx( "^multiversion *= *(.*)" );
887 str::smatch what;
888 return iostr::simpleParseFile( InputStream( Pathname::assertprefix( root_r, _autodetectZyppConfPath() ) ),
889 [&]( int num_r, std::string line_r )->bool
890 {
891 if ( line_r[0] == 'm' && str::regex_match( line_r, what, rx ) )
892 {
893 str::splitEscaped( what[1], std::inserter( spec_r, spec_r.end() ), ", \t" );
894 return false; // stop after match
895 }
896 return true;
897 } );
898 }
899
900 void scanDirAt( const Pathname& root_r, MultiversionSpec & spec_r, const Impl & zConfImpl_r )
901 {
902 // NOTE: Actually we'd need to scan and use the root_r! zypp.conf values.
903 Pathname multiversionDir( zConfImpl_r.cfg_multiversion_path );
904 if ( multiversionDir.empty() )
905 multiversionDir = ( zConfImpl_r.cfg_config_path.empty()
906 ? Pathname("/etc/zypp")
907 : zConfImpl_r.cfg_config_path ) / "multiversion.d";
908
909 filesystem::dirForEach( Pathname::assertprefix( root_r, multiversionDir ),
910 [&spec_r]( const Pathname & dir_r, const char *const & name_r )->bool
911 {
912 MIL << "Parsing " << dir_r/name_r << endl;
913 iostr::simpleParseFile( InputStream( dir_r/name_r ),
914 [&spec_r]( int num_r, std::string line_r )->bool
915 {
916 DBG << " found " << line_r << endl;
917 spec_r.insert( std::move(line_r) );
918 return true;
919 } );
920 return true;
921 } );
922 }
923
924 private:
925 SpecMap _specMap;
926 };
927
928 MultiversionSpec & getMultiversion() const
929 { return _multiversionMap.getSpec( _autodetectSystemRoot(), *this ); }
930
931 mutable MultiversionMap _multiversionMap;
932 };
933
934
936 //
937 // METHOD NAME : ZConfig::instance
938 // METHOD TYPE : ZConfig &
939 //
940 ZConfig & ZConfig::instance()
941 {
942 static ZConfig _instance; // The singleton
943 return _instance;
944 }
945
947 //
948 // METHOD NAME : ZConfig::ZConfig
949 // METHOD TYPE : Ctor
950 //
951 ZConfig::ZConfig()
952 : _pimpl( new Impl )
953 {
954 about( MIL );
955 }
956
958 //
959 // METHOD NAME : ZConfig::~ZConfig
960 // METHOD TYPE : Dtor
961 //
962 ZConfig::~ZConfig( )
963 {}
964
965 long ZConfig::lockTimeout() const
966 {
967 const char * env = getenv("ZYPP_LOCK_TIMEOUT");
968 if ( env ) {
969 return str::strtonum<long>( env );
970 }
971 return _pimpl->cfg_lockTimeout;
972 }
973
974 void ZConfig::notifyTargetChanged()
975 { return _pimpl->notifyTargetChanged(); }
976
977 Pathname ZConfig::systemRoot() const
978 { return _pimpl->_autodetectSystemRoot(); }
979
980 Pathname ZConfig::repoManagerRoot() const
981 {
982 return ( _pimpl->cfg_repo_mgr_root_path.empty()
983 ? systemRoot() : _pimpl->cfg_repo_mgr_root_path );
984 }
985
986 void ZConfig::setRepoManagerRoot(const zypp::filesystem::Pathname &root)
987 { _pimpl->cfg_repo_mgr_root_path = root; }
988
989 void ZConfig::announceSystemRoot( const Pathname & root_r )
990 { _pimpl->_announced_root_path = root_r; }
991
993 //
994 // system architecture
995 //
997
998 Arch ZConfig::defaultSystemArchitecture()
999 {
1000 static Arch _val( _autodetectSystemArchitecture() );
1001 return _val;
1002 }
1003
1004 Arch ZConfig::systemArchitecture() const
1005 { return _pimpl->cfg_arch; }
1006
1007 void ZConfig::setSystemArchitecture( const Arch & arch_r )
1008 {
1009 if ( arch_r != _pimpl->cfg_arch )
1010 {
1011 WAR << "Overriding system architecture (" << _pimpl->cfg_arch << "): " << arch_r << endl;
1012 _pimpl->cfg_arch = arch_r;
1013 }
1014 }
1015
1017 //
1018 // text locale
1019 //
1021
1022 Locale ZConfig::defaultTextLocale()
1023 {
1024 static Locale _val( _autodetectTextLocale() );
1025 return _val;
1026 }
1027
1028 Locale ZConfig::textLocale() const
1029 { return _pimpl->cfg_textLocale; }
1030
1031 void ZConfig::setTextLocale( const Locale & locale_r )
1032 {
1033 if ( locale_r != _pimpl->cfg_textLocale )
1034 {
1035 WAR << "Overriding text locale (" << _pimpl->cfg_textLocale << "): " << locale_r << endl;
1036 _pimpl->cfg_textLocale = locale_r;
1037 // Propagate changes
1038 sat::Pool::instance().setTextLocale( locale_r );
1039 }
1040 }
1041
1043 // user data
1045
1046 bool ZConfig::hasUserData() const
1047 { return !_pimpl->userData.empty(); }
1048
1049 std::string ZConfig::userData() const
1050 { return _pimpl->userData; }
1051
1052 bool ZConfig::setUserData( const std::string & str_r )
1053 {
1054 for_( ch, str_r.begin(), str_r.end() )
1055 {
1056 if ( *ch < ' ' && *ch != '\t' )
1057 {
1058 ERR << "New user data string rejectded: char " << (int)*ch << " at position " << (ch - str_r.begin()) << endl;
1059 return false;
1060 }
1061 }
1062 MIL << "Set user data string to '" << str_r << "'" << endl;
1063 _pimpl->userData = str_r;
1064 return true;
1065 }
1066
1068
1069 Pathname ZConfig::repoCachePath() const
1070 {
1071 return ( _pimpl->cfg_cache_path.get().empty()
1072 ? Pathname("/var/cache/zypp") : _pimpl->cfg_cache_path.get() );
1073 }
1074
1075 Pathname ZConfig::pubkeyCachePath() const
1076 {
1077 return repoCachePath()/"pubkeys";
1078 }
1079
1080 void ZConfig::setRepoCachePath(const zypp::filesystem::Pathname &path_r)
1081 {
1082 _pimpl->cfg_cache_path = path_r;
1083 }
1084
1085 Pathname ZConfig::repoMetadataPath() const
1086 {
1087 return ( _pimpl->cfg_metadata_path.get().empty()
1088 ? (repoCachePath()/"raw") : _pimpl->cfg_metadata_path.get() );
1089 }
1090
1091 void ZConfig::setRepoMetadataPath(const zypp::filesystem::Pathname &path_r)
1092 {
1093 _pimpl->cfg_metadata_path = path_r;
1094 }
1095
1096 Pathname ZConfig::repoSolvfilesPath() const
1097 {
1098 return ( _pimpl->cfg_solvfiles_path.get().empty()
1099 ? (repoCachePath()/"solv") : _pimpl->cfg_solvfiles_path.get() );
1100 }
1101
1102 void ZConfig::setRepoSolvfilesPath(const zypp::filesystem::Pathname &path_r)
1103 {
1104 _pimpl->cfg_solvfiles_path = path_r;
1105 }
1106
1107 Pathname ZConfig::repoPackagesPath() const
1108 {
1109 return ( _pimpl->cfg_packages_path.get().empty()
1110 ? (repoCachePath()/"packages") : _pimpl->cfg_packages_path.get() );
1111 }
1112
1113 void ZConfig::setRepoPackagesPath(const zypp::filesystem::Pathname &path_r)
1114 {
1115 _pimpl->cfg_packages_path = path_r;
1116 }
1117
1118 Pathname ZConfig::builtinRepoCachePath() const
1119 { return _pimpl->cfg_cache_path.getDefault().empty() ? Pathname("/var/cache/zypp") : _pimpl->cfg_cache_path.getDefault(); }
1120
1121 Pathname ZConfig::builtinRepoMetadataPath() const
1122 { return _pimpl->cfg_metadata_path.getDefault().empty() ? (builtinRepoCachePath()/"raw") : _pimpl->cfg_metadata_path.getDefault(); }
1123
1124 Pathname ZConfig::builtinRepoSolvfilesPath() const
1125 { return _pimpl->cfg_solvfiles_path.getDefault().empty() ? (builtinRepoCachePath()/"solv") : _pimpl->cfg_solvfiles_path.getDefault(); }
1126
1127 Pathname ZConfig::builtinRepoPackagesPath() const
1128 { return _pimpl->cfg_packages_path.getDefault().empty() ? (builtinRepoCachePath()/"packages") : _pimpl->cfg_packages_path.getDefault(); }
1129
1131
1132 Pathname ZConfig::configPath() const
1133 {
1134 return ( _pimpl->cfg_config_path.empty()
1135 ? Pathname("/etc/zypp") : _pimpl->cfg_config_path );
1136 }
1137
1138 Pathname ZConfig::knownReposPath() const
1139 {
1140 return ( _pimpl->cfg_known_repos_path.empty()
1141 ? (configPath()/"repos.d") : _pimpl->cfg_known_repos_path );
1142 }
1143
1144 Pathname ZConfig::knownServicesPath() const
1145 {
1146 return ( _pimpl->cfg_known_services_path.empty()
1147 ? (configPath()/"services.d") : _pimpl->cfg_known_services_path );
1148 }
1149
1150 Pathname ZConfig::needrebootFile() const
1151 { return configPath()/"needreboot"; }
1152
1153 Pathname ZConfig::needrebootPath() const
1154 { return configPath()/"needreboot.d"; }
1155
1156 void ZConfig::setGeoipEnabled( bool enable )
1157 { _pimpl->geoipEnabled = enable; }
1158
1159 bool ZConfig::geoipEnabled () const
1160 { return _pimpl->geoipEnabled; }
1161
1162 Pathname ZConfig::geoipCachePath() const
1163 { return builtinRepoCachePath()/"geoip.d"; }
1164
1165 const std::vector<std::string> ZConfig::geoipHostnames () const
1166 { return _pimpl->geoipHosts; }
1167
1168 Pathname ZConfig::varsPath() const
1169 {
1170 return ( _pimpl->cfg_vars_path.empty()
1171 ? (configPath()/"vars.d") : _pimpl->cfg_vars_path );
1172 }
1173
1174 Pathname ZConfig::vendorPath() const
1175 {
1176 return ( _pimpl->cfg_vendor_path.empty()
1177 ? (configPath()/"vendors.d") : _pimpl->cfg_vendor_path );
1178 }
1179
1180 Pathname ZConfig::locksFile() const
1181 {
1182 return ( _pimpl->locks_file.empty()
1183 ? (configPath()/"locks") : _pimpl->locks_file );
1184 }
1185
1187
1188 bool ZConfig::repo_add_probe() const
1189 { return _pimpl->repo_add_probe; }
1190
1191 unsigned ZConfig::repo_refresh_delay() const
1192 { return _pimpl->repo_refresh_delay; }
1193
1194 LocaleSet ZConfig::repoRefreshLocales() const
1195 { return _pimpl->repoRefreshLocales.empty() ? Target::requestedLocales("") :_pimpl->repoRefreshLocales; }
1196
1197 bool ZConfig::repoLabelIsAlias() const
1198 { return _pimpl->repoLabelIsAlias; }
1199
1200 void ZConfig::repoLabelIsAlias( bool yesno_r )
1201 { _pimpl->repoLabelIsAlias = yesno_r; }
1202
1203 bool ZConfig::download_use_deltarpm() const
1204 { return _pimpl->download_use_deltarpm; }
1205
1206 bool ZConfig::download_use_deltarpm_always() const
1207 { return download_use_deltarpm() && _pimpl->download_use_deltarpm_always; }
1208
1209 bool ZConfig::download_media_prefer_download() const
1210 { return _pimpl->download_media_prefer_download; }
1211
1212 void ZConfig::set_download_media_prefer_download( bool yesno_r )
1213 { _pimpl->download_media_prefer_download.set( yesno_r ); }
1214
1215 void ZConfig::set_default_download_media_prefer_download()
1216 { _pimpl->download_media_prefer_download.restoreToDefault(); }
1217
1218 long ZConfig::download_max_concurrent_connections() const
1219 { return _pimpl->_mediaConf.download_max_concurrent_connections(); }
1220
1221 long ZConfig::download_min_download_speed() const
1222 { return _pimpl->_mediaConf.download_min_download_speed(); }
1223
1224 long ZConfig::download_max_download_speed() const
1225 { return _pimpl->_mediaConf.download_max_download_speed(); }
1226
1227 long ZConfig::download_max_silent_tries() const
1228 { return _pimpl->_mediaConf.download_max_silent_tries(); }
1229
1230 long ZConfig::download_transfer_timeout() const
1231 { return _pimpl->_mediaConf.download_transfer_timeout(); }
1232
1233 Pathname ZConfig::download_mediaMountdir() const { return _pimpl->download_mediaMountdir; }
1234 void ZConfig::set_download_mediaMountdir( Pathname newval_r ) { _pimpl->download_mediaMountdir.set( std::move(newval_r) ); }
1235 void ZConfig::set_default_download_mediaMountdir() { _pimpl->download_mediaMountdir.restoreToDefault(); }
1236
1237 DownloadMode ZConfig::commit_downloadMode() const
1238 { return _pimpl->commit_downloadMode; }
1239
1240
1241 bool ZConfig::gpgCheck() const { return _pimpl->gpgCheck; }
1242 TriBool ZConfig::repoGpgCheck() const { return _pimpl->repoGpgCheck; }
1243 TriBool ZConfig::pkgGpgCheck() const { return _pimpl->pkgGpgCheck; }
1244
1245 void ZConfig::setGpgCheck( bool val_r ) { _pimpl->gpgCheck.set( val_r ); }
1246 void ZConfig::setRepoGpgCheck( TriBool val_r ) { _pimpl->repoGpgCheck.set( val_r ); }
1247 void ZConfig::setPkgGpgCheck( TriBool val_r ) { _pimpl->pkgGpgCheck.set( val_r ); }
1248
1249 void ZConfig::resetGpgCheck() { _pimpl->gpgCheck.restoreToDefault(); }
1250 void ZConfig::resetRepoGpgCheck() { _pimpl->repoGpgCheck.restoreToDefault(); }
1251 void ZConfig::resetPkgGpgCheck() { _pimpl->pkgGpgCheck.restoreToDefault(); }
1252
1253
1254 ResolverFocus ZConfig::solver_focus() const { return _pimpl->targetDefaults().solver_focus; }
1255 bool ZConfig::solver_onlyRequires() const { return _pimpl->targetDefaults().solver_onlyRequires; }
1256 bool ZConfig::solver_allowVendorChange() const { return _pimpl->targetDefaults().solver_allowVendorChange; }
1257 bool ZConfig::solver_dupAllowDowngrade() const { return _pimpl->targetDefaults().solver_dupAllowDowngrade; }
1258 bool ZConfig::solver_dupAllowNameChange() const { return _pimpl->targetDefaults().solver_dupAllowNameChange; }
1259 bool ZConfig::solver_dupAllowArchChange() const { return _pimpl->targetDefaults().solver_dupAllowArchChange; }
1260 bool ZConfig::solver_dupAllowVendorChange() const { return _pimpl->targetDefaults().solver_dupAllowVendorChange; }
1261 bool ZConfig::solver_cleandepsOnRemove() const { return _pimpl->targetDefaults().solver_cleandepsOnRemove; }
1262 unsigned ZConfig::solver_upgradeTestcasesToKeep() const { return _pimpl->targetDefaults().solver_upgradeTestcasesToKeep; }
1263
1264 bool ZConfig::solverUpgradeRemoveDroppedPackages() const { return _pimpl->targetDefaults().solverUpgradeRemoveDroppedPackages; }
1265 void ZConfig::setSolverUpgradeRemoveDroppedPackages( bool val_r ) { _pimpl->targetDefaults().solverUpgradeRemoveDroppedPackages.set( val_r ); }
1266 void ZConfig::resetSolverUpgradeRemoveDroppedPackages() { _pimpl->targetDefaults().solverUpgradeRemoveDroppedPackages.restoreToDefault(); }
1267
1268
1269 Pathname ZConfig::solver_checkSystemFile() const
1270 { return ( _pimpl->solver_checkSystemFile.empty()
1271 ? (configPath()/"systemCheck") : _pimpl->solver_checkSystemFile ); }
1272
1273 Pathname ZConfig::solver_checkSystemFileDir() const
1274 { return ( _pimpl->solver_checkSystemFileDir.empty()
1275 ? (configPath()/"systemCheck.d") : _pimpl->solver_checkSystemFileDir ); }
1276
1277
1278 namespace
1279 {
1280 inline void sigMultiversionSpecChanged()
1281 {
1282 sat::detail::PoolMember::myPool().multiversionSpecChanged();
1283 }
1284 }
1285
1286 const std::set<std::string> & ZConfig::multiversionSpec() const { return _pimpl->multiversion(); }
1287 void ZConfig::multiversionSpec( std::set<std::string> new_r ) { _pimpl->multiversion().swap( new_r ); sigMultiversionSpecChanged(); }
1288 void ZConfig::clearMultiversionSpec() { _pimpl->multiversion().clear(); sigMultiversionSpecChanged(); }
1289 void ZConfig::addMultiversionSpec( const std::string & name_r ) { _pimpl->multiversion().insert( name_r ); sigMultiversionSpecChanged(); }
1290 void ZConfig::removeMultiversionSpec( const std::string & name_r ) { _pimpl->multiversion().erase( name_r ); sigMultiversionSpecChanged(); }
1291
1292 bool ZConfig::apply_locks_file() const
1293 { return _pimpl->apply_locks_file; }
1294
1295 Pathname ZConfig::update_dataPath()
1296#if LEGACY(1735)
1297 const
1298#endif
1299 {
1300 return Pathname("/var/adm");
1301 }
1302
1303 Pathname ZConfig::update_messagesPath()
1304#if LEGACY(1735)
1305 const
1306#endif
1307 {
1308 return Pathname(update_dataPath()/"update-messages");
1309 }
1310
1311 Pathname ZConfig::update_scriptsPath()
1312#if LEGACY(1735)
1313 const
1314#endif
1315 {
1316 return Pathname(update_dataPath()/"update-scripts");
1317 }
1318
1319 std::string ZConfig::updateMessagesNotify() const
1320 { return _pimpl->updateMessagesNotify; }
1321
1322 void ZConfig::setUpdateMessagesNotify( const std::string & val_r )
1323 { _pimpl->updateMessagesNotify.set( val_r ); }
1324
1325 void ZConfig::resetUpdateMessagesNotify()
1326 { _pimpl->updateMessagesNotify.restoreToDefault(); }
1327
1329
1330 target::rpm::RpmInstFlags ZConfig::rpmInstallFlags() const
1331 { return _pimpl->rpmInstallFlags; }
1332
1333
1334 Pathname ZConfig::historyLogFile() const
1335 {
1336 return ( _pimpl->history_log_path.empty() ?
1337 Pathname("/var/log/zypp/history") : _pimpl->history_log_path );
1338 }
1339
1340 Pathname ZConfig::credentialsGlobalDir() const
1341 {
1342 return _pimpl->_mediaConf.credentialsGlobalDir();
1343 }
1344
1345 Pathname ZConfig::credentialsGlobalFile() const
1346 {
1347 return _pimpl->_mediaConf.credentialsGlobalFile();
1348 }
1349
1351
1352 std::string ZConfig::distroverpkg() const
1353 { return "system-release"; }
1354
1356
1357 Pathname ZConfig::pluginsPath() const
1358 { return _pimpl->pluginsPath.get(); }
1359
1360 std::string ZConfig::multiversionKernels() const
1361 {
1362 return _pimpl->cfg_kernel_keep_spec;
1363 }
1364
1366
1367 std::ostream & ZConfig::about( std::ostream & str ) const
1368 {
1369 str << "libzypp: " LIBZYPP_VERSION_STRING << " (" << LIBZYPP_CODESTREAM << ")" << endl;
1370
1371 str << "libsolv: " << solv_version;
1372 if ( ::strcmp( solv_version, LIBSOLV_VERSION_STRING ) )
1373 str << " (built against " << LIBSOLV_VERSION_STRING << ")";
1374 str << endl;
1375
1376 str << "zypp.conf: '" << _pimpl->_parsedZyppConf << "'" << endl;
1377 str << "TextLocale: '" << textLocale() << "' (" << defaultTextLocale() << ")" << endl;
1378 str << "SystemArchitecture: '" << systemArchitecture() << "' (" << defaultSystemArchitecture() << ")" << endl;
1379 return str;
1380 }
1381
1383} // namespace zypp
Pool.h
ZConfig.h
ZYppFactory.h
IniDict::section_const_iterator
MapKVIteratorTraits< SectionSet >::Key_const_iterator section_const_iterator
Definition inidict.h:47
IniDict::entry_const_iterator
EntrySet::const_iterator entry_const_iterator
Definition inidict.h:48
Target_Ptr
zypp::Arch
Architecture.
Definition Arch.h:37
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)
Return path_r prefixed with root_r, unless it is already prefixed.
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:400
zypp::ZConfig::Impl::cfg_multiversion_path
Pathname cfg_multiversion_path
Definition ZConfig.cc:790
zypp::ZConfig::Impl::download_mediaMountdir
DefaultOption< Pathname > download_mediaMountdir
Definition ZConfig.cc:804
zypp::ZConfig::Impl::_mediaConf
MediaConfig & _mediaConf
Definition ZConfig.cc:833
zypp::ZConfig::Impl::cfg_metadata_path
DefaultOption< Pathname > cfg_metadata_path
Definition ZConfig.cc:779
zypp::ZConfig::Impl::cfg_known_repos_path
Pathname cfg_known_repos_path
Definition ZConfig.cc:784
zypp::ZConfig::Impl::cfg_known_services_path
Pathname cfg_known_services_path
Definition ZConfig.cc:785
zypp::ZConfig::Impl::_autodetectSystemRoot
Pathname _autodetectSystemRoot() const
bsc#1237044: Provide announceSystemRoot to allow commands using –root without launching a Target.
Definition ZConfig.cc:736
zypp::ZConfig::Impl::cfg_vars_path
Pathname cfg_vars_path
Definition ZConfig.cc:786
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:781
zypp::ZConfig::Impl::download_use_deltarpm_always
bool download_use_deltarpm_always
Definition ZConfig.cc:802
zypp::ZConfig::Impl::_parsedZyppConf
Pathname _parsedZyppConf
Remember any parsed zypp.conf.
Definition ZConfig.cc:770
zypp::ZConfig::Impl::notifyTargetChanged
void notifyTargetChanged()
Definition ZConfig.cc:742
zypp::ZConfig::Impl::solver_checkSystemFile
Pathname solver_checkSystemFile
Definition ZConfig.cc:812
zypp::ZConfig::Impl::Impl
Impl(const Impl &)=delete
zypp::ZConfig::Impl::_multiversionMap
MultiversionMap _multiversionMap
Definition ZConfig.cc:931
zypp::ZConfig::Impl::apply_locks_file
bool apply_locks_file
Definition ZConfig.cc:818
zypp::ZConfig::Impl::history_log_path
Pathname history_log_path
Definition ZConfig.cc:822
zypp::ZConfig::Impl::locks_file
Pathname locks_file
Definition ZConfig.cc:792
zypp::ZConfig::Impl::targetDefaults
const TargetDefaults & targetDefaults() const
Definition ZConfig.cc:837
zypp::ZConfig::Impl::getMultiversion
MultiversionSpec & getMultiversion() const
Definition ZConfig.cc:928
zypp::ZConfig::Impl::Impl
Impl(Impl &&)=delete
zypp::ZConfig::Impl::repoRefreshLocales
LocaleSet repoRefreshLocales
Definition ZConfig.cc:798
zypp::ZConfig::Impl::cfg_cache_path
DefaultOption< Pathname > cfg_cache_path
Definition ZConfig.cc:778
zypp::ZConfig::Impl::geoipHosts
std::vector< std::string > geoipHosts
Definition ZConfig.cc:830
zypp::ZConfig::Impl::targetDefaults
TargetDefaults & targetDefaults()
Definition ZConfig.cc:838
zypp::ZConfig::Impl::~Impl
~Impl()
Definition ZConfig.cc:727
zypp::ZConfig::Impl::_announced_root_path
Pathname _announced_root_path
Definition ZConfig.cc:771
zypp::ZConfig::Impl::pluginsPath
Option< Pathname > pluginsPath
Definition ZConfig.cc:826
zypp::ZConfig::Impl::userData
std::string userData
Definition ZConfig.cc:824
zypp::ZConfig::Impl::cfg_kernel_keep_spec
std::string cfg_kernel_keep_spec
Definition ZConfig.cc:791
zypp::ZConfig::Impl::cfg_lockTimeout
long cfg_lockTimeout
Definition ZConfig.cc:773
zypp::ZConfig::Impl::repoGpgCheck
DefaultOption< TriBool > repoGpgCheck
Definition ZConfig.cc:809
zypp::ZConfig::Impl::repo_refresh_delay
unsigned repo_refresh_delay
Definition ZConfig.cc:797
zypp::ZConfig::Impl::commit_downloadMode
Option< DownloadMode > commit_downloadMode
Definition ZConfig.cc:806
zypp::ZConfig::Impl::_currentTargetDefaults
std::optional< TargetDefaults > _currentTargetDefaults
TargetDefaults while –root.
Definition ZConfig.cc:841
zypp::ZConfig::Impl::repo_add_probe
bool repo_add_probe
Definition ZConfig.cc:796
zypp::ZConfig::Impl::multiversion
MultiversionSpec & multiversion()
Definition ZConfig.cc:815
zypp::ZConfig::Impl::cfg_textLocale
Locale cfg_textLocale
Definition ZConfig.cc:776
zypp::ZConfig::Impl::cfg_arch
Arch cfg_arch
Definition ZConfig.cc:775
zypp::ZConfig::Impl::geoipEnabled
bool geoipEnabled
Definition ZConfig.cc:828
zypp::ZConfig::Impl::download_media_prefer_download
DefaultOption< bool > download_media_prefer_download
Definition ZConfig.cc:803
zypp::ZConfig::Impl::download_use_deltarpm
bool download_use_deltarpm
Definition ZConfig.cc:801
zypp::ZConfig::Impl::MultiversionSpec
std::set< std::string > MultiversionSpec
Definition ZConfig.cc:401
zypp::ZConfig::Impl::repoLabelIsAlias
bool repoLabelIsAlias
Definition ZConfig.cc:799
zypp::ZConfig::Impl::solver_checkSystemFileDir
Pathname solver_checkSystemFileDir
Definition ZConfig.cc:813
zypp::ZConfig::Impl::cfg_config_path
Pathname cfg_config_path
Definition ZConfig.cc:783
zypp::ZConfig::Impl::_initialTargetDefaults
TargetDefaults _initialTargetDefaults
Initial TargetDefaults from /.
Definition ZConfig.cc:840
zypp::ZConfig::Impl::rpmInstallFlags
target::rpm::RpmInstFlags rpmInstallFlags
Definition ZConfig.cc:820
zypp::ZConfig::Impl::multiversion
const MultiversionSpec & multiversion() const
Definition ZConfig.cc:816
zypp::ZConfig::Impl::cfg_repo_mgr_root_path
Pathname cfg_repo_mgr_root_path
Definition ZConfig.cc:787
zypp::ZConfig::Impl::pkgGpgCheck
DefaultOption< TriBool > pkgGpgCheck
Definition ZConfig.cc:810
zypp::ZConfig::Impl::updateMessagesNotify
DefaultOption< std::string > updateMessagesNotify
Definition ZConfig.cc:794
zypp::ZConfig::Impl::cfg_vendor_path
Pathname cfg_vendor_path
Definition ZConfig.cc:789
zypp::ZConfig::Impl::cfg_solvfiles_path
DefaultOption< Pathname > cfg_solvfiles_path
Definition ZConfig.cc:780
zypp::ZConfig::Impl::Impl
Impl()
Definition ZConfig.cc:480
zypp::ZConfig::Impl::gpgCheck
DefaultOption< bool > gpgCheck
Definition ZConfig.cc:808
zypp::ZConfig::hasUserData
bool hasUserData() const
Whether a (non empty) user data sting is defined.
Definition ZConfig.cc:1046
zypp::ZConfig::solver_cleandepsOnRemove
bool solver_cleandepsOnRemove() const
Whether removing a package should also remove no longer needed requirements.
Definition ZConfig.cc:1261
zypp::ZConfig::userData
std::string userData() const
User defined string value to be passed to log, history, plugins...
Definition ZConfig.cc:1049
zypp::ZConfig::knownServicesPath
Pathname knownServicesPath() const
Path where the known services .service files are kept (configPath()/services.d).
Definition ZConfig.cc:1144
zypp::ZConfig::removeMultiversionSpec
void removeMultiversionSpec(const std::string &name_r)
Definition ZConfig.cc:1290
zypp::ZConfig::repoPackagesPath
Pathname repoPackagesPath() const
Path where the repo packages are downloaded and kept (repoCachePath()/packages).
Definition ZConfig.cc:1107
zypp::ZConfig::repo_refresh_delay
unsigned repo_refresh_delay() const
Amount of time in minutes that must pass before another refresh.
Definition ZConfig.cc:1191
zypp::ZConfig::systemArchitecture
Arch systemArchitecture() const
The system architecture zypp uses.
Definition ZConfig.cc:1004
zypp::ZConfig::textLocale
Locale textLocale() const
The locale for translated texts zypp uses.
Definition ZConfig.cc:1028
zypp::ZConfig::geoipHostnames
const std::vector< std::string > geoipHostnames() const
All hostnames we want to rewrite using the geoip feature.
Definition ZConfig.cc:1165
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:1295
zypp::ZConfig::solver_focus
ResolverFocus solver_focus() const
The resolver's general attitude when resolving jobs.
Definition ZConfig.cc:1254
zypp::ZConfig::builtinRepoSolvfilesPath
Pathname builtinRepoSolvfilesPath() const
The builtin config file value.
Definition ZConfig.cc:1124
zypp::ZConfig::pluginsPath
Pathname pluginsPath() const
Defaults to /usr/lib/zypp/plugins.
Definition ZConfig.cc:1357
zypp::ZConfig::repoManagerRoot
Pathname repoManagerRoot() const
The RepoManager root directory.
Definition ZConfig.cc:980
zypp::ZConfig::resetRepoGpgCheck
void resetRepoGpgCheck()
Reset to the zconfig default.
Definition ZConfig.cc:1250
zypp::ZConfig::gpgCheck
bool gpgCheck() const
Turn signature checking on/off (on)
Definition ZConfig.cc:1241
zypp::ZConfig::knownReposPath
Pathname knownReposPath() const
Path where the known repositories .repo files are kept (configPath()/repos.d).
Definition ZConfig.cc:1138
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:1230
zypp::ZConfig::setRepoManagerRoot
void setRepoManagerRoot(const Pathname &root)
Sets the RepoManager root directory.
Definition ZConfig.cc:986
zypp::ZConfig::solver_dupAllowArchChange
bool solver_dupAllowArchChange() const
DUP tune: Whether to allow package arch changes upon DUP.
Definition ZConfig.cc:1259
zypp::ZConfig::setTextLocale
void setTextLocale(const Locale &locale_r)
Set the preferred locale for translated texts.
Definition ZConfig.cc:1031
zypp::ZConfig::solverUpgradeRemoveDroppedPackages
bool solverUpgradeRemoveDroppedPackages() const
Whether dist upgrade should remove a products dropped packages (true).
Definition ZConfig.cc:1264
zypp::ZConfig::notifyTargetChanged
void notifyTargetChanged()
internal
Definition ZConfig.cc:974
zypp::ZConfig::defaultTextLocale
static Locale defaultTextLocale()
The autodetected preferred locale for translated texts.
Definition ZConfig.cc:1022
zypp::ZConfig::download_mediaMountdir
Pathname download_mediaMountdir() const
Path where media are preferably mounted or downloaded.
Definition ZConfig.cc:1233
zypp::ZConfig::update_scriptsPath
static Pathname update_scriptsPath()
Path where the update scripts are stored ( /var/adm/update-scripts )
Definition ZConfig.cc:1311
zypp::ZConfig::resetSolverUpgradeRemoveDroppedPackages
void resetSolverUpgradeRemoveDroppedPackages()
Reset solverUpgradeRemoveDroppedPackages to the zypp.conf default.
Definition ZConfig.cc:1266
zypp::ZConfig::apply_locks_file
bool apply_locks_file() const
Whether locks file should be read and applied after start (true)
Definition ZConfig.cc:1292
zypp::ZConfig::solver_allowVendorChange
bool solver_allowVendorChange() const
Whether vendor check is by default enabled.
Definition ZConfig.cc:1256
zypp::ZConfig::set_default_download_mediaMountdir
void set_default_download_mediaMountdir()
Reset to zypp.cong default.
Definition ZConfig.cc:1235
zypp::ZConfig::repoCachePath
Pathname repoCachePath() const
Path where the caches are kept (/var/cache/zypp)
Definition ZConfig.cc:1069
zypp::ZConfig::setPkgGpgCheck
void setPkgGpgCheck(TriBool val_r)
Change the value.
Definition ZConfig.cc:1247
zypp::ZConfig::needrebootPath
Pathname needrebootPath() const
Path where the custom needreboot config files are kept (configPath()/needreboot.d).
Definition ZConfig.cc:1153
zypp::ZConfig::setUserData
bool setUserData(const std::string &str_r)
Set a new userData string.
Definition ZConfig.cc:1052
zypp::ZConfig::systemRoot
Pathname systemRoot() const
The target root directory.
Definition ZConfig.cc:977
zypp::ZConfig::download_max_silent_tries
long download_max_silent_tries() const
Maximum silent tries.
Definition ZConfig.cc:1227
zypp::ZConfig::repo_add_probe
bool repo_add_probe() const
Whether repository urls should be probed.
Definition ZConfig.cc:1188
zypp::ZConfig::rpmInstallFlags
target::rpm::RpmInstFlags rpmInstallFlags() const
The default target::rpm::RpmInstFlags for ZYppCommitPolicy.
Definition ZConfig.cc:1330
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:1322
zypp::ZConfig::solver_upgradeTestcasesToKeep
unsigned solver_upgradeTestcasesToKeep() const
When committing a dist upgrade (e.g.
Definition ZConfig.cc:1262
zypp::ZConfig::repoMetadataPath
Pathname repoMetadataPath() const
Path where the repo metadata is downloaded and kept (repoCachePath()/raw).
Definition ZConfig.cc:1085
zypp::ZConfig::geoipCachePath
Pathname geoipCachePath() const
Path where the geoip caches are kept (/var/cache/zypp/geoip)
Definition ZConfig.cc:1162
zypp::ZConfig::vendorPath
Pathname vendorPath() const
Directory for equivalent vendor definitions (configPath()/vendors.d)
Definition ZConfig.cc:1174
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:1221
zypp::ZConfig::commit_downloadMode
DownloadMode commit_downloadMode() const
Commit download policy to use as default.
Definition ZConfig.cc:1237
zypp::ZConfig::needrebootFile
Pathname needrebootFile() const
Path of the default needreboot config file (configPath()/needreboot).
Definition ZConfig.cc:1150
zypp::ZConfig::setGpgCheck
void setGpgCheck(bool val_r)
Change the value.
Definition ZConfig.cc:1245
zypp::ZConfig::solver_dupAllowVendorChange
bool solver_dupAllowVendorChange() const
DUP tune: Whether to allow package vendor changes upon DUP.
Definition ZConfig.cc:1260
zypp::ZConfig::~ZConfig
~ZConfig()
Dtor.
Definition ZConfig.cc:962
zypp::ZConfig::setGeoipEnabled
void setGeoipEnabled(bool enable=true)
Enables or disables the use of the geoip feature of download.opensuse.org.
Definition ZConfig.cc:1156
zypp::ZConfig::locksFile
Pathname locksFile() const
Path where zypp can find or create lock file (configPath()/locks)
Definition ZConfig.cc:1180
zypp::ZConfig::_pimpl
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
Pointer to implementation.
Definition ZConfig.h:631
zypp::ZConfig::repoSolvfilesPath
Pathname repoSolvfilesPath() const
Path where the repo solv files are created and kept (repoCachePath()/solv).
Definition ZConfig.cc:1096
zypp::ZConfig::geoipEnabled
bool geoipEnabled() const
Returns true if zypp should use the geoip feature of download.opensuse.org.
Definition ZConfig.cc:1159
zypp::ZConfig::update_messagesPath
static Pathname update_messagesPath()
Path where the update messages are stored ( /var/adm/update-messages )
Definition ZConfig.cc:1303
zypp::ZConfig::historyLogFile
Pathname historyLogFile() const
Path where ZYpp install history is logged.
Definition ZConfig.cc:1334
zypp::ZConfig::setSystemArchitecture
void setSystemArchitecture(const Arch &arch_r)
Override the zypp system architecture.
Definition ZConfig.cc:1007
zypp::ZConfig::pkgGpgCheck
TriBool pkgGpgCheck() const
Check rpm package signatures (indeterminate - according to gpgcheck)
Definition ZConfig.cc:1243
zypp::ZConfig::instance
static ZConfig & instance()
Singleton ctor.
Definition ZConfig.cc:940
zypp::ZConfig::setRepoPackagesPath
void setRepoPackagesPath(const Pathname &path_r)
Set a new path as the default repo cache path.
Definition ZConfig.cc:1113
zypp::ZConfig::setRepoSolvfilesPath
void setRepoSolvfilesPath(const Pathname &path_r)
Set a new path as the default repo cache path.
Definition ZConfig.cc:1102
zypp::ZConfig::resetUpdateMessagesNotify
void resetUpdateMessagesNotify()
Reset to the zypp.conf default.
Definition ZConfig.cc:1325
zypp::ZConfig::about
std::ostream & about(std::ostream &str) const
Print some detail about the current libzypp version.
Definition ZConfig.cc:1367
zypp::ZConfig::multiversionSpec
const std::set< std::string > & multiversionSpec() const
Definition ZConfig.cc:1286
zypp::ZConfig::set_download_mediaMountdir
void set_download_mediaMountdir(Pathname newval_r)
Set alternate value.
Definition ZConfig.cc:1234
zypp::ZConfig::download_use_deltarpm
bool download_use_deltarpm() const
Whether to consider using a deltarpm when downloading a package.
Definition ZConfig.cc:1203
zypp::ZConfig::repoGpgCheck
TriBool repoGpgCheck() const
Check repo matadata signatures (indeterminate - according to gpgcheck)
Definition ZConfig.cc:1242
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:1212
zypp::ZConfig::updateMessagesNotify
std::string updateMessagesNotify() const
Command definition for sending update messages.
Definition ZConfig.cc:1319
zypp::ZConfig::addMultiversionSpec
void addMultiversionSpec(const std::string &name_r)
Definition ZConfig.cc:1289
zypp::ZConfig::builtinRepoCachePath
Pathname builtinRepoCachePath() const
The builtin config file value.
Definition ZConfig.cc:1118
zypp::ZConfig::builtinRepoPackagesPath
Pathname builtinRepoPackagesPath() const
The builtin config file value.
Definition ZConfig.cc:1127
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:1269
zypp::ZConfig::builtinRepoMetadataPath
Pathname builtinRepoMetadataPath() const
The builtin config file value.
Definition ZConfig.cc:1121
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:1215
zypp::ZConfig::lockTimeout
long lockTimeout() const
The number of seconds to wait for the zypp lock to become available.
Definition ZConfig.cc:965
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:1273
zypp::ZConfig::resetGpgCheck
void resetGpgCheck()
Reset to the zconfig default.
Definition ZConfig.cc:1249
zypp::ZConfig::setSolverUpgradeRemoveDroppedPackages
void setSolverUpgradeRemoveDroppedPackages(bool val_r)
Set solverUpgradeRemoveDroppedPackages to val_r.
Definition ZConfig.cc:1265
zypp::ZConfig::configPath
Pathname configPath() const
Path where the configfiles are kept (/etc/zypp).
Definition ZConfig.cc:1132
zypp::ZConfig::defaultSystemArchitecture
static Arch defaultSystemArchitecture()
The autodetected system architecture.
Definition ZConfig.cc:998
zypp::ZConfig::ZConfig
ZConfig()
Default ctor.
Definition ZConfig.cc:951
zypp::ZConfig::pubkeyCachePath
Pathname pubkeyCachePath() const
Path where the pubkey caches.
Definition ZConfig.cc:1075
zypp::ZConfig::download_max_concurrent_connections
long download_max_concurrent_connections() const
Maximum number of concurrent connections for a single transfer.
Definition ZConfig.cc:1218
zypp::ZConfig::resetPkgGpgCheck
void resetPkgGpgCheck()
Reset to the zconfig default.
Definition ZConfig.cc:1251
zypp::ZConfig::announceSystemRoot
void announceSystemRoot(const Pathname &root_r)
Announce a target root directory without launching the Target.
Definition ZConfig.cc:989
zypp::ZConfig::solver_onlyRequires
bool solver_onlyRequires() const
Solver regards required packages,patterns,... only.
Definition ZConfig.cc:1255
zypp::ZConfig::varsPath
Pathname varsPath() const
Path containing custom repo variable definitions (configPath()/vars.d).
Definition ZConfig.cc:1168
zypp::ZConfig::solver_dupAllowNameChange
bool solver_dupAllowNameChange() const
DUP tune: Whether to follow package renames upon DUP.
Definition ZConfig.cc:1258
zypp::ZConfig::repoLabelIsAlias
bool repoLabelIsAlias() const
Whether to use repository alias or name in user messages (progress, exceptions, .....
Definition ZConfig.cc:1197
zypp::ZConfig::clearMultiversionSpec
void clearMultiversionSpec()
Definition ZConfig.cc:1288
zypp::ZConfig::repoRefreshLocales
LocaleSet repoRefreshLocales() const
List of locales for which translated package descriptions should be downloaded.
Definition ZConfig.cc:1194
zypp::ZConfig::download_max_download_speed
long download_max_download_speed() const
Maximum download speed (bytes per second)
Definition ZConfig.cc:1224
zypp::ZConfig::setRepoMetadataPath
void setRepoMetadataPath(const Pathname &path_r)
Set a new path as the default repo cache path.
Definition ZConfig.cc:1091
zypp::ZConfig::solver_dupAllowDowngrade
bool solver_dupAllowDowngrade() const
DUP tune: Whether to allow version downgrades upon DUP.
Definition ZConfig.cc:1257
zypp::ZConfig::multiversionKernels
std::string multiversionKernels() const
Definition ZConfig.cc:1360
zypp::ZConfig::distroverpkg
std::string distroverpkg() const
Package telling the "product version" on systems not using /etc/product.d/baseproduct.
Definition ZConfig.cc:1352
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:1206
zypp::ZConfig::setRepoCachePath
void setRepoCachePath(const Pathname &path_r)
Set a new path as the default repo cache path.
Definition ZConfig.cc:1080
zypp::ZConfig::setRepoGpgCheck
void setRepoGpgCheck(TriBool val_r)
Change the value.
Definition ZConfig.cc:1246
zypp::ZConfig::credentialsGlobalDir
Pathname credentialsGlobalDir() const
Defaults to /etc/zypp/credentials.d.
Definition ZConfig.cc:1340
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:1209
zypp::ZConfig::credentialsGlobalFile
Pathname credentialsGlobalFile() const
Defaults to /etc/zypp/credentials.cat.
Definition ZConfig.cc:1345
zypp::ZYppFactory::getZYpp
ZYpp::Ptr getZYpp()
Convenience to get the Pointer to the ZYpp instance.
Definition ZYppFactory.h:77
zypp::filesystem::PathInfo
Wrapper class for stat/lstat.
Definition PathInfo.h:226
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:47
zypp::filesystem::Pathname::empty
bool empty() const
Test for an empty path.
Definition Pathname.h:116
zypp::iostr::EachLine
Simple lineparser: Traverse each line in a file.
Definition IOStream.h:113
zypp::iostr::EachLine::next
bool next()
Advance to next line.
Definition IOStream.cc:72
zypp::parser::IniDict
Parses a INI file and offers its structure as a dictionary.
Definition inidict.h:42
zypp::parser::IniDict::sectionsEnd
section_const_iterator sectionsEnd() const
Definition inidict.cc:113
zypp::parser::IniDict::entriesBegin
entry_const_iterator entriesBegin(const std::string &section) const
Definition inidict.cc:75
zypp::parser::IniDict::entries
Iterable< entry_const_iterator > entries(const std::string &section) const
Definition inidict.cc:97
zypp::parser::IniDict::sectionsBegin
section_const_iterator sectionsBegin() const
Definition inidict.cc:108
zypp::parser::IniDict::entriesEnd
entry_const_iterator entriesEnd(const std::string &section) const
Definition inidict.cc:86
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:640
zypp::str::regex
Regular expression.
Definition Regex.h:95
zypp::str::smatch
Regular expression match result.
Definition Regex.h:168
std
Definition Arch.h:364
str
String related utilities and Regular expression matching.
zypp::env
Namespace intended to collect all environment variables we use.
Definition Env.h:23
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::strToTriBool
TriBool strToTriBool(const C_Str &str)
Parse str into a bool if it's a legal true or false string; else indeterminate.
Definition String.cc:94
zypp::str::hasPrefix
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
Definition String.h:1026
zypp::str::regex_match
bool regex_match(const std::string &s, smatch &matches, const regex &regex)
\relates regex \ingroup ZYPP_STR_REGEX \relates regex \ingroup ZYPP_STR_REGEX
Definition Regex.h:70
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:429
zypp::str::split
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", const Trim trim_r=NO_TRIM)
Split line_r into words.
Definition String.h:531
zypp::str::strtonum
TInt strtonum(const C_Str &str)
Parsing numbers from string.
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:594
zypp::str::compareCI
int compareCI(const C_Str &lhs, const C_Str &rhs)
Definition String.h:983
zypp::target::rpm::RPMINST_EXCLUDEDOCS
@ RPMINST_EXCLUDEDOCS
Definition RpmFlags.h:40
zypp::target
Definition KeyRing.h:325
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::fromString
bool fromString(const std::string &val_r, ResolverFocus &ret_r)
Definition ResolverFocus.cc:39
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::TriBool
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition String.h:30
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:358
zypp::DefaultOption::DefaultOption
DefaultOption(value_type initial_r)
Definition ZConfig.cc:362
zypp::DefaultOption::_default
option_type _default
Definition ZConfig.cc:387
zypp::DefaultOption::setDefault
void setDefault(value_type newval_r)
Set a new default value.
Definition ZConfig.cc:383
zypp::DefaultOption::value_type
Tp value_type
Definition ZConfig.cc:359
zypp::DefaultOption::restoreToDefault
void restoreToDefault(value_type newval_r)
Reset value to a new default.
Definition ZConfig.cc:375
zypp::DefaultOption::operator=
DefaultOption & operator=(value_type newval_r)
Definition ZConfig.cc:367
zypp::DefaultOption::restoreToDefault
void restoreToDefault()
Reset value to the current default.
Definition ZConfig.cc:371
zypp::DefaultOption::option_type
Option< Tp > option_type
Definition ZConfig.cc:360
zypp::DefaultOption::getDefault
const value_type & getDefault() const
Get the current default value.
Definition ZConfig.cc:379
zypp::Option
Mutable option.
Definition ZConfig.cc:328
zypp::Option::get
const value_type & get() const
Get the value.
Definition ZConfig.cc:340
zypp::Option::operator=
Option & operator=(value_type newval_r)
Definition ZConfig.cc:336
zypp::Option::set
void set(value_type newval_r)
Set a new value.
Definition ZConfig.cc:348
zypp::Option::Option
Option(value_type initial_r)
No default ctor, explicit initialisation!
Definition ZConfig.cc:332
zypp::Option::value_type
Tp value_type
Definition ZConfig.cc:329
zypp::Option::_val
value_type _val
Definition ZConfig.cc:352
zypp::ZConfig::Impl::MultiversionMap
Definition ZConfig.cc:850
zypp::ZConfig::Impl::MultiversionMap::scanConfAt
int scanConfAt(const Pathname &root_r, MultiversionSpec &spec_r, const Impl &zConfImpl_r)
Definition ZConfig.cc:884
zypp::ZConfig::Impl::MultiversionMap::getSpec
MultiversionSpec & getSpec(Pathname root_r, const Impl &zConfImpl_r)
Definition ZConfig.cc:853
zypp::ZConfig::Impl::MultiversionMap::getDefaultSpec
MultiversionSpec & getDefaultSpec()
Definition ZConfig.cc:880
zypp::ZConfig::Impl::MultiversionMap::scanDirAt
void scanDirAt(const Pathname &root_r, MultiversionSpec &spec_r, const Impl &zConfImpl_r)
Definition ZConfig.cc:900
zypp::ZConfig::Impl::MultiversionMap::_specMap
SpecMap _specMap
Definition ZConfig.cc:925
zypp::ZConfig::Impl::MultiversionMap::SpecMap
std::map< Pathname, MultiversionSpec > SpecMap
Definition ZConfig.cc:851
zypp::ZConfig::Impl::TargetDefaults
Settings that follow a changed Target.
Definition ZConfig.cc:405
zypp::ZConfig::Impl::TargetDefaults::solver_dupAllowVendorChange
Option< bool > solver_dupAllowVendorChange
Definition ZConfig.cc:473
zypp::ZConfig::Impl::TargetDefaults::solverUpgradeRemoveDroppedPackages
DefaultOption< bool > solverUpgradeRemoveDroppedPackages
Definition ZConfig.cc:476
zypp::ZConfig::Impl::TargetDefaults::TargetDefaults
TargetDefaults()
Definition ZConfig.cc:406
zypp::ZConfig::Impl::TargetDefaults::solver_upgradeTestcasesToKeep
Option< unsigned > solver_upgradeTestcasesToKeep
Definition ZConfig.cc:475
zypp::ZConfig::Impl::TargetDefaults::solver_dupAllowDowngrade
Option< bool > solver_dupAllowDowngrade
Definition ZConfig.cc:470
zypp::ZConfig::Impl::TargetDefaults::solver_dupAllowArchChange
Option< bool > solver_dupAllowArchChange
Definition ZConfig.cc:472
zypp::ZConfig::Impl::TargetDefaults::solver_onlyRequires
Option< bool > solver_onlyRequires
Definition ZConfig.cc:468
zypp::ZConfig::Impl::TargetDefaults::consume
bool consume(const std::string &entry, const std::string &value)
Definition ZConfig.cc:419
zypp::ZConfig::Impl::TargetDefaults::solver_focus
ResolverFocus solver_focus
Definition ZConfig.cc:467
zypp::ZConfig::Impl::TargetDefaults::solver_cleandepsOnRemove
Option< bool > solver_cleandepsOnRemove
Definition ZConfig.cc:474
zypp::ZConfig::Impl::TargetDefaults::solver_allowVendorChange
Option< bool > solver_allowVendorChange
Definition ZConfig.cc:469
zypp::ZConfig::Impl::TargetDefaults::solver_dupAllowNameChange
Option< bool > solver_dupAllowNameChange
Definition ZConfig.cc:471
zypp::sat::detail::PoolMember::myPool
static PoolImpl & myPool()
Definition PoolImpl.cc:184
for_
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition Easy.h:27
DBG
#define DBG
Definition Logger.h:99
MIL
#define MIL
Definition Logger.h:100
ERR
#define ERR
Definition Logger.h:102
WAR
#define WAR
Definition Logger.h:101
PathInfo.h
IOStream.h
LogTools.h
Regex.h
String.h