libzypp  17.36.7
ZConfig.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_ZCONFIG_H
13 #define ZYPP_ZCONFIG_H
14 
15 #include <iosfwd>
16 #include <set>
17 #include <string>
18 
19 #include <zypp-core/Globals.h>
20 #include <zypp/base/NonCopyable.h>
21 #include <zypp/base/PtrTypes.h>
22 
23 #include <zypp/Arch.h>
24 #include <zypp/Locale.h>
25 #include <zypp/Pathname.h>
26 #include <zypp/IdString.h>
27 #include <zypp/TriBool.h>
28 #include <zypp/ResolverFocus.h>
29 #include <zypp/DownloadMode.h>
31 
32 namespace zyppng {
33  // just for the friend declaration
34  template<typename T> class RepoManager;
35 }
36 
38 namespace zypp
39 {
40 
41  class RepoManager;
42 
44  //
45  // CLASS NAME : ZConfig
46  //
69  {
70  public:
71 
73  static ZConfig & instance();
74 
76  std::ostream & about( std::ostream & str ) const;
77 
78  public:
80  long lockTimeout() const;
81 
82  public:
83 
87  Pathname systemRoot() const;
88 
92  Pathname repoManagerRoot() const;
93 
97  void setRepoManagerRoot ( const Pathname &root );
98 
104  void announceSystemRoot( const Pathname & root_r );
105 
106  public:
107 
109  static Arch defaultSystemArchitecture();
110 
112  Arch systemArchitecture() const;
113 
120  void setSystemArchitecture( const Arch & arch_r );
121 
124  { setSystemArchitecture( defaultSystemArchitecture() ); }
125 
126  public:
129  static Locale defaultTextLocale();
130 
133  Locale textLocale() const;
134 
136  void setTextLocale( const Locale & locale_r );
137 
140  { setTextLocale( defaultTextLocale() ); }
141 
142  public:
148  bool hasUserData() const;
149 
151  std::string userData() const;
152 
157  bool setUserData( const std::string & str_r );
159 
160  public:
165  Pathname repoCachePath() const;
166 
170  void setRepoCachePath ( const Pathname &path_r );
171 
175  Pathname pubkeyCachePath() const;
176 
181  Pathname repoMetadataPath() const;
182 
183 
187  void setRepoMetadataPath ( const Pathname &path_r );
188 
193  Pathname repoSolvfilesPath() const;
194 
198  void setRepoSolvfilesPath ( const Pathname &path_r );
199 
204  Pathname repoPackagesPath() const;
205 
206 
210  void setRepoPackagesPath ( const Pathname &path_r );
211 
216  Pathname configPath() const;
217 
222  Pathname knownReposPath() const;
223 
228  Pathname knownServicesPath() const;
229 
234  Pathname needrebootFile() const;
235 
240  Pathname needrebootPath() const;
241 
245  void setGeoipEnabled( bool enable = true );
246 
250  bool geoipEnabled () const;
251 
255  Pathname geoipCachePath() const;
256 
262  const std::vector<std::string> geoipHostnames () const;
263 
269  Pathname varsPath() const;
270 
276  bool repo_add_probe() const;
277 
281  unsigned repo_refresh_delay() const;
282 
286  LocaleSet repoRefreshLocales() const;
287 
293  bool repoLabelIsAlias() const;
294 
302  void repoLabelIsAlias( bool yesno_r );
303 
307  long download_max_concurrent_connections() const;
308 
313  long download_min_download_speed() const;
314 
318  long download_max_download_speed() const;
319 
323  long download_max_silent_tries() const;
324 
328  long download_transfer_timeout() const;
329 
330 
334  bool download_use_deltarpm() const;
335 
340  bool download_use_deltarpm_always() const;
341 
346  bool download_media_prefer_download() const;
349  { return ! download_media_prefer_download(); }
353  void set_download_media_prefer_download( bool yesno_r );
357  void set_default_download_media_prefer_download();
358 
363  Pathname download_mediaMountdir() const;
365  void set_download_mediaMountdir( Pathname newval_r );
367  void set_default_download_mediaMountdir();
368 
372  DownloadMode commit_downloadMode() const;
373 
387  bool gpgCheck() const;
388  TriBool repoGpgCheck() const;
389  TriBool pkgGpgCheck() const;
390 
391  void setGpgCheck( bool val_r );
392  void setRepoGpgCheck( TriBool val_r );
393  void setPkgGpgCheck( TriBool val_r );
394 
395  void resetGpgCheck();
396  void resetRepoGpgCheck();
397  void resetPkgGpgCheck();
398 
399  //
404  Pathname vendorPath() const;
405 
409  ResolverFocus solver_focus() const;
410 
414  bool solver_onlyRequires() const;
415 
420  Pathname solver_checkSystemFile() const;
421 
427  Pathname solver_checkSystemFileDir() const;
428 
432  bool solver_allowVendorChange() const;
433 
435  bool solver_dupAllowDowngrade() const;
436 
438  bool solver_dupAllowNameChange() const;
439 
441  bool solver_dupAllowArchChange() const;
442 
444  bool solver_dupAllowVendorChange() const;
445 
449  bool solver_cleandepsOnRemove() const;
450 
458  unsigned solver_upgradeTestcasesToKeep() const;
459 
473  bool solverUpgradeRemoveDroppedPackages() const;
475  void setSolverUpgradeRemoveDroppedPackages( bool val_r );
477  void resetSolverUpgradeRemoveDroppedPackages();
478 
489  const std::set<std::string> & multiversionSpec() const;
490  void multiversionSpec( std::set<std::string> new_r );
491  void clearMultiversionSpec();
492  void addMultiversionSpec( const std::string & name_r );
493  void removeMultiversionSpec( const std::string & name_r );
495 
500  Pathname locksFile() const;
501 
505  bool apply_locks_file() const;
506 
507 #if LEGACY(1735)
508 
511  Pathname update_dataPath() const;
512 
516  Pathname update_scriptsPath() const;
517 
521  Pathname update_messagesPath() const;
522 #else
523 
526  static Pathname update_dataPath();
527 
531  static Pathname update_scriptsPath();
532 
536  static Pathname update_messagesPath();
537 #endif
538 
542  std::string updateMessagesNotify() const;
544  void setUpdateMessagesNotify( const std::string & val_r );
546  void resetUpdateMessagesNotify();
548 
557  target::rpm::RpmInstFlags rpmInstallFlags() const;
559 
566  Pathname historyLogFile() const;
567 
571  Pathname credentialsGlobalDir() const;
572 
576  Pathname credentialsGlobalFile() const;
577 
586  std::string distroverpkg() const;
587 
593  Pathname pluginsPath() const;
594 
598  std::string multiversionKernels() const;
599 
601 
602  public:
603  class Impl;
604 
605  ZConfig(const ZConfig &) = delete;
606  ZConfig(ZConfig &&) = delete;
607  ZConfig &operator=(const ZConfig &) = delete;
608  ZConfig &operator=(ZConfig &&) = delete;
609 
611  ~ZConfig();
612  void notifyTargetChanged();
613 
614  private:
615  friend class RepoManager;
616  template<typename T> friend class zyppng::RepoManager;
618  Pathname builtinRepoCachePath() const;
620  Pathname builtinRepoMetadataPath() const;
622  Pathname builtinRepoSolvfilesPath() const;
624  Pathname builtinRepoPackagesPath() const;
625 
626  private:
627  friend class Impl;
629  ZConfig();
632  };
634 
636 } // namespace zypp
638 #endif // ZYPP_ZCONFIG_H
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition: String.h:30
void resetSystemArchitecture()
Reset the zypp system architecture to the default.
Definition: ZConfig.h:123
Architecture.
Definition: Arch.h:36
ResolverFocus
The resolver&#39;s general attitude.
Definition: ResolverFocus.h:23
std::unordered_set< Locale > LocaleSet
Definition: Locale.h:29
String related utilities and Regular expression matching.
Provides API related macros.
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
Pointer to implementation.
Definition: ZConfig.h:631
ZConfig implementation.
Definition: ZConfig.cc:399
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition: ResTraits.h:93
Interim helper class to collect global options and settings.
Definition: ZConfig.h:68
&#39;Language[_Country]&#39; codes.
Definition: Locale.h:50
bool download_media_prefer_volatile() const
Definition: ZConfig.h:348
Wrapper for const correct access via Smart pointer types.
Definition: PtrTypes.h:292
void resetTextLocale()
Reset the locale for translated texts to the default.
Definition: ZConfig.h:139
The RepoManager class Provides knowledge and methods to maintain repo settings and metadata for a giv...
Definition: repomanager.h:247
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
DownloadMode
Supported commit download policies.
Definition: DownloadMode.h:24