libzypp  17.36.3
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 
100  void announceSystemRoot( const Pathname & root_r );
101 
102  public:
103 
105  static Arch defaultSystemArchitecture();
106 
108  Arch systemArchitecture() const;
109 
116  void setSystemArchitecture( const Arch & arch_r );
117 
120  { setSystemArchitecture( defaultSystemArchitecture() ); }
121 
122  public:
125  static Locale defaultTextLocale();
126 
129  Locale textLocale() const;
130 
132  void setTextLocale( const Locale & locale_r );
133 
136  { setTextLocale( defaultTextLocale() ); }
137 
138  public:
144  bool hasUserData() const;
145 
147  std::string userData() const;
148 
153  bool setUserData( const std::string & str_r );
155 
156  public:
161  Pathname repoCachePath() const;
162 
166  void setRepoCachePath ( const Pathname &path_r );
167 
171  Pathname pubkeyCachePath() const;
172 
177  Pathname repoMetadataPath() const;
178 
179 
183  void setRepoMetadataPath ( const Pathname &path_r );
184 
189  Pathname repoSolvfilesPath() const;
190 
194  void setRepoSolvfilesPath ( const Pathname &path_r );
195 
200  Pathname repoPackagesPath() const;
201 
202 
206  void setRepoPackagesPath ( const Pathname &path_r );
207 
212  Pathname configPath() const;
213 
218  Pathname knownReposPath() const;
219 
224  Pathname knownServicesPath() const;
225 
230  Pathname needrebootFile() const;
231 
236  Pathname needrebootPath() const;
237 
241  void setGeoipEnabled( bool enable = true );
242 
246  bool geoipEnabled () const;
247 
251  Pathname geoipCachePath() const;
252 
258  const std::vector<std::string> geoipHostnames () const;
259 
265  Pathname varsPath() const;
266 
272  bool repo_add_probe() const;
273 
277  unsigned repo_refresh_delay() const;
278 
282  LocaleSet repoRefreshLocales() const;
283 
289  bool repoLabelIsAlias() const;
290 
298  void repoLabelIsAlias( bool yesno_r );
299 
303  long download_max_concurrent_connections() const;
304 
309  long download_min_download_speed() const;
310 
314  long download_max_download_speed() const;
315 
319  long download_max_silent_tries() const;
320 
324  long download_transfer_timeout() const;
325 
326 
330  bool download_use_deltarpm() const;
331 
336  bool download_use_deltarpm_always() const;
337 
342  bool download_media_prefer_download() const;
345  { return ! download_media_prefer_download(); }
349  void set_download_media_prefer_download( bool yesno_r );
353  void set_default_download_media_prefer_download();
354 
359  Pathname download_mediaMountdir() const;
361  void set_download_mediaMountdir( Pathname newval_r );
363  void set_default_download_mediaMountdir();
364 
368  DownloadMode commit_downloadMode() const;
369 
383  bool gpgCheck() const;
384  TriBool repoGpgCheck() const;
385  TriBool pkgGpgCheck() const;
386 
387  void setGpgCheck( bool val_r );
388  void setRepoGpgCheck( TriBool val_r );
389  void setPkgGpgCheck( TriBool val_r );
390 
391  void resetGpgCheck();
392  void resetRepoGpgCheck();
393  void resetPkgGpgCheck();
394 
395  //
400  Pathname vendorPath() const;
401 
405  ResolverFocus solver_focus() const;
406 
410  bool solver_onlyRequires() const;
411 
416  Pathname solver_checkSystemFile() const;
417 
423  Pathname solver_checkSystemFileDir() const;
424 
428  bool solver_allowVendorChange() const;
429 
431  bool solver_dupAllowDowngrade() const;
432 
434  bool solver_dupAllowNameChange() const;
435 
437  bool solver_dupAllowArchChange() const;
438 
440  bool solver_dupAllowVendorChange() const;
441 
445  bool solver_cleandepsOnRemove() const;
446 
454  unsigned solver_upgradeTestcasesToKeep() const;
455 
469  bool solverUpgradeRemoveDroppedPackages() const;
471  void setSolverUpgradeRemoveDroppedPackages( bool val_r );
473  void resetSolverUpgradeRemoveDroppedPackages();
474 
485  const std::set<std::string> & multiversionSpec() const;
486  void multiversionSpec( std::set<std::string> new_r );
487  void clearMultiversionSpec();
488  void addMultiversionSpec( const std::string & name_r );
489  void removeMultiversionSpec( const std::string & name_r );
491 
496  Pathname locksFile() const;
497 
501  bool apply_locks_file() const;
502 
503 #if LEGACY(1735)
504 
507  Pathname update_dataPath() const;
508 
512  Pathname update_scriptsPath() const;
513 
517  Pathname update_messagesPath() const;
518 #else
519 
522  static Pathname update_dataPath();
523 
527  static Pathname update_scriptsPath();
528 
532  static Pathname update_messagesPath();
533 #endif
534 
538  std::string updateMessagesNotify() const;
540  void setUpdateMessagesNotify( const std::string & val_r );
542  void resetUpdateMessagesNotify();
544 
553  target::rpm::RpmInstFlags rpmInstallFlags() const;
555 
562  Pathname historyLogFile() const;
563 
567  Pathname credentialsGlobalDir() const;
568 
572  Pathname credentialsGlobalFile() const;
573 
582  std::string distroverpkg() const;
583 
589  Pathname pluginsPath() const;
590 
594  std::string multiversionKernels() const;
595 
597 
598  public:
599  class Impl;
600 
601  ZConfig(const ZConfig &) = delete;
602  ZConfig(ZConfig &&) = delete;
603  ZConfig &operator=(const ZConfig &) = delete;
604  ZConfig &operator=(ZConfig &&) = delete;
605 
607  ~ZConfig();
608  void notifyTargetChanged();
609 
610  private:
611  friend class RepoManager;
612  template<typename T> friend class zyppng::RepoManager;
614  Pathname builtinRepoCachePath() const;
616  Pathname builtinRepoMetadataPath() const;
618  Pathname builtinRepoSolvfilesPath() const;
620  Pathname builtinRepoPackagesPath() const;
621 
622  private:
623  friend class Impl;
625  ZConfig();
628  };
630 
632 } // namespace zypp
634 #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:119
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:627
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:344
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:135
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