libzypp 17.36.5
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>
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
32namespace zyppng {
33 // just for the friend declaration
34 template<typename T> class RepoManager;
35}
36
38namespace 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
89
93 void setRepoManagerRoot ( const Pathname &root );
94
100 void announceSystemRoot( const Pathname & root_r );
101
102 public:
103
106
108 Arch systemArchitecture() const;
109
116 void setSystemArchitecture( const Arch & arch_r );
117
121
122 public:
125 static Locale defaultTextLocale();
126
129 Locale textLocale() const;
130
132 void setTextLocale( const Locale & locale_r );
133
137
138 public:
143
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;
346
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();
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)
507 Pathname update_dataPath() const;
508
512 Pathname update_scriptsPath() const;
513
517 Pathname update_messagesPath() const;
518#else
522 static Pathname update_dataPath();
523
527 static Pathname update_scriptsPath();
528
532 static Pathname update_messagesPath();
533#endif
534
537
538 std::string updateMessagesNotify() const;
540 void setUpdateMessagesNotify( const std::string & val_r );
542 void resetUpdateMessagesNotify();
544
547
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
586
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;
621
622 private:
623 friend class Impl;
625 ZConfig();
628 };
629
630
632} // namespace zypp
634#endif // ZYPP_ZCONFIG_H
Architecture.
Definition Arch.h:37
'Language[_Country]' codes.
Definition Locale.h:51
creates and provides information about known sources.
Definition RepoManager.h:59
ZConfig implementation.
Definition ZConfig.cc:400
Arch systemArchitecture() const
The system architecture zypp uses.
Definition ZConfig.cc:990
ZConfig(const ZConfig &)=delete
Pathname builtinRepoSolvfilesPath() const
The builtin config file value.
Definition ZConfig.cc:1110
Pathname repoManagerRoot() const
The RepoManager root directory.
Definition ZConfig.cc:966
void resetSystemArchitecture()
Reset the zypp system architecture to the default.
Definition ZConfig.h:119
void setRepoManagerRoot(const Pathname &root)
Sets the RepoManager root directory.
Definition ZConfig.cc:972
void setTextLocale(const Locale &locale_r)
Set the preferred locale for translated texts.
Definition ZConfig.cc:1017
void notifyTargetChanged()
internal
Definition ZConfig.cc:960
static Locale defaultTextLocale()
The autodetected preferred locale for translated texts.
Definition ZConfig.cc:1008
Pathname systemRoot() const
The target root directory.
Definition ZConfig.cc:963
ZConfig & operator=(ZConfig &&)=delete
ZConfig(ZConfig &&)=delete
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
Pointer to implementation.
Definition ZConfig.h:627
void setSystemArchitecture(const Arch &arch_r)
Override the zypp system architecture.
Definition ZConfig.cc:993
static ZConfig & instance()
Singleton ctor.
Definition ZConfig.cc:935
std::ostream & about(std::ostream &str) const
Print some detail about the current libzypp version.
Definition ZConfig.cc:1353
Pathname builtinRepoCachePath() const
The builtin config file value.
Definition ZConfig.cc:1104
Pathname builtinRepoPackagesPath() const
The builtin config file value.
Definition ZConfig.cc:1113
Pathname builtinRepoMetadataPath() const
The builtin config file value.
Definition ZConfig.cc:1107
bool download_media_prefer_volatile() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition ZConfig.h:344
ZConfig & operator=(const ZConfig &)=delete
friend class RepoManager
Definition ZConfig.h:611
void resetTextLocale()
Reset the locale for translated texts to the default.
Definition ZConfig.h:135
static Arch defaultSystemArchitecture()
The autodetected system architecture.
Definition ZConfig.cc:984
void announceSystemRoot(const Pathname &root_r)
Announce a target root directory without launching the Target.
Definition ZConfig.cc:975
bool download_media_prefer_download() const
Hint which media to prefer when installing packages (download vs.
Definition ZConfig.cc:1195
The RepoManager class Provides knowledge and methods to maintain repo settings and metadata for a giv...
String related utilities and Regular expression matching.
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition NonCopyable.h:26
Easy-to use interface to the ZYPP dependency resolver.
std::unordered_set< Locale > LocaleSet
Definition Locale.h:29
ResolverFocus
The resolver's general attitude.
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition String.h:30
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition Arch.h:247
DownloadMode
Supported commit download policies.
Wrapper for const correct access via Smart pointer types.
Definition PtrTypes.h:293
Provides API related macros.