libzypp  17.38.17
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>
22 
23 #include <zypp/Arch.h>
24 #include <zypp/Locale.h>
25 #include <zypp-core/Pathname.h>
26 #include <zypp/IdString.h>
27 #include <zypp-core/TriBool.h>
28 #include <zypp/ResolverFocus.h>
29 #include <zypp/DownloadMode.h>
31 
32 namespace zyppng {
33  // just for the friend declaration
34  class RepoManager;
35 }
36 
38 namespace zypp
39 {
40 
41  class RepoManager;
42 
82  {
83  public:
84 
86  static ZConfig & instance();
87 
89  std::ostream & about( std::ostream & str ) const;
90 
91  public:
93  long lockTimeout() const;
94 
95  public:
96 
100  Pathname systemRoot() const;
101 
105  Pathname repoManagerRoot() const;
106 
110  void setRepoManagerRoot ( const Pathname &root );
111 
117  void announceSystemRoot( const Pathname & root_r );
118 
119  public:
120 
122  static Arch defaultSystemArchitecture();
123 
125  Arch systemArchitecture() const;
126 
133  void setSystemArchitecture( const Arch & arch_r );
134 
137  { setSystemArchitecture( defaultSystemArchitecture() ); }
138 
139  public:
142  static Locale defaultTextLocale();
143 
146  Locale textLocale() const;
147 
149  void setTextLocale( const Locale & locale_r );
150 
153  { setTextLocale( defaultTextLocale() ); }
154 
155  public:
161  bool hasUserData() const;
162 
164  std::string userData() const;
165 
170  bool setUserData( const std::string & str_r );
172 
173  public:
178  Pathname repoCachePath() const;
179 
183  void setRepoCachePath ( const Pathname &path_r );
184 
188  Pathname pubkeyCachePath() const;
189 
194  Pathname repoMetadataPath() const;
195 
196 
200  void setRepoMetadataPath ( const Pathname &path_r );
201 
206  Pathname repoSolvfilesPath() const;
207 
211  void setRepoSolvfilesPath ( const Pathname &path_r );
212 
217  Pathname repoPackagesPath() const;
218 
219 
223  void setRepoPackagesPath ( const Pathname &path_r );
224 
229  Pathname configPath() const;
230 
235  Pathname knownReposPath() const;
236 
241  Pathname knownServicesPath() const;
242 
247  Pathname needrebootFile() const;
248 
253  Pathname needrebootPath() const;
254 
258  void setGeoipEnabled( bool enable = true );
259 
263  bool geoipEnabled () const;
264 
268  Pathname geoipCachePath() const;
269 
275  const std::vector<std::string> geoipHostnames () const;
276 
282  Pathname varsPath() const;
283 
289  bool repo_add_probe() const;
290 
294  unsigned repo_refresh_delay() const;
295 
299  LocaleSet repoRefreshLocales() const;
300 
306  bool repoLabelIsAlias() const;
307 
315  void repoLabelIsAlias( bool yesno_r );
316 
320  long download_max_concurrent_connections() const;
321 
326  long download_min_download_speed() const;
327 
332  long download_min_download_speed_time() const;
333 
337  long download_max_download_speed() const;
338 
342  long download_max_silent_tries() const;
343 
347  long download_transfer_timeout() const;
348 
349 
353  bool download_use_deltarpm() const;
354 
359  bool download_use_deltarpm_always() const;
360 
365  bool download_media_prefer_download() const;
368  { return ! download_media_prefer_download(); }
372  void set_download_media_prefer_download( bool yesno_r );
376  void set_default_download_media_prefer_download();
377 
382  Pathname download_mediaMountdir() const;
384  void set_download_mediaMountdir( Pathname newval_r );
386  void set_default_download_mediaMountdir();
387 
391  DownloadMode commit_downloadMode() const;
392 
406  bool gpgCheck() const;
407  TriBool repoGpgCheck() const;
408  TriBool pkgGpgCheck() const;
409 
410  void setGpgCheck( bool val_r );
411  void setRepoGpgCheck( TriBool val_r );
412  void setPkgGpgCheck( TriBool val_r );
413 
414  void resetGpgCheck();
415  void resetRepoGpgCheck();
416  void resetPkgGpgCheck();
417 
418  //
423  Pathname vendorPath() const;
424 
428  ResolverFocus solver_focus() const;
429 
433  bool solver_onlyRequires() const;
434 
439  Pathname solver_checkSystemFile() const;
440 
446  Pathname solver_checkSystemFileDir() const;
447 
451  bool solver_allowVendorChange() const;
452 
454  bool solver_dupAllowDowngrade() const;
455 
457  bool solver_dupAllowNameChange() const;
458 
460  bool solver_dupAllowArchChange() const;
461 
463  bool solver_dupAllowVendorChange() const;
464 
468  bool solver_cleandepsOnRemove() const;
469 
478  bool solver_noUpdateProvide() const;
479 
487  unsigned solver_upgradeTestcasesToKeep() const;
488 
502  bool solverUpgradeRemoveDroppedPackages() const;
504  void setSolverUpgradeRemoveDroppedPackages( bool val_r );
506  void resetSolverUpgradeRemoveDroppedPackages();
507 
518  const std::set<std::string> & multiversionSpec() const;
519  void multiversionSpec( std::set<std::string> new_r );
520  void clearMultiversionSpec();
521  void addMultiversionSpec( const std::string & name_r );
522  void removeMultiversionSpec( const std::string & name_r );
524 
529  Pathname locksFile() const;
530 
534  bool apply_locks_file() const;
535 
536 #if LEGACY(1735)
537 
540  Pathname update_dataPath() const;
541 
545  Pathname update_scriptsPath() const;
546 
550  Pathname update_messagesPath() const;
551 #else
552 
555  static Pathname update_dataPath();
556 
560  static Pathname update_scriptsPath();
561 
565  static Pathname update_messagesPath();
566 #endif
567 
571  std::string updateMessagesNotify() const;
573  void setUpdateMessagesNotify( const std::string & val_r );
575  void resetUpdateMessagesNotify();
577 
586  target::rpm::RpmInstFlags rpmInstallFlags() const;
588 
595  Pathname historyLogFile() const;
596 
600  Pathname credentialsGlobalDir() const;
601 
605  Pathname credentialsGlobalFile() const;
606 
615  std::string distroverpkg() const;
616 
622  Pathname pluginsPath() const;
623 
627  std::string multiversionKernels() const;
628 
630 
631  public:
632  class Impl;
633 
634  ZConfig(const ZConfig &) = delete;
635  ZConfig(ZConfig &&) = delete;
636  ZConfig &operator=(const ZConfig &) = delete;
637  ZConfig &operator=(ZConfig &&) = delete;
638 
640  ~ZConfig();
641  void notifyTargetChanged();
642 
643  private:
644  friend class RepoManager;
645  friend class zyppng::RepoManager;
647  Pathname builtinRepoCachePath() const;
649  Pathname builtinRepoMetadataPath() const;
651  Pathname builtinRepoSolvfilesPath() const;
653  Pathname builtinRepoPackagesPath() const;
654 
655  private:
656  friend class Impl;
658  ZConfig();
661  };
663 
665 } // namespace zypp
667 #endif // ZYPP_ZCONFIG_H
void resetSystemArchitecture()
Reset the zypp system architecture to the default.
Definition: ZConfig.h:136
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.
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
Pointer to implementation.
Definition: ZConfig.h:660
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition: String.h:31
ZConfig implementation.
Definition: ZConfig.cc:235
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Definition: Arch.h:173
Interim helper class to collect global options and settings.
Definition: ZConfig.h:81
Provides API related macros.
&#39;Language[_Country]&#39; codes.
Definition: Locale.h:50
bool download_media_prefer_volatile() const
Definition: ZConfig.h:367
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:152
The RepoManager class Provides knowledge and methods to maintain repo settings and metadata for a giv...
Definition: repomanager.h:240
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
DownloadMode
Supported commit download policies.
Definition: DownloadMode.h:24