libzypp  17.35.12
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:
79 
83  Pathname systemRoot() const;
84 
88  Pathname repoManagerRoot() const;
89 
93  void setRepoManagerRoot ( const Pathname &root );
94 
95  public:
96 
98  static Arch defaultSystemArchitecture();
99 
101  Arch systemArchitecture() const;
102 
109  void setSystemArchitecture( const Arch & arch_r );
110 
113  { setSystemArchitecture( defaultSystemArchitecture() ); }
114 
115  public:
118  static Locale defaultTextLocale();
119 
122  Locale textLocale() const;
123 
125  void setTextLocale( const Locale & locale_r );
126 
129  { setTextLocale( defaultTextLocale() ); }
130 
131  public:
137  bool hasUserData() const;
138 
140  std::string userData() const;
141 
146  bool setUserData( const std::string & str_r );
148 
149  public:
154  Pathname repoCachePath() const;
155 
159  void setRepoCachePath ( const Pathname &path_r );
160 
164  Pathname pubkeyCachePath() const;
165 
170  Pathname repoMetadataPath() const;
171 
172 
176  void setRepoMetadataPath ( const Pathname &path_r );
177 
182  Pathname repoSolvfilesPath() const;
183 
187  void setRepoSolvfilesPath ( const Pathname &path_r );
188 
193  Pathname repoPackagesPath() const;
194 
195 
199  void setRepoPackagesPath ( const Pathname &path_r );
200 
205  Pathname configPath() const;
206 
211  Pathname knownReposPath() const;
212 
217  Pathname knownServicesPath() const;
218 
223  Pathname needrebootFile() const;
224 
229  Pathname needrebootPath() const;
230 
234  void setGeoipEnabled( bool enable = true );
235 
239  bool geoipEnabled () const;
240 
244  Pathname geoipCachePath() const;
245 
251  const std::vector<std::string> geoipHostnames () const;
252 
258  Pathname varsPath() const;
259 
265  bool repo_add_probe() const;
266 
270  unsigned repo_refresh_delay() const;
271 
275  LocaleSet repoRefreshLocales() const;
276 
282  bool repoLabelIsAlias() const;
283 
291  void repoLabelIsAlias( bool yesno_r );
292 
296  long download_max_concurrent_connections() const;
297 
302  long download_min_download_speed() const;
303 
307  long download_max_download_speed() const;
308 
312  long download_max_silent_tries() const;
313 
317  long download_transfer_timeout() const;
318 
319 
323  bool download_use_deltarpm() const;
324 
329  bool download_use_deltarpm_always() const;
330 
335  bool download_media_prefer_download() const;
338  { return ! download_media_prefer_download(); }
342  void set_download_media_prefer_download( bool yesno_r );
346  void set_default_download_media_prefer_download();
347 
352  Pathname download_mediaMountdir() const;
354  void set_download_mediaMountdir( Pathname newval_r );
356  void set_default_download_mediaMountdir();
357 
361  DownloadMode commit_downloadMode() const;
362 
376  bool gpgCheck() const;
377  TriBool repoGpgCheck() const;
378  TriBool pkgGpgCheck() const;
379 
380  void setGpgCheck( bool val_r );
381  void setRepoGpgCheck( TriBool val_r );
382  void setPkgGpgCheck( TriBool val_r );
383 
384  void resetGpgCheck();
385  void resetRepoGpgCheck();
386  void resetPkgGpgCheck();
387 
388  //
393  Pathname vendorPath() const;
394 
398  ResolverFocus solver_focus() const;
399 
403  bool solver_onlyRequires() const;
404 
409  Pathname solver_checkSystemFile() const;
410 
416  Pathname solver_checkSystemFileDir() const;
417 
421  bool solver_allowVendorChange() const;
422 
424  bool solver_dupAllowDowngrade() const;
425 
427  bool solver_dupAllowNameChange() const;
428 
430  bool solver_dupAllowArchChange() const;
431 
433  bool solver_dupAllowVendorChange() const;
434 
438  bool solver_cleandepsOnRemove() const;
439 
447  unsigned solver_upgradeTestcasesToKeep() const;
448 
462  bool solverUpgradeRemoveDroppedPackages() const;
464  void setSolverUpgradeRemoveDroppedPackages( bool val_r );
466  void resetSolverUpgradeRemoveDroppedPackages();
467 
478  const std::set<std::string> & multiversionSpec() const;
479  void multiversionSpec( std::set<std::string> new_r );
480  void clearMultiversionSpec();
481  void addMultiversionSpec( const std::string & name_r );
482  void removeMultiversionSpec( const std::string & name_r );
484 
489  Pathname locksFile() const;
490 
494  bool apply_locks_file() const;
495 
496 #if LEGACY(1735)
497 
500  Pathname update_dataPath() const;
501 
505  Pathname update_scriptsPath() const;
506 
510  Pathname update_messagesPath() const;
511 #else
512 
515  static Pathname update_dataPath();
516 
520  static Pathname update_scriptsPath();
521 
525  static Pathname update_messagesPath();
526 #endif
527 
531  std::string updateMessagesNotify() const;
533  void setUpdateMessagesNotify( const std::string & val_r );
535  void resetUpdateMessagesNotify();
537 
546  target::rpm::RpmInstFlags rpmInstallFlags() const;
548 
555  Pathname historyLogFile() const;
556 
560  Pathname credentialsGlobalDir() const;
561 
565  Pathname credentialsGlobalFile() const;
566 
575  std::string distroverpkg() const;
576 
582  Pathname pluginsPath() const;
583 
587  std::string multiversionKernels() const;
588 
590 
591  public:
592  class Impl;
593 
594  ZConfig(const ZConfig &) = delete;
595  ZConfig(ZConfig &&) = delete;
596  ZConfig &operator=(const ZConfig &) = delete;
597  ZConfig &operator=(ZConfig &&) = delete;
598 
600  ~ZConfig();
601  void notifyTargetChanged();
602 
603  private:
604  friend class RepoManager;
605  template<typename T> friend class zyppng::RepoManager;
607  Pathname builtinRepoCachePath() const;
609  Pathname builtinRepoMetadataPath() const;
611  Pathname builtinRepoSolvfilesPath() const;
613  Pathname builtinRepoPackagesPath() const;
614 
615  private:
616  friend class Impl;
618  ZConfig();
621  };
623 
625 } // namespace zypp
627 #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:112
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:620
ZConfig implementation.
Definition: ZConfig.cc:405
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:337
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:128
The RepoManager class Provides knowledge and methods to maintain repo settings and metadata for a giv...
Definition: repomanager.h:246
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