libzypp  15.28.6
ZConfig.cc
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 extern "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 "zypp/base/LogTools.h"
25 #include "zypp/base/IOStream.h"
26 #include "zypp/base/InputStream.h"
27 #include "zypp/base/String.h"
28 #include "zypp/base/Regex.h"
29 
30 #include "zypp/ZConfig.h"
31 #include "zypp/ZYppFactory.h"
32 #include "zypp/PathInfo.h"
33 #include "zypp/parser/IniDict.h"
34 
35 #include "zypp/sat/Pool.h"
37 
38 using namespace std;
39 using namespace zypp::filesystem;
40 using namespace zypp::parser;
41 
42 #undef ZYPP_BASE_LOGGER_LOGGROUP
43 #define ZYPP_BASE_LOGGER_LOGGROUP "zconfig"
44 
46 namespace zypp
47 {
48 
57  namespace
59  {
60 
63  Arch _autodetectSystemArchitecture()
64  {
65  struct ::utsname buf;
66  if ( ::uname( &buf ) < 0 )
67  {
68  ERR << "Can't determine system architecture" << endl;
69  return Arch_noarch;
70  }
71 
72  Arch architecture( buf.machine );
73  MIL << "Uname architecture is '" << buf.machine << "'" << endl;
74 
75  if ( architecture == Arch_i686 )
76  {
77  // some CPUs report i686 but dont implement cx8 and cmov
78  // check for both flags in /proc/cpuinfo and downgrade
79  // to i586 if either is missing (cf bug #18885)
80  std::ifstream cpuinfo( "/proc/cpuinfo" );
81  if ( cpuinfo )
82  {
83  for( iostr::EachLine in( cpuinfo ); in; in.next() )
84  {
85  if ( str::hasPrefix( *in, "flags" ) )
86  {
87  if ( in->find( "cx8" ) == std::string::npos
88  || in->find( "cmov" ) == std::string::npos )
89  {
90  architecture = Arch_i586;
91  WAR << "CPU lacks 'cx8' or 'cmov': architecture downgraded to '" << architecture << "'" << endl;
92  }
93  break;
94  }
95  }
96  }
97  else
98  {
99  ERR << "Cant open " << PathInfo("/proc/cpuinfo") << endl;
100  }
101  }
102  else if ( architecture == Arch_sparc || architecture == Arch_sparc64 )
103  {
104  // Check for sun4[vum] to get the real arch. (bug #566291)
105  std::ifstream cpuinfo( "/proc/cpuinfo" );
106  if ( cpuinfo )
107  {
108  for( iostr::EachLine in( cpuinfo ); in; in.next() )
109  {
110  if ( str::hasPrefix( *in, "type" ) )
111  {
112  if ( in->find( "sun4v" ) != std::string::npos )
113  {
114  architecture = ( architecture == Arch_sparc64 ? Arch_sparc64v : Arch_sparcv9v );
115  WAR << "CPU has 'sun4v': architecture upgraded to '" << architecture << "'" << endl;
116  }
117  else if ( in->find( "sun4u" ) != std::string::npos )
118  {
119  architecture = ( architecture == Arch_sparc64 ? Arch_sparc64 : Arch_sparcv9 );
120  WAR << "CPU has 'sun4u': architecture upgraded to '" << architecture << "'" << endl;
121  }
122  else if ( in->find( "sun4m" ) != std::string::npos )
123  {
124  architecture = Arch_sparcv8;
125  WAR << "CPU has 'sun4m': architecture upgraded to '" << architecture << "'" << endl;
126  }
127  break;
128  }
129  }
130  }
131  else
132  {
133  ERR << "Cant open " << PathInfo("/proc/cpuinfo") << endl;
134  }
135  }
136  else if ( architecture == Arch_armv7l || architecture == Arch_armv6l )
137  {
138  std::ifstream platform( "/etc/rpm/platform" );
139  if (platform)
140  {
141  for( iostr::EachLine in( platform ); in; in.next() )
142  {
143  if ( str::hasPrefix( *in, "armv7hl-" ) )
144  {
145  architecture = Arch_armv7hl;
146  WAR << "/etc/rpm/platform contains armv7hl-: architecture upgraded to '" << architecture << "'" << endl;
147  break;
148  }
149  if ( str::hasPrefix( *in, "armv6hl-" ) )
150  {
151  architecture = Arch_armv6hl;
152  WAR << "/etc/rpm/platform contains armv6hl-: architecture upgraded to '" << architecture << "'" << endl;
153  break;
154  }
155  }
156  }
157  }
158 #if __GLIBC_PREREQ (2,16)
159  else if ( architecture == Arch_ppc64 )
160  {
161  const char * platform = (const char *)getauxval( AT_PLATFORM );
162  int powerlvl;
163  if ( platform && sscanf( platform, "power%d", &powerlvl ) == 1 && powerlvl > 6 )
164  architecture = Arch_ppc64p7;
165  }
166 #endif
167  return architecture;
168  }
169 
187  Locale _autodetectTextLocale()
188  {
189  Locale ret( Locale::enCode );
190  const char * envlist[] = { "LC_ALL", "LC_MESSAGES", "LANG", NULL };
191  for ( const char ** envvar = envlist; *envvar; ++envvar )
192  {
193  const char * envlang = getenv( *envvar );
194  if ( envlang )
195  {
196  std::string envstr( envlang );
197  if ( envstr != "POSIX" && envstr != "C" )
198  {
199  Locale lang( envstr );
200  if ( lang )
201  {
202  MIL << "Found " << *envvar << "=" << envstr << endl;
203  ret = lang;
204  break;
205  }
206  }
207  }
208  }
209  MIL << "Default text locale is '" << ret << "'" << endl;
210 #warning HACK AROUND BOOST_TEST_CATCH_SYSTEM_ERRORS
211  setenv( "BOOST_TEST_CATCH_SYSTEM_ERRORS", "no", 1 );
212  return ret;
213  }
214 
215 
216  inline Pathname _autodetectSystemRoot()
217  {
218  Target_Ptr target( getZYpp()->getTarget() );
219  return target ? target->root() : Pathname();
220  }
221 
222  inline Pathname _autodetectZyppConfPath()
223  {
224  const char *env_confpath = getenv( "ZYPP_CONF" );
225  return env_confpath ? env_confpath : "/etc/zypp/zypp.conf";
226  }
227 
229  } // namespace zypp
231 
233  template<class Tp>
234  struct Option
235  {
236  typedef Tp value_type;
237 
239  Option( const value_type & initial_r )
240  : _val( initial_r )
241  {}
242 
244  const value_type & get() const
245  { return _val; }
246 
248  operator const value_type &() const
249  { return _val; }
250 
252  void set( const value_type & newval_r )
253  { _val = newval_r; }
254 
257  { return _val; }
258 
259  private:
261  };
262 
264  template<class Tp>
265  struct DefaultOption : public Option<Tp>
266  {
267  typedef Tp value_type;
269 
270  DefaultOption( const value_type & initial_r )
271  : Option<Tp>( initial_r ), _default( initial_r )
272  {}
273 
276  { this->set( _default.get() ); }
277 
279  void restoreToDefault( const value_type & newval_r )
280  { setDefault( newval_r ); restoreToDefault(); }
281 
283  const value_type & getDefault() const
284  { return _default.get(); }
285 
287  void setDefault( const value_type & newval_r )
288  { _default.set( newval_r ); }
289 
290  private:
292  };
293 
295  //
296  // CLASS NAME : ZConfig::Impl
297  //
304  {
305  typedef std::set<std::string> MultiversionSpec;
306 
307  public:
308  Impl( const Pathname & override_r = Pathname() )
309  : _parsedZyppConf ( override_r )
310  , cfg_arch ( defaultSystemArchitecture() )
311  , cfg_textLocale ( defaultTextLocale() )
312  , updateMessagesNotify ( "single | /usr/lib/zypp/notify-message -p %p" )
313  , repo_add_probe ( false )
314  , repo_refresh_delay ( 10 )
315  , repoLabelIsAlias ( false )
316  , download_use_deltarpm ( true )
317  , download_use_deltarpm_always ( false )
318  , download_media_prefer_download( true )
319  , download_max_concurrent_connections( 5 )
320  , download_min_download_speed ( 0 )
321  , download_max_download_speed ( 0 )
322  , download_max_silent_tries ( 5 )
323  , download_transfer_timeout ( 180 )
324  , commit_downloadMode ( DownloadDefault )
325  , gpgCheck ( true )
326  , repoGpgCheck ( indeterminate )
327  , pkgGpgCheck ( indeterminate )
328  , solver_onlyRequires ( false )
329  , solver_allowVendorChange ( false )
330  , solver_dupAllowDowngrade ( true )
331  , solver_dupAllowNameChange ( true )
332  , solver_dupAllowArchChange ( true )
333  , solver_dupAllowVendorChange ( true )
334  , solver_cleandepsOnRemove ( false )
335  , solver_upgradeTestcasesToKeep ( 2 )
336  , solverUpgradeRemoveDroppedPackages( true )
337  , apply_locks_file ( true )
338  , pluginsPath ( "/usr/lib/zypp/plugins" )
339  {
340  MIL << "libzypp: " << VERSION << endl;
341  // override_r has higest prio
342  // ZYPP_CONF might override /etc/zypp/zypp.conf
343  if ( _parsedZyppConf.empty() )
344  {
345  _parsedZyppConf = _autodetectZyppConfPath();
346  }
347  else
348  {
349  // Inject this into ZConfig. Be shure this is
350  // allocated via new. See: reconfigureZConfig
351  INT << "Reconfigure to " << _parsedZyppConf << endl;
352  ZConfig::instance()._pimpl.reset( this );
353  }
354  if ( PathInfo(_parsedZyppConf).isExist() )
355  {
356  parser::IniDict dict( _parsedZyppConf );
358  sit != dict.sectionsEnd();
359  ++sit )
360  {
361  string section(*sit);
362  //MIL << section << endl;
363  for ( IniDict::entry_const_iterator it = dict.entriesBegin(*sit);
364  it != dict.entriesEnd(*sit);
365  ++it )
366  {
367  string entry(it->first);
368  string value(it->second);
369  //DBG << (*it).first << "=" << (*it).second << endl;
370  if ( section == "main" )
371  {
372  if ( entry == "arch" )
373  {
374  Arch carch( value );
375  if ( carch != cfg_arch )
376  {
377  WAR << "Overriding system architecture (" << cfg_arch << "): " << carch << endl;
378  cfg_arch = carch;
379  }
380  }
381  else if ( entry == "cachedir" )
382  {
383  cfg_cache_path = Pathname(value);
384  }
385  else if ( entry == "metadatadir" )
386  {
387  cfg_metadata_path = Pathname(value);
388  }
389  else if ( entry == "solvfilesdir" )
390  {
391  cfg_solvfiles_path = Pathname(value);
392  }
393  else if ( entry == "packagesdir" )
394  {
395  cfg_packages_path = Pathname(value);
396  }
397  else if ( entry == "configdir" )
398  {
399  cfg_config_path = Pathname(value);
400  }
401  else if ( entry == "reposdir" )
402  {
403  cfg_known_repos_path = Pathname(value);
404  }
405  else if ( entry == "servicesdir" )
406  {
407  cfg_known_services_path = Pathname(value);
408  }
409  else if ( entry == "repo.add.probe" )
410  {
411  repo_add_probe = str::strToBool( value, repo_add_probe );
412  }
413  else if ( entry == "repo.refresh.delay" )
414  {
415  str::strtonum(value, repo_refresh_delay);
416  }
417  else if ( entry == "repo.refresh.locales" )
418  {
419  std::vector<std::string> tmp;
420  str::split( value, back_inserter( tmp ), ", \t" );
421 
422  boost::function<Locale(const std::string &)> transform(
423  [](const std::string & str_r)->Locale{ return Locale(str_r); }
424  );
425  repoRefreshLocales.insert( make_transform_iterator( tmp.begin(), transform ),
426  make_transform_iterator( tmp.end(), transform ) );
427  }
428  else if ( entry == "download.use_deltarpm" )
429  {
430  download_use_deltarpm = str::strToBool( value, download_use_deltarpm );
431  }
432  else if ( entry == "download.use_deltarpm.always" )
433  {
434  download_use_deltarpm_always = str::strToBool( value, download_use_deltarpm_always );
435  }
436  else if ( entry == "download.media_preference" )
437  {
438  download_media_prefer_download.restoreToDefault( str::compareCI( value, "volatile" ) != 0 );
439  }
440  else if ( entry == "download.max_concurrent_connections" )
441  {
442  str::strtonum(value, download_max_concurrent_connections);
443  }
444  else if ( entry == "download.min_download_speed" )
445  {
446  str::strtonum(value, download_min_download_speed);
447  }
448  else if ( entry == "download.max_download_speed" )
449  {
450  str::strtonum(value, download_max_download_speed);
451  }
452  else if ( entry == "download.max_silent_tries" )
453  {
454  str::strtonum(value, download_max_silent_tries);
455  }
456  else if ( entry == "download.transfer_timeout" )
457  {
458  str::strtonum(value, download_transfer_timeout);
459  if ( download_transfer_timeout < 0 ) download_transfer_timeout = 0;
460  else if ( download_transfer_timeout > 3600 ) download_transfer_timeout = 3600;
461  }
462  else if ( entry == "commit.downloadMode" )
463  {
464  commit_downloadMode.set( deserializeDownloadMode( value ) );
465  }
466  else if ( entry == "gpgcheck" )
467  {
468  gpgCheck.restoreToDefault( str::strToBool( value, gpgCheck ) );
469  }
470  else if ( entry == "repo_gpgcheck" )
471  {
472  repoGpgCheck.restoreToDefault( str::strToTriBool( value ) );
473  }
474  else if ( entry == "pkg_gpgcheck" )
475  {
476  pkgGpgCheck.restoreToDefault( str::strToTriBool( value ) );
477  }
478  else if ( entry == "vendordir" )
479  {
480  cfg_vendor_path = Pathname(value);
481  }
482  else if ( entry == "multiversiondir" )
483  {
484  cfg_multiversion_path = Pathname(value);
485  }
486  else if ( entry == "solver.onlyRequires" )
487  {
488  solver_onlyRequires.set( str::strToBool( value, solver_onlyRequires ) );
489  }
490  else if ( entry == "solver.allowVendorChange" )
491  {
492  solver_allowVendorChange.set( str::strToBool( value, solver_allowVendorChange ) );
493  }
494  else if ( entry == "solver.dupAllowDowngrade" )
495  {
496  solver_dupAllowDowngrade.set( str::strToBool( value, solver_dupAllowDowngrade ) );
497  }
498  else if ( entry == "solver.dupAllowNameChange" )
499  {
500  solver_dupAllowNameChange.set( str::strToBool( value, solver_dupAllowNameChange ) );
501  }
502  else if ( entry == "solver.dupAllowArchChange" )
503  {
504  solver_dupAllowArchChange.set( str::strToBool( value, solver_dupAllowArchChange ) );
505  }
506  else if ( entry == "solver.dupAllowVendorChange" )
507  {
508  solver_dupAllowVendorChange.set( str::strToBool( value, solver_dupAllowVendorChange ) );
509  }
510  else if ( entry == "solver.cleandepsOnRemove" )
511  {
512  solver_cleandepsOnRemove.set( str::strToBool( value, solver_cleandepsOnRemove ) );
513  }
514  else if ( entry == "solver.upgradeTestcasesToKeep" )
515  {
516  solver_upgradeTestcasesToKeep.set( str::strtonum<unsigned>( value ) );
517  }
518  else if ( entry == "solver.upgradeRemoveDroppedPackages" )
519  {
520  solverUpgradeRemoveDroppedPackages.restoreToDefault( str::strToBool( value, solverUpgradeRemoveDroppedPackages.getDefault() ) );
521  }
522  else if ( entry == "solver.checkSystemFile" )
523  {
524  solver_checkSystemFile = Pathname(value);
525  }
526  else if ( entry == "solver.checkSystemFileDir" )
527  {
528  solver_checkSystemFileDir = Pathname(value);
529  }
530  else if ( entry == "multiversion" )
531  {
532  MultiversionSpec & defSpec( _multiversionMap.getDefaultSpec() );
533  str::splitEscaped( value, std::inserter( defSpec, defSpec.end() ), ", \t" );
534  }
535  else if ( entry == "locksfile.path" )
536  {
537  locks_file = Pathname(value);
538  }
539  else if ( entry == "locksfile.apply" )
540  {
541  apply_locks_file = str::strToBool( value, apply_locks_file );
542  }
543  else if ( entry == "update.datadir" )
544  {
545  update_data_path = Pathname(value);
546  }
547  else if ( entry == "update.scriptsdir" )
548  {
549  update_scripts_path = Pathname(value);
550  }
551  else if ( entry == "update.messagessdir" )
552  {
553  update_messages_path = Pathname(value);
554  }
555  else if ( entry == "update.messages.notify" )
556  {
557  updateMessagesNotify.set( value );
558  }
559  else if ( entry == "rpm.install.excludedocs" )
560  {
561  rpmInstallFlags.setFlag( target::rpm::RPMINST_EXCLUDEDOCS,
562  str::strToBool( value, false ) );
563  }
564  else if ( entry == "history.logfile" )
565  {
566  history_log_path = Pathname(value);
567  }
568  else if ( entry == "credentials.global.dir" )
569  {
570  credentials_global_dir_path = Pathname(value);
571  }
572  else if ( entry == "credentials.global.file" )
573  {
574  credentials_global_file_path = Pathname(value);
575  }
576  }
577  }
578  }
579  //
580 
581  }
582  else
583  {
584  MIL << _parsedZyppConf << " not found, using defaults instead." << endl;
585  _parsedZyppConf = _parsedZyppConf.extend( " (NOT FOUND)" );
586  }
587 
588  // legacy:
589  if ( getenv( "ZYPP_TESTSUITE_FAKE_ARCH" ) )
590  {
591  Arch carch( getenv( "ZYPP_TESTSUITE_FAKE_ARCH" ) );
592  if ( carch != cfg_arch )
593  {
594  WAR << "ZYPP_TESTSUITE_FAKE_ARCH: Overriding system architecture (" << cfg_arch << "): " << carch << endl;
595  cfg_arch = carch;
596  }
597  }
598  MIL << "ZConfig singleton created." << endl;
599  }
600 
602  {}
603 
604  public:
606  Pathname _parsedZyppConf;
607 
610 
611  Pathname cfg_cache_path;
615 
616  Pathname cfg_config_path;
619 
620  Pathname cfg_vendor_path;
622  Pathname locks_file;
623 
628 
633 
637 
643 
645 
649 
659 
662 
663  MultiversionSpec & multiversion() { return getMultiversion(); }
664  const MultiversionSpec & multiversion() const { return getMultiversion(); }
665 
667 
668  target::rpm::RpmInstFlags rpmInstallFlags;
669 
673 
674  std::string userData;
675 
677 
678  private:
679  // HACK for bnc#906096: let pool re-evaluate multiversion spec
680  // if target root changes. ZConfig returns data sensitive to
681  // current target root.
682  // TODO Actually we'd need to scan the target systems zypp.conf and
683  // overlay all system specific values.
685  {
686  typedef std::map<Pathname,MultiversionSpec> SpecMap;
687 
688  MultiversionSpec & getSpec( Pathname root_r, const Impl & zConfImpl_r ) // from system at root
689  {
690  // _specMap[] - the plain zypp.conf value
691  // _specMap[/] - combine [] and multiversion.d scan
692  // _specMap[root] - scan root/zypp.conf and root/multiversion.d
693 
694  if ( root_r.empty() )
695  root_r = "/";
696  bool cacheHit = _specMap.count( root_r );
697  MultiversionSpec & ret( _specMap[root_r] ); // creates new entry on the fly
698 
699  if ( ! cacheHit )
700  {
701  if ( root_r == "/" )
702  ret.swap( _specMap[Pathname()] ); // original zypp.conf
703  else
704  scanConfAt( root_r, ret, zConfImpl_r ); // scan zypp.conf at root_r
705  scanDirAt( root_r, ret, zConfImpl_r ); // add multiversion.d at root_r
706  using zypp::operator<<;
707  MIL << "MultiversionSpec '" << root_r << "' = " << ret << endl;
708  }
709  return ret;
710  }
711 
712  MultiversionSpec & getDefaultSpec() // Spec from zypp.conf parsing; called before any getSpec
713  { return _specMap[Pathname()]; }
714 
715  private:
716  void scanConfAt( const Pathname root_r, MultiversionSpec & spec_r, const Impl & zConfImpl_r )
717  {
718  static const str::regex rx( "^multiversion *= *(.*)" );
719  str::smatch what;
720  iostr::simpleParseFile( InputStream( Pathname::assertprefix( root_r, _autodetectZyppConfPath() ) ),
721  [&]( int num_r, std::string line_r )->bool
722  {
723  if ( line_r[0] == 'm' && str::regex_match( line_r, what, rx ) )
724  {
725  str::splitEscaped( what[1], std::inserter( spec_r, spec_r.end() ), ", \t" );
726  return false; // stop after match
727  }
728  return true;
729  } );
730  }
731 
732  void scanDirAt( const Pathname root_r, MultiversionSpec & spec_r, const Impl & zConfImpl_r )
733  {
734  // NOTE: Actually we'd need to scan and use the root_r! zypp.conf values.
735  Pathname multiversionDir( zConfImpl_r.cfg_multiversion_path );
736  if ( multiversionDir.empty() )
737  multiversionDir = ( zConfImpl_r.cfg_config_path.empty()
738  ? Pathname("/etc/zypp")
739  : zConfImpl_r.cfg_config_path ) / "multiversion.d";
740 
741  filesystem::dirForEach( Pathname::assertprefix( root_r, multiversionDir ),
742  [&spec_r]( const Pathname & dir_r, const char *const & name_r )->bool
743  {
744  MIL << "Parsing " << dir_r/name_r << endl;
745  iostr::simpleParseFile( InputStream( dir_r/name_r ),
746  [&spec_r]( int num_r, std::string line_r )->bool
747  {
748  DBG << " found " << line_r << endl;
749  spec_r.insert( std::move(line_r) );
750  return true;
751  } );
752  return true;
753  } );
754  }
755 
756  private:
758  };
759 
761  { return _multiversionMap.getSpec( _autodetectSystemRoot(), *this ); }
762 
764  };
766 
767  // Backdoor to redirect ZConfig from within the running
768  // TEST-application. HANDLE WITH CARE!
769  void reconfigureZConfig( const Pathname & override_r )
770  {
771  // ctor puts itself unter smart pointer control.
772  new ZConfig::Impl( override_r );
773  }
774 
776  //
777  // METHOD NAME : ZConfig::instance
778  // METHOD TYPE : ZConfig &
779  //
780  ZConfig & ZConfig::instance()
781  {
782  static ZConfig _instance; // The singleton
783  return _instance;
784  }
785 
787  //
788  // METHOD NAME : ZConfig::ZConfig
789  // METHOD TYPE : Ctor
790  //
791  ZConfig::ZConfig()
792  : _pimpl( new Impl )
793  {
794  about( MIL );
795  }
796 
798  //
799  // METHOD NAME : ZConfig::~ZConfig
800  // METHOD TYPE : Dtor
801  //
803  {}
804 
805  Pathname ZConfig::systemRoot() const
806  { return _autodetectSystemRoot(); }
807 
809  //
810  // system architecture
811  //
813 
815  {
816  static Arch _val( _autodetectSystemArchitecture() );
817  return _val;
818  }
819 
821  { return _pimpl->cfg_arch; }
822 
823  void ZConfig::setSystemArchitecture( const Arch & arch_r )
824  {
825  if ( arch_r != _pimpl->cfg_arch )
826  {
827  WAR << "Overriding system architecture (" << _pimpl->cfg_arch << "): " << arch_r << endl;
828  _pimpl->cfg_arch = arch_r;
829  }
830  }
831 
833  //
834  // text locale
835  //
837 
839  {
840  static Locale _val( _autodetectTextLocale() );
841  return _val;
842  }
843 
845  { return _pimpl->cfg_textLocale; }
846 
847  void ZConfig::setTextLocale( const Locale & locale_r )
848  {
849  if ( locale_r != _pimpl->cfg_textLocale )
850  {
851  WAR << "Overriding text locale (" << _pimpl->cfg_textLocale << "): " << locale_r << endl;
852  _pimpl->cfg_textLocale = locale_r;
853 #warning prefer signal
854  sat::Pool::instance().setTextLocale( locale_r );
855  }
856  }
857 
859  // user data
861 
862  bool ZConfig::hasUserData() const
863  { return !_pimpl->userData.empty(); }
864 
865  std::string ZConfig::userData() const
866  { return _pimpl->userData; }
867 
868  bool ZConfig::setUserData( const std::string & str_r )
869  {
870  for_( ch, str_r.begin(), str_r.end() )
871  {
872  if ( *ch < ' ' && *ch != '\t' )
873  {
874  ERR << "New user data string rejectded: char " << (int)*ch << " at position " << (ch - str_r.begin()) << endl;
875  return false;
876  }
877  }
878  MIL << "Set user data string to '" << str_r << "'" << endl;
879  _pimpl->userData = str_r;
880  return true;
881  }
882 
884 
885  Pathname ZConfig::repoCachePath() const
886  {
887  return ( _pimpl->cfg_cache_path.empty()
888  ? Pathname("/var/cache/zypp") : _pimpl->cfg_cache_path );
889  }
890 
891  Pathname ZConfig::repoMetadataPath() const
892  {
893  return ( _pimpl->cfg_metadata_path.empty()
894  ? (repoCachePath()/"raw") : _pimpl->cfg_metadata_path );
895  }
896 
897  Pathname ZConfig::repoSolvfilesPath() const
898  {
899  return ( _pimpl->cfg_solvfiles_path.empty()
900  ? (repoCachePath()/"solv") : _pimpl->cfg_solvfiles_path );
901  }
902 
903  Pathname ZConfig::repoPackagesPath() const
904  {
905  return ( _pimpl->cfg_packages_path.empty()
906  ? (repoCachePath()/"packages") : _pimpl->cfg_packages_path );
907  }
908 
910 
911  Pathname ZConfig::configPath() const
912  {
913  return ( _pimpl->cfg_config_path.empty()
914  ? Pathname("/etc/zypp") : _pimpl->cfg_config_path );
915  }
916 
917  Pathname ZConfig::knownReposPath() const
918  {
919  return ( _pimpl->cfg_known_repos_path.empty()
920  ? (configPath()/"repos.d") : _pimpl->cfg_known_repos_path );
921  }
922 
923  Pathname ZConfig::knownServicesPath() const
924  {
925  return ( _pimpl->cfg_known_services_path.empty()
926  ? (configPath()/"services.d") : _pimpl->cfg_known_services_path );
927  }
928 
929  Pathname ZConfig::vendorPath() const
930  {
931  return ( _pimpl->cfg_vendor_path.empty()
932  ? (configPath()/"vendors.d") : _pimpl->cfg_vendor_path );
933  }
934 
935  Pathname ZConfig::locksFile() const
936  {
937  return ( _pimpl->locks_file.empty()
938  ? (configPath()/"locks") : _pimpl->locks_file );
939  }
940 
942 
944  { return _pimpl->repo_add_probe; }
945 
947  { return _pimpl->repo_refresh_delay; }
948 
950  { return _pimpl->repoRefreshLocales.empty() ? Target::requestedLocales("") :_pimpl->repoRefreshLocales; }
951 
953  { return _pimpl->repoLabelIsAlias; }
954 
955  void ZConfig::repoLabelIsAlias( bool yesno_r )
956  { _pimpl->repoLabelIsAlias = yesno_r; }
957 
959  { return _pimpl->download_use_deltarpm; }
960 
962  { return download_use_deltarpm() && _pimpl->download_use_deltarpm_always; }
963 
965  { return _pimpl->download_media_prefer_download; }
966 
968  { _pimpl->download_media_prefer_download.set( yesno_r ); }
969 
971  { _pimpl->download_media_prefer_download.restoreToDefault(); }
972 
974  { return _pimpl->download_max_concurrent_connections; }
975 
977  { return _pimpl->download_min_download_speed; }
978 
980  { return _pimpl->download_max_download_speed; }
981 
983  { return _pimpl->download_max_silent_tries; }
984 
986  { return _pimpl->download_transfer_timeout; }
987 
989  { return _pimpl->commit_downloadMode; }
990 
991 
992  bool ZConfig::gpgCheck() const { return _pimpl->gpgCheck; }
993  TriBool ZConfig::repoGpgCheck() const { return _pimpl->repoGpgCheck; }
994  TriBool ZConfig::pkgGpgCheck() const { return _pimpl->pkgGpgCheck; }
995 
996  void ZConfig::setGpgCheck( bool val_r ) { _pimpl->gpgCheck.set( val_r ); }
997  void ZConfig::setRepoGpgCheck( TriBool val_r ) { _pimpl->repoGpgCheck.set( val_r ); }
998  void ZConfig::setPkgGpgCheck( TriBool val_r ) { _pimpl->pkgGpgCheck.set( val_r ); }
999 
1000  void ZConfig::resetGpgCheck() { _pimpl->gpgCheck.restoreToDefault(); }
1001  void ZConfig::resetRepoGpgCheck() { _pimpl->repoGpgCheck.restoreToDefault(); }
1002  void ZConfig::resetPkgGpgCheck() { _pimpl->pkgGpgCheck.restoreToDefault(); }
1003 
1004 
1006  { return _pimpl->solver_onlyRequires; }
1007 
1009  { return _pimpl->solver_allowVendorChange; }
1010 
1011  bool ZConfig::solver_dupAllowDowngrade() const { return _pimpl->solver_dupAllowDowngrade; }
1012  bool ZConfig::solver_dupAllowNameChange() const { return _pimpl->solver_dupAllowNameChange; }
1013  bool ZConfig::solver_dupAllowArchChange() const { return _pimpl->solver_dupAllowArchChange; }
1014  bool ZConfig::solver_dupAllowVendorChange() const { return _pimpl->solver_dupAllowVendorChange; }
1015 
1017  { return _pimpl->solver_cleandepsOnRemove; }
1018 
1020  { return ( _pimpl->solver_checkSystemFile.empty()
1021  ? (configPath()/"systemCheck") : _pimpl->solver_checkSystemFile ); }
1022 
1024  { return ( _pimpl->solver_checkSystemFileDir.empty()
1025  ? (configPath()/"systemCheck.d") : _pimpl->solver_checkSystemFileDir ); }
1026 
1028  { return _pimpl->solver_upgradeTestcasesToKeep; }
1029 
1030  bool ZConfig::solverUpgradeRemoveDroppedPackages() const { return _pimpl->solverUpgradeRemoveDroppedPackages; }
1031  void ZConfig::setSolverUpgradeRemoveDroppedPackages( bool val_r ) { _pimpl->solverUpgradeRemoveDroppedPackages.set( val_r ); }
1032  void ZConfig::resetSolverUpgradeRemoveDroppedPackages() { _pimpl->solverUpgradeRemoveDroppedPackages.restoreToDefault(); }
1033 
1034  namespace
1035  {
1036  inline void sigMultiversionSpecChanged()
1037  {
1039  }
1040  }
1041 
1042  const std::set<std::string> & ZConfig::multiversionSpec() const { return _pimpl->multiversion(); }
1043  void ZConfig::multiversionSpec( std::set<std::string> new_r ) { _pimpl->multiversion().swap( new_r ); sigMultiversionSpecChanged(); }
1044  void ZConfig::clearMultiversionSpec() { _pimpl->multiversion().clear(); sigMultiversionSpecChanged(); }
1045  void ZConfig::addMultiversionSpec( const std::string & name_r ) { _pimpl->multiversion().insert( name_r ); sigMultiversionSpecChanged(); }
1046  void ZConfig::removeMultiversionSpec( const std::string & name_r ) { _pimpl->multiversion().erase( name_r ); sigMultiversionSpecChanged(); }
1047 
1049  { return _pimpl->apply_locks_file; }
1050 
1051  Pathname ZConfig::update_dataPath() const
1052  {
1053  return ( _pimpl->update_data_path.empty()
1054  ? Pathname("/var/adm") : _pimpl->update_data_path );
1055  }
1056 
1058  {
1059  return ( _pimpl->update_messages_path.empty()
1060  ? Pathname(update_dataPath()/"update-messages") : _pimpl->update_messages_path );
1061  }
1062 
1064  {
1065  return ( _pimpl->update_scripts_path.empty()
1066  ? Pathname(update_dataPath()/"update-scripts") : _pimpl->update_scripts_path );
1067  }
1068 
1069  std::string ZConfig::updateMessagesNotify() const
1070  { return _pimpl->updateMessagesNotify; }
1071 
1072  void ZConfig::setUpdateMessagesNotify( const std::string & val_r )
1073  { _pimpl->updateMessagesNotify.set( val_r ); }
1074 
1076  { _pimpl->updateMessagesNotify.restoreToDefault(); }
1077 
1079 
1080  target::rpm::RpmInstFlags ZConfig::rpmInstallFlags() const
1081  { return _pimpl->rpmInstallFlags; }
1082 
1083 
1084  Pathname ZConfig::historyLogFile() const
1085  {
1086  return ( _pimpl->history_log_path.empty() ?
1087  Pathname("/var/log/zypp/history") : _pimpl->history_log_path );
1088  }
1089 
1091  {
1092  return ( _pimpl->credentials_global_dir_path.empty() ?
1093  Pathname("/etc/zypp/credentials.d") : _pimpl->credentials_global_dir_path );
1094  }
1095 
1097  {
1098  return ( _pimpl->credentials_global_file_path.empty() ?
1099  Pathname("/etc/zypp/credentials.cat") : _pimpl->credentials_global_file_path );
1100  }
1101 
1103 
1104  std::string ZConfig::distroverpkg() const
1105  { return "redhat-release"; }
1106 
1108 
1109  Pathname ZConfig::pluginsPath() const
1110  { return _pimpl->pluginsPath.get(); }
1111 
1113 
1114  std::ostream & ZConfig::about( std::ostream & str ) const
1115  {
1116  str << "libzypp: " << VERSION << endl;
1117 
1118  str << "libsolv: " << solv_version;
1119  if ( ::strcmp( solv_version, LIBSOLV_VERSION_STRING ) )
1120  str << " (built against " << LIBSOLV_VERSION_STRING << ")";
1121  str << endl;
1122 
1123  str << "zypp.conf: '" << _pimpl->_parsedZyppConf << "'" << endl;
1124  str << "TextLocale: '" << textLocale() << "' (" << defaultTextLocale() << ")" << endl;
1125  str << "SystemArchitecture: '" << systemArchitecture() << "' (" << defaultSystemArchitecture() << ")" << endl;
1126  return str;
1127  }
1128 
1130 } // namespace zypp
bool solver_dupAllowNameChange() const
DUP tune: Whether to follow package renames upon DUP.
Definition: ZConfig.cc:1012
~ZConfig()
Dtor.
Definition: ZConfig.cc:802
TriBool strToTriBool(const C_Str &str)
Parse str into a bool if it's a legal true or false string; else indterminate.
Definition: String.cc:91
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:577
std::map< Pathname, MultiversionSpec > SpecMap
Definition: ZConfig.cc:686
static Locale defaultTextLocale()
The autodetected prefered locale for translated texts.
Definition: ZConfig.cc:838
Mutable option.
Definition: ZConfig.cc:234
#define MIL
Definition: Logger.h:64
Pathname update_scripts_path
Definition: ZConfig.cc:625
Pathname cfg_known_repos_path
Definition: ZConfig.cc:617
int download_transfer_timeout
Definition: ZConfig.cc:642
void setGpgCheck(bool val_r)
Change the value.
Definition: ZConfig.cc:996
MapKVIteratorTraits< SectionSet >::Key_const_iterator section_const_iterator
Definition: IniDict.h:46
Option< unsigned > solver_upgradeTestcasesToKeep
Definition: ZConfig.cc:657
void setUpdateMessagesNotify(const std::string &val_r)
Set a new command definition (see update.messages.notify in zypp.conf).
Definition: ZConfig.cc:1072
Option< bool > solver_cleandepsOnRemove
Definition: ZConfig.cc:656
TriBool repoGpgCheck() const
Check repo matadata signatures (indeterminate - according to gpgcheck)
Definition: ZConfig.cc:993
Pathname solver_checkSystemFileDir() const
Directory, which may or may not contain files in which dependencies described which has to be fulfill...
Definition: ZConfig.cc:1023
void setRepoGpgCheck(TriBool val_r)
Change the value.
Definition: ZConfig.cc:997
Pathname cfg_known_services_path
Definition: ZConfig.cc:618
int download_max_concurrent_connections
Definition: ZConfig.cc:638
Regular expression.
Definition: Regex.h:86
std::ostream & about(std::ostream &str) const
Print some detail about the current libzypp version.
Definition: ZConfig.cc:1114
Pathname update_messages_path
Definition: ZConfig.cc:626
MultiversionSpec & multiversion()
Definition: ZConfig.cc:663
std::string distroverpkg() const
Package telling the "product version" on systems not using /etc/product.d/baseproduct.
Definition: ZConfig.cc:1104
void scanDirAt(const Pathname root_r, MultiversionSpec &spec_r, const Impl &zConfImpl_r)
Definition: ZConfig.cc:732
unsigned solver_upgradeTestcasesToKeep() const
When committing a dist upgrade (e.g.
Definition: ZConfig.cc:1027
void setTextLocale(const Locale &locale_r)
Set the default language for retrieving translated texts.
Definition: Pool.cc:212
void setDefault(const value_type &newval_r)
Set a new default value.
Definition: ZConfig.cc:287
Architecture.
Definition: Arch.h:36
bool download_use_deltarpm
Definition: ZConfig.cc:634
Pathname knownServicesPath() const
Path where the known services .service files are kept (configPath()/services.d).
Definition: ZConfig.cc:923
Pathname vendorPath() const
Directory for equivalent vendor definitions (configPath()/vendors.d)
Definition: ZConfig.cc:929
Pathname repoCachePath() const
Path where the caches are kept (/var/cache/zypp)
Definition: ZConfig.cc:885
LocaleSet repoRefreshLocales
Definition: ZConfig.cc:631
Option< bool > solver_dupAllowVendorChange
Definition: ZConfig.cc:655
#define INT
Definition: Logger.h:68
Pathname credentialsGlobalFile() const
Defaults to /etc/zypp/credentials.cat.
Definition: ZConfig.cc:1096
Pathname cfg_metadata_path
Definition: ZConfig.cc:612
void restoreToDefault()
Reset value to the current default.
Definition: ZConfig.cc:275
void removeMultiversionSpec(const std::string &name_r)
Definition: ZConfig.cc:1046
Pathname cfg_cache_path
Definition: ZConfig.cc:611
void setSystemArchitecture(const Arch &arch_r)
Override the zypp system architecture.
Definition: ZConfig.cc:823
bool apply_locks_file() const
Whether locks file should be read and applied after start (true)
Definition: ZConfig.cc:1048
Pathname cfg_config_path
Definition: ZConfig.cc:616
target::rpm::RpmInstFlags rpmInstallFlags
Definition: ZConfig.cc:668
Helper to create and pass std::istream.
Definition: InputStream.h:56
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition: Easy.h:27
void reconfigureZConfig(const Pathname &override_r)
Definition: ZConfig.cc:769
long download_max_download_speed() const
Maximum download speed (bytes per second)
Definition: ZConfig.cc:979
bool setUserData(const std::string &str_r)
Set a new userData string.
Definition: ZConfig.cc:868
std::set< std::string > MultiversionSpec
Definition: ZConfig.cc:305
bool solver_cleandepsOnRemove() const
Whether removing a package should also remove no longer needed requirements.
Definition: ZConfig.cc:1016
bool repo_add_probe() const
Whether repository urls should be probed.
Definition: ZConfig.cc:943
MultiversionSpec & getDefaultSpec()
Definition: ZConfig.cc:712
Option(const value_type &initial_r)
No default ctor, explicit initialisation!
Definition: ZConfig.cc:239
const value_type & getDefault() const
Get the current default value.
Definition: ZConfig.cc:283
void resetSolverUpgradeRemoveDroppedPackages()
Reset solverUpgradeRemoveDroppedPackages to the zypp.conf default.
Definition: ZConfig.cc:1032
Pathname _parsedZyppConf
Remember any parsed zypp.conf.
Definition: ZConfig.cc:606
Pathname pluginsPath() const
Defaults to /usr/lib/zypp/plugins.
Definition: ZConfig.cc:1109
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
Pointer to implementation.
Definition: ZConfig.h:477
#define ERR
Definition: Logger.h:66
bool solverUpgradeRemoveDroppedPackages() const
Whether dist upgrade should remove a products dropped packages (true).
Definition: ZConfig.cc:1030
DownloadMode commit_downloadMode() const
Commit download policy to use as default.
Definition: ZConfig.cc:988
Option< bool > solver_allowVendorChange
Definition: ZConfig.cc:651
bool solver_dupAllowVendorChange() const
DUP tune: Whether to allow package vendor changes upon DUP.
Definition: ZConfig.cc:1014
void addMultiversionSpec(const std::string &name_r)
Definition: ZConfig.cc:1045
void resetGpgCheck()
Reset to the zconfig default.
Definition: ZConfig.cc:1000
Pathname credentials_global_dir_path
Definition: ZConfig.cc:671
void set_download_media_prefer_download(bool yesno_r)
Set download_media_prefer_download to a specific value.
Definition: ZConfig.cc:967
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition: String.h:30
DefaultOption< bool > download_media_prefer_download
Definition: ZConfig.cc:636
MultiversionMap _multiversionMap
Definition: ZConfig.cc:763
DefaultOption< bool > gpgCheck
Definition: ZConfig.cc:646
Pathname configPath() const
Path where the configfiles are kept (/etc/zypp).
Definition: ZConfig.cc:911
Pathname historyLogFile() const
Path where ZYpp install history is logged.
Definition: ZConfig.cc:1084
void setTextLocale(const Locale &locale_r)
Set the prefered locale for translated texts.
Definition: ZConfig.cc:847
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
Pathname knownReposPath() const
Path where the known repositories .repo files are kept (configPath()/repos.d).
Definition: ZConfig.cc:917
static Pool instance()
Singleton ctor.
Definition: Pool.h:53
Pathname update_data_path
Definition: ZConfig.cc:624
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t")
Split line_r into words.
Definition: String.h:518
Pathname credentials_global_file_path
Definition: ZConfig.cc:672
LocaleSet repoRefreshLocales() const
List of locales for which translated package descriptions should be downloaded.
Definition: ZConfig.cc:949
bool gpgCheck() const
Turn signature checking on/off (on)
Definition: ZConfig.cc:992
void set_default_download_media_prefer_download()
Set download_media_prefer_download to the configfiles default.
Definition: ZConfig.cc:970
ZConfig implementation.
Definition: ZConfig.cc:303
libzypp will decide what to do.
Definition: DownloadMode.h:24
TriBool pkgGpgCheck() const
Check rpm package signatures (indeterminate - according to gpgcheck)
Definition: ZConfig.cc:994
#define WAR
Definition: Logger.h:65
Pathname cfg_packages_path
Definition: ZConfig.cc:614
section_const_iterator sectionsBegin() const
Definition: IniDict.cc:94
Option< Tp > option_type
Definition: ZConfig.cc:268
void scanConfAt(const Pathname root_r, MultiversionSpec &spec_r, const Impl &zConfImpl_r)
Definition: ZConfig.cc:716
value_type & ref()
Non-const reference to set a new value.
Definition: ZConfig.cc:256
TInt strtonum(const C_Str &str)
Parsing numbers from string.
Definition: String.h:403
Pathname update_scriptsPath() const
Path where the repo metadata is downloaded and kept (update_dataPath()/).
Definition: ZConfig.cc:1063
Pathname locksFile() const
Path where zypp can find or create lock file (configPath()/locks)
Definition: ZConfig.cc:935
long download_min_download_speed() const
Minimum download speed (bytes per second) until the connection is dropped.
Definition: ZConfig.cc:976
void clearMultiversionSpec()
Definition: ZConfig.cc:1044
entry_const_iterator entriesEnd(const std::string &section) const
Definition: IniDict.cc:82
bool hasUserData() const
Whether a (non empty) user data sting is defined.
Definition: ZConfig.cc:862
int download_max_silent_tries
Definition: ZConfig.cc:641
Pathname update_messagesPath() const
Path where the repo solv files are created and kept (update_dataPath()/solv).
Definition: ZConfig.cc:1057
Pathname locks_file
Definition: ZConfig.cc:622
Pathname repoSolvfilesPath() const
Path where the repo solv files are created and kept (repoCachePath()/solv).
Definition: ZConfig.cc:897
static PoolImpl & myPool()
Definition: PoolImpl.cc:167
Pathname repoPackagesPath() const
Path where the repo packages are downloaded and kept (repoCachePath()/packages).
Definition: ZConfig.cc:903
bool download_use_deltarpm() const
Whether to consider using a deltarpm when downloading a package.
Definition: ZConfig.cc:958
Locale cfg_textLocale
Definition: ZConfig.cc:609
Mutable option with initial value also remembering a config value.
Definition: ZConfig.cc:265
Pathname repoMetadataPath() const
Path where the repo metadata is downloaded and kept (repoCachePath()/raw).
Definition: ZConfig.cc:891
long download_max_silent_tries() const
Maximum silent tries.
Definition: ZConfig.cc:982
bool download_use_deltarpm_always
Definition: ZConfig.cc:635
int compareCI(const C_Str &lhs, const C_Str &rhs)
Definition: String.h:966
bool solver_dupAllowArchChange() const
DUP tune: Whether to allow package arch changes upon DUP.
Definition: ZConfig.cc:1013
bool solver_allowVendorChange() const
Whether vendor check is by default enabled.
Definition: ZConfig.cc:1008
bool solver_onlyRequires() const
Solver regards required packages,patterns,...
Definition: ZConfig.cc:1005
'Language[_Country]' codes.
Definition: Locale.h:49
Option< Pathname > pluginsPath
Definition: ZConfig.cc:676
Impl(const Pathname &override_r=Pathname())
Definition: ZConfig.cc:308
Parses a INI file and offers its structure as a dictionary.
Definition: IniDict.h:40
MultiversionSpec & getMultiversion() const
Definition: ZConfig.cc:760
static Arch defaultSystemArchitecture()
The autodetected system architecture.
Definition: ZConfig.cc:814
Regular expression match result.
Definition: Regex.h:145
void resetRepoGpgCheck()
Reset to the zconfig default.
Definition: ZConfig.cc:1001
Pathname systemRoot() const
The target root directory.
Definition: ZConfig.cc:805
entry_const_iterator entriesBegin(const std::string &section) const
Definition: IniDict.cc:71
bool download_media_prefer_download() const
Hint which media to prefer when installing packages (download vs.
Definition: ZConfig.cc:964
DefaultOption< std::string > updateMessagesNotify
Definition: ZConfig.cc:627
Option< bool > solver_dupAllowNameChange
Definition: ZConfig.cc:653
const std::set< std::string > & multiversionSpec() const
Definition: ZConfig.cc:1042
Pathname solver_checkSystemFile
Definition: ZConfig.cc:660
void set(const value_type &newval_r)
Set a new value.
Definition: ZConfig.cc:252
target::rpm::RpmInstFlags rpmInstallFlags() const
The default target::rpm::RpmInstFlags for ZYppCommitPolicy.
Definition: ZConfig.cc:1080
Option< bool > solver_onlyRequires
Definition: ZConfig.cc:650
const MultiversionSpec & multiversion() const
Definition: ZConfig.cc:664
Pathname history_log_path
Definition: ZConfig.cc:670
std::string userData
Definition: ZConfig.cc:674
bool strToBool(const C_Str &str, bool default_r)
Parse str into a bool depending on the default value.
Definition: String.h:444
Pathname update_dataPath() const
Path where the update items are kept (/var/adm)
Definition: ZConfig.cc:1051
std::string userData() const
User defined string value to be passed to log, history, plugins...
Definition: ZConfig.cc:865
int download_max_download_speed
Definition: ZConfig.cc:640
Wrapper class for ::stat/::lstat.
Definition: PathInfo.h:220
void resetUpdateMessagesNotify()
Reset to the zypp.conf default.
Definition: ZConfig.cc:1075
int dirForEach(const Pathname &dir_r, function< bool(const Pathname &, const char *const)> fnc_r)
Invoke callback function fnc_r for each entry in directory dir_r.
Definition: PathInfo.cc:551
void setSolverUpgradeRemoveDroppedPackages(bool val_r)
Set solverUpgradeRemoveDroppedPackages to val_r.
Definition: ZConfig.cc:1031
bool regex_match(const std::string &s, smatch &matches, const regex &regex)
regex ZYPP_STR_REGEX regex ZYPP_STR_REGEX
Definition: Regex.h:70
int download_min_download_speed
Definition: ZConfig.cc:639
Locale textLocale() const
The locale for translated texts zypp uses.
Definition: ZConfig.cc:844
std::string updateMessagesNotify() const
Command definition for sending update messages.
Definition: ZConfig.cc:1069
EntrySet::const_iterator entry_const_iterator
Definition: IniDict.h:47
unsigned repo_refresh_delay() const
Amount of time in minutes that must pass before another refresh.
Definition: ZConfig.cc:946
value_type _val
Definition: ZConfig.cc:260
Arch systemArchitecture() const
The system architecture zypp uses.
Definition: ZConfig.cc:820
Pathname solver_checkSystemFileDir
Definition: ZConfig.cc:661
bool repoLabelIsAlias() const
Whether to use repository alias or name in user messages (progress, exceptions, ...).
Definition: ZConfig.cc:952
Pathname cfg_vendor_path
Definition: ZConfig.cc:620
Pathname cfg_multiversion_path
Definition: ZConfig.cc:621
void setPkgGpgCheck(TriBool val_r)
Change the value.
Definition: ZConfig.cc:998
LocaleSet requestedLocales() const
Languages to be supported by the system.
Definition: Target.cc:97
DefaultOption< bool > solverUpgradeRemoveDroppedPackages
Definition: ZConfig.cc:658
void restoreToDefault(const value_type &newval_r)
Reset value to a new default.
Definition: ZConfig.cc:279
section_const_iterator sectionsEnd() const
Definition: IniDict.cc:99
long download_max_concurrent_connections() const
Maximum number of concurrent connections for a single transfer.
Definition: ZConfig.cc:973
bool solver_dupAllowDowngrade() const
DUP tune: Whether to allow version downgrades upon DUP.
Definition: ZConfig.cc:1011
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
Definition: String.h:1036
std::unordered_set< Locale > LocaleSet
Definition: Locale.h:27
Option< bool > solver_dupAllowArchChange
Definition: ZConfig.cc:654
option_type _default
Definition: ZConfig.cc:291
MultiversionSpec & getSpec(Pathname root_r, const Impl &zConfImpl_r)
Definition: ZConfig.cc:688
Option< bool > solver_dupAllowDowngrade
Definition: ZConfig.cc:652
DefaultOption< TriBool > repoGpgCheck
Definition: ZConfig.cc:647
Pathname solver_checkSystemFile() const
File in which dependencies described which has to be fulfilled for a running system.
Definition: ZConfig.cc:1019
Option< DownloadMode > commit_downloadMode
Definition: ZConfig.cc:644
DefaultOption< TriBool > pkgGpgCheck
Definition: ZConfig.cc:648
unsigned repo_refresh_delay
Definition: ZConfig.cc:630
void resetPkgGpgCheck()
Reset to the zconfig default.
Definition: ZConfig.cc:1002
bool download_use_deltarpm_always() const
Whether to consider using a deltarpm even when rpm is local.
Definition: ZConfig.cc:961
#define DBG
Definition: Logger.h:63
long download_transfer_timeout() const
Maximum time in seconds that you allow a transfer operation to take.
Definition: ZConfig.cc:985
Pathname credentialsGlobalDir() const
Defaults to /etc/zypp/credentials.d.
Definition: ZConfig.cc:1090
DownloadMode
Supported commit download policies.
Definition: DownloadMode.h:22
Pathname cfg_solvfiles_path
Definition: ZConfig.cc:613
DefaultOption(const value_type &initial_r)
Definition: ZConfig.cc:270