libzypp 17.37.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>
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:
80 long lockTimeout() const;
81
82 public:
83
87 Pathname systemRoot() const;
88
93
97 void setRepoManagerRoot ( const Pathname &root );
98
104 void announceSystemRoot( const Pathname & root_r );
105
106 public:
107
110
112 Arch systemArchitecture() const;
113
120 void setSystemArchitecture( const Arch & arch_r );
121
125
126 public:
129 static Locale defaultTextLocale();
130
133 Locale textLocale() const;
134
136 void setTextLocale( const Locale & locale_r );
137
141
142 public:
147
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;
350
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();
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)
511 Pathname update_dataPath() const;
512
516 Pathname update_scriptsPath() const;
517
521 Pathname update_messagesPath() const;
522#else
526 static Pathname update_dataPath();
527
531 static Pathname update_scriptsPath();
532
536 static Pathname update_messagesPath();
537#endif
538
541
542 std::string updateMessagesNotify() const;
544 void setUpdateMessagesNotify( const std::string & val_r );
546 void resetUpdateMessagesNotify();
548
551
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
590
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;
625
626 private:
627 friend class Impl;
629 ZConfig();
632 };
633
634
636} // namespace zypp
638#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:60
ZConfig implementation.
Definition ZConfig.cc:400
Arch systemArchitecture() const
The system architecture zypp uses.
Definition ZConfig.cc:1004
ZConfig(const ZConfig &)=delete
Pathname builtinRepoSolvfilesPath() const
The builtin config file value.
Definition ZConfig.cc:1124
Pathname repoManagerRoot() const
The RepoManager root directory.
Definition ZConfig.cc:980
void resetSystemArchitecture()
Reset the zypp system architecture to the default.
Definition ZConfig.h:123
void setRepoManagerRoot(const Pathname &root)
Sets the RepoManager root directory.
Definition ZConfig.cc:986
void setTextLocale(const Locale &locale_r)
Set the preferred locale for translated texts.
Definition ZConfig.cc:1031
void notifyTargetChanged()
internal
Definition ZConfig.cc:974
static Locale defaultTextLocale()
The autodetected preferred locale for translated texts.
Definition ZConfig.cc:1022
Pathname systemRoot() const
The target root directory.
Definition ZConfig.cc:977
ZConfig & operator=(ZConfig &&)=delete
ZConfig(ZConfig &&)=delete
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
Pointer to implementation.
Definition ZConfig.h:631
void setSystemArchitecture(const Arch &arch_r)
Override the zypp system architecture.
Definition ZConfig.cc:1007
static ZConfig & instance()
Singleton ctor.
Definition ZConfig.cc:940
std::ostream & about(std::ostream &str) const
Print some detail about the current libzypp version.
Definition ZConfig.cc:1367
Pathname builtinRepoCachePath() const
The builtin config file value.
Definition ZConfig.cc:1118
Pathname builtinRepoPackagesPath() const
The builtin config file value.
Definition ZConfig.cc:1127
Pathname builtinRepoMetadataPath() const
The builtin config file value.
Definition ZConfig.cc:1121
long lockTimeout() const
The number of seconds to wait for the zypp lock to become available.
Definition ZConfig.cc:965
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:348
ZConfig & operator=(const ZConfig &)=delete
friend class RepoManager
Definition ZConfig.h:615
void resetTextLocale()
Reset the locale for translated texts to the default.
Definition ZConfig.h:139
static Arch defaultSystemArchitecture()
The autodetected system architecture.
Definition ZConfig.cc:998
void announceSystemRoot(const Pathname &root_r)
Announce a target root directory without launching the Target.
Definition ZConfig.cc:989
bool download_media_prefer_download() const
Hint which media to prefer when installing packages (download vs.
Definition ZConfig.cc:1209
The RepoManager class Provides knowledge and methods to maintain repo settings and metadata for a giv...
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition String.h:31
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.
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.