libzypp  17.25.10
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/APIConfig.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 
33 namespace zypp
34 {
35 
36  class RepoManager;
37 
39  //
40  // CLASS NAME : ZConfig
41  //
61  class ZConfig : private base::NonCopyable
62  {
63  public:
64 
66  static ZConfig & instance();
67 
69  std::ostream & about( std::ostream & str ) const;
70 
71  public:
72 
76  Pathname systemRoot() const;
77 
81  Pathname repoManagerRoot() const;
82 
86  void setRepoManagerRoot ( const Pathname &root );
87 
88  public:
89 
92 
94  Arch systemArchitecture() const;
95 
102  void setSystemArchitecture( const Arch & arch_r );
103 
107 
108  public:
111  static Locale defaultTextLocale();
112 
115  Locale textLocale() const;
116 
118  void setTextLocale( const Locale & locale_r );
119 
123 
124  public:
130  bool hasUserData() const;
131 
133  std::string userData() const;
134 
139  bool setUserData( const std::string & str_r );
141 
142  public:
147  Pathname repoCachePath() const;
148 
152  void setRepoCachePath ( const Pathname &path_r );
153 
157  Pathname pubkeyCachePath() const;
158 
163  Pathname repoMetadataPath() const;
164 
165 
169  void setRepoMetadataPath ( const Pathname &path_r );
170 
175  Pathname repoSolvfilesPath() const;
176 
180  void setRepoSolvfilesPath ( const Pathname &path_r );
181 
186  Pathname repoPackagesPath() const;
187 
188 
192  void setRepoPackagesPath ( const Pathname &path_r );
193 
198  Pathname configPath() const;
199 
204  Pathname knownReposPath() const;
205 
210  Pathname knownServicesPath() const;
211 
216  Pathname needrebootFile() const;
217 
222  Pathname needrebootPath() const;
223 
229  Pathname varsPath() const;
230 
236  bool repo_add_probe() const;
237 
241  unsigned repo_refresh_delay() const;
242 
247 
253  bool repoLabelIsAlias() const;
254 
262  void repoLabelIsAlias( bool yesno_r );
263 
268 
273  long download_min_download_speed() const;
274 
278  long download_max_download_speed() const;
279 
283  long download_max_silent_tries() const;
284 
288  long download_transfer_timeout() const;
289 
290 
294  bool download_use_deltarpm() const;
295 
300  bool download_use_deltarpm_always() const;
301 
306  bool download_media_prefer_download() const;
309  { return ! download_media_prefer_download(); }
313  void set_download_media_prefer_download( bool yesno_r );
318 
325  void set_download_mediaMountdir( Pathname newval_r );
328 
333 
347  bool gpgCheck() const;
348  TriBool repoGpgCheck() const;
349  TriBool pkgGpgCheck() const;
350 
351  void setGpgCheck( bool val_r );
352  void setRepoGpgCheck( TriBool val_r );
353  void setPkgGpgCheck( TriBool val_r );
354 
355  void resetGpgCheck();
356  void resetRepoGpgCheck();
357  void resetPkgGpgCheck();
358 
359  //
364  Pathname vendorPath() const;
365 
369  ResolverFocus solver_focus() const;
370 
374  bool solver_onlyRequires() const;
375 
381 
388 
392  bool solver_allowVendorChange() const;
393 
395  bool solver_dupAllowDowngrade() const;
396 
398  bool solver_dupAllowNameChange() const;
399 
401  bool solver_dupAllowArchChange() const;
402 
404  bool solver_dupAllowVendorChange() const;
405 
409  bool solver_cleandepsOnRemove() const;
410 
418  unsigned solver_upgradeTestcasesToKeep() const;
419 
435  void setSolverUpgradeRemoveDroppedPackages( bool val_r );
438 
449  const std::set<std::string> & multiversionSpec() const;
450  void multiversionSpec( std::set<std::string> new_r );
451  void clearMultiversionSpec();
452  void addMultiversionSpec( const std::string & name_r );
453  void removeMultiversionSpec( const std::string & name_r );
455 
460  Pathname locksFile() const;
461 
465  bool apply_locks_file() const;
466 
470  Pathname update_dataPath() const;
471 
477 
483 
487  std::string updateMessagesNotify() const;
489  void setUpdateMessagesNotify( const std::string & val_r );
493 
502  target::rpm::RpmInstFlags rpmInstallFlags() const;
504 
511  Pathname historyLogFile() const;
512 
517 
522 
531  std::string distroverpkg() const;
532 
538  Pathname pluginsPath() const;
539 
543  std::string multiversionKernels() const;
544 
546 
547  public:
548  class Impl;
550  ~ZConfig();
551  private:
552  friend class RepoManager;
561 
562  private:
563  friend class Impl;
565  ZConfig();
568  };
570 
572 } // namespace zypp
574 #endif // ZYPP_ZCONFIG_H
zypp::ZConfig::resetSolverUpgradeRemoveDroppedPackages
void resetSolverUpgradeRemoveDroppedPackages()
Reset solverUpgradeRemoveDroppedPackages to the zypp.conf default.
Definition: ZConfig.cc:1122
zypp::ZConfig::repo_add_probe
bool repo_add_probe() const
Whether repository urls should be probed.
Definition: ZConfig.cc:1028
zypp::ZConfig::solver_dupAllowNameChange
bool solver_dupAllowNameChange() const
DUP tune: Whether to follow package renames upon DUP.
Definition: ZConfig.cc:1102
zypp::ZConfig::setSolverUpgradeRemoveDroppedPackages
void setSolverUpgradeRemoveDroppedPackages(bool val_r)
Set solverUpgradeRemoveDroppedPackages to val_r.
Definition: ZConfig.cc:1121
zypp::ZConfig::repoGpgCheck
TriBool repoGpgCheck() const
Check repo matadata signatures (indeterminate - according to gpgcheck)
Definition: ZConfig.cc:1082
zypp::ZConfig::apply_locks_file
bool apply_locks_file() const
Whether locks file should be read and applied after start (true)
Definition: ZConfig.cc:1138
zypp::ZConfig::resetUpdateMessagesNotify
void resetUpdateMessagesNotify()
Reset to the zypp.conf default.
Definition: ZConfig.cc:1165
zypp::ZConfig::commit_downloadMode
DownloadMode commit_downloadMode() const
Commit download policy to use as default.
Definition: ZConfig.cc:1077
ResolverFocus.h
zypp::ZConfig::download_transfer_timeout
long download_transfer_timeout() const
Maximum time in seconds that you allow a transfer operation to take.
Definition: ZConfig.cc:1070
zypp::ZConfig::configPath
Pathname configPath() const
Path where the configfiles are kept (/etc/zypp).
Definition: ZConfig.cc:984
zypp::ZConfig::solver_dupAllowArchChange
bool solver_dupAllowArchChange() const
DUP tune: Whether to allow package arch changes upon DUP.
Definition: ZConfig.cc:1103
zypp::ZConfig::repoPackagesPath
Pathname repoPackagesPath() const
Path where the repo packages are downloaded and kept (repoCachePath()/packages).
Definition: ZConfig.cc:959
zypp::ZConfig::setRepoCachePath
void setRepoCachePath(const Pathname &path_r)
Set a new path as the default repo cache path.
Definition: ZConfig.cc:932
zypp::ZConfig::setRepoManagerRoot
void setRepoManagerRoot(const Pathname &root)
Sets the RepoManager root directory.
Definition: ZConfig.cc:841
zypp::ZConfig::builtinRepoSolvfilesPath
Pathname builtinRepoSolvfilesPath() const
The builtin config file value.
Definition: ZConfig.cc:976
zypp::ZConfig::solver_checkSystemFileDir
Pathname solver_checkSystemFileDir() const
Directory, which may or may not contain files in which dependencies described which has to be fulfill...
Definition: ZConfig.cc:1113
zypp::ZConfig::multiversionSpec
const std::set< std::string > & multiversionSpec() const
Definition: ZConfig.cc:1132
zypp::ZConfig::solver_onlyRequires
bool solver_onlyRequires() const
Solver regards required packages,patterns,...
Definition: ZConfig.cc:1095
zypp::ZConfig::set_default_download_media_prefer_download
void set_default_download_media_prefer_download()
Set download_media_prefer_download to the configfiles default.
Definition: ZConfig.cc:1055
zypp::ZConfig::locksFile
Pathname locksFile() const
Path where zypp can find or create lock file (configPath()/locks)
Definition: ZConfig.cc:1020
zypp::ZConfig::solver_allowVendorChange
bool solver_allowVendorChange() const
Whether vendor check is by default enabled.
Definition: ZConfig.cc:1098
zypp::ZConfig::download_max_download_speed
long download_max_download_speed() const
Maximum download speed (bytes per second)
Definition: ZConfig.cc:1064
zypp::ZConfig::repoCachePath
Pathname repoCachePath() const
Path where the caches are kept (/var/cache/zypp)
Definition: ZConfig.cc:921
zypp::ZConfig::resetSystemArchitecture
void resetSystemArchitecture()
Reset the zypp system architecture to the default.
Definition: ZConfig.h:105
zypp::ZConfig::vendorPath
Pathname vendorPath() const
Directory for equivalent vendor definitions (configPath()/vendors.d)
Definition: ZConfig.cc:1014
zypp::ZConfig::solverUpgradeRemoveDroppedPackages
bool solverUpgradeRemoveDroppedPackages() const
Whether dist upgrade should remove a products dropped packages (true).
Definition: ZConfig.cc:1120
zypp::ZConfig::needrebootPath
Pathname needrebootPath() const
Path where the custom needreboot config files are kept (configPath()/needreboot.d).
Definition: ZConfig.cc:1005
zypp::ZConfig::multiversionKernels
std::string multiversionKernels() const
Definition: ZConfig.cc:1202
zypp::ZConfig::update_dataPath
Pathname update_dataPath() const
Path where the update items are kept (/var/adm)
Definition: ZConfig.cc:1141
zypp::ZConfig::download_min_download_speed
long download_min_download_speed() const
Minimum download speed (bytes per second) until the connection is dropped.
Definition: ZConfig.cc:1061
zypp::ZConfig::download_max_concurrent_connections
long download_max_concurrent_connections() const
Maximum number of concurrent connections for a single transfer.
Definition: ZConfig.cc:1058
PtrTypes.h
zypp::ZConfig::clearMultiversionSpec
void clearMultiversionSpec()
Definition: ZConfig.cc:1134
Pathname.h
zypp::ZConfig::setTextLocale
void setTextLocale(const Locale &locale_r)
Set the preferred locale for translated texts.
Definition: ZConfig.cc:883
zypp::ResolverFocus
ResolverFocus
The resolvers general attitude.
Definition: ResolverFocus.h:22
zypp::Arch
Architecture.
Definition: Arch.h:37
zypp::ZConfig::knownServicesPath
Pathname knownServicesPath() const
Path where the known services .service files are kept (configPath()/services.d).
Definition: ZConfig.cc:996
zypp::ZConfig::solver_upgradeTestcasesToKeep
unsigned solver_upgradeTestcasesToKeep() const
When committing a dist upgrade (e.g.
Definition: ZConfig.cc:1117
zypp::ZConfig::update_messagesPath
Pathname update_messagesPath() const
Path where the repo solv files are created and kept (update_dataPath()/solv).
Definition: ZConfig.cc:1147
zypp::ZConfig::repoManagerRoot
Pathname repoManagerRoot() const
The RepoManager root directory.
Definition: ZConfig.cc:835
zypp::ZConfig::updateMessagesNotify
std::string updateMessagesNotify() const
Command definition for sending update messages.
Definition: ZConfig.cc:1159
zypp::ZConfig::setUserData
bool setUserData(const std::string &str_r)
Set a new userData string.
Definition: ZConfig.cc:904
zypp::ZConfig::setRepoSolvfilesPath
void setRepoSolvfilesPath(const Pathname &path_r)
Set a new path as the default repo cache path.
Definition: ZConfig.cc:954
zypp::ZConfig::textLocale
Locale textLocale() const
The locale for translated texts zypp uses.
Definition: ZConfig.cc:880
zypp::ZConfig::setPkgGpgCheck
void setPkgGpgCheck(TriBool val_r)
Change the value.
Definition: ZConfig.cc:1087
zypp::ZConfig::resetRepoGpgCheck
void resetRepoGpgCheck()
Reset to the zconfig default.
Definition: ZConfig.cc:1090
zypp::ZConfig::solver_cleandepsOnRemove
bool solver_cleandepsOnRemove() const
Whether removing a package should also remove no longer needed requirements.
Definition: ZConfig.cc:1106
zypp::ZConfig::solver_dupAllowDowngrade
bool solver_dupAllowDowngrade() const
DUP tune: Whether to allow version downgrades upon DUP.
Definition: ZConfig.cc:1101
zypp::RW_pointer
Wrapper for const correct access via Smart pointer types.
Definition: PtrTypes.h:286
zypp::ZConfig::solver_focus
ResolverFocus solver_focus() const
The resolvers general attitude when resolving jobs.
Definition: ZConfig.cc:1093
zypp::ZConfig::pkgGpgCheck
TriBool pkgGpgCheck() const
Check rpm package signatures (indeterminate - according to gpgcheck)
Definition: ZConfig.cc:1083
Arch.h
zypp::ZConfig::repoRefreshLocales
LocaleSet repoRefreshLocales() const
List of locales for which translated package descriptions should be downloaded.
Definition: ZConfig.cc:1034
zypp::ZConfig::repoSolvfilesPath
Pathname repoSolvfilesPath() const
Path where the repo solv files are created and kept (repoCachePath()/solv).
Definition: ZConfig.cc:948
zypp::base::NonCopyable
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
zypp::ZConfig::historyLogFile
Pathname historyLogFile() const
Path where ZYpp install history is logged.
Definition: ZConfig.cc:1174
zypp::ZConfig::solver_dupAllowVendorChange
bool solver_dupAllowVendorChange() const
DUP tune: Whether to allow package vendor changes upon DUP.
Definition: ZConfig.cc:1104
zypp::ZConfig::about
std::ostream & about(std::ostream &str) const
Print some detail about the current libzypp version.
Definition: ZConfig.cc:1209
zypp::DownloadMode
DownloadMode
Supported commit download policies.
Definition: DownloadMode.h:23
DownloadMode.h
zypp::ZConfig::setSystemArchitecture
void setSystemArchitecture(const Arch &arch_r)
Override the zypp system architecture.
Definition: ZConfig.cc:859
zypp::ZConfig::_pimpl
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
Pointer to implementation.
Definition: ZConfig.h:567
zypp::ZConfig::removeMultiversionSpec
void removeMultiversionSpec(const std::string &name_r)
Definition: ZConfig.cc:1136
zypp::ZConfig::setRepoGpgCheck
void setRepoGpgCheck(TriBool val_r)
Change the value.
Definition: ZConfig.cc:1086
zypp::ZConfig::addMultiversionSpec
void addMultiversionSpec(const std::string &name_r)
Definition: ZConfig.cc:1135
zypp::ZConfig::instance
static ZConfig & instance()
Singleton ctor.
Definition: Resolver.cc:126
zypp::ZConfig::knownReposPath
Pathname knownReposPath() const
Path where the known repositories .repo files are kept (configPath()/repos.d).
Definition: ZConfig.cc:990
zypp::ZConfig::defaultTextLocale
static Locale defaultTextLocale()
The autodetected preferred locale for translated texts.
Definition: ZConfig.cc:874
IdString.h
zypp::ZConfig::set_download_mediaMountdir
void set_download_mediaMountdir(Pathname newval_r)
Set alternate value.
Definition: ZConfig.cc:1074
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
zypp::ZConfig
Interim helper class to collect global options and settings.
Definition: ZConfig.h:62
zypp::ZConfig::builtinRepoPackagesPath
Pathname builtinRepoPackagesPath() const
The builtin config file value.
Definition: ZConfig.cc:979
zypp::ZConfig::resetTextLocale
void resetTextLocale()
Reset the locale for translated texts to the default.
Definition: ZConfig.h:121
zypp::ZConfig::download_media_prefer_download
bool download_media_prefer_download() const
Hint which media to prefer when installing packages (download vs.
Definition: ZConfig.cc:1049
zypp::ZConfig::set_default_download_mediaMountdir
void set_default_download_mediaMountdir()
Reset to zypp.cong default.
Definition: ZConfig.cc:1075
zypp::ZConfig::repoLabelIsAlias
bool repoLabelIsAlias() const
Whether to use repository alias or name in user messages (progress, exceptions, .....
Definition: ZConfig.cc:1037
zypp::ZConfig::defaultSystemArchitecture
static Arch defaultSystemArchitecture()
The autodetected system architecture.
Definition: ZConfig.cc:850
Impl
TriBool.h
zypp::ZConfig::download_max_silent_tries
long download_max_silent_tries() const
Maximum silent tries.
Definition: ZConfig.cc:1067
zypp::ZConfig::varsPath
Pathname varsPath() const
Path containing custom repo variable definitions (configPath()/vars.d).
Definition: ZConfig.cc:1008
zypp::ZConfig::update_scriptsPath
Pathname update_scriptsPath() const
Path where the repo metadata is downloaded and kept (update_dataPath()/).
Definition: ZConfig.cc:1153
zypp::ZConfig::setRepoPackagesPath
void setRepoPackagesPath(const Pathname &path_r)
Set a new path as the default repo cache path.
Definition: ZConfig.cc:965
zypp::ZConfig::setRepoMetadataPath
void setRepoMetadataPath(const Pathname &path_r)
Set a new path as the default repo cache path.
Definition: ZConfig.cc:943
zypp::ZConfig::~ZConfig
~ZConfig()
Dtor.
Definition: ZConfig.cc:828
zypp::ZConfig::pubkeyCachePath
Pathname pubkeyCachePath() const
Path where the pubkey caches.
Definition: ZConfig.cc:927
zypp::ZConfig::needrebootFile
Pathname needrebootFile() const
Path of the default needreboot config file (configPath()/needreboot).
Definition: ZConfig.cc:1002
zypp::ZConfig::gpgCheck
bool gpgCheck() const
Turn signature checking on/off (on)
Definition: ZConfig.cc:1081
zypp::ZConfig::hasUserData
bool hasUserData() const
Whether a (non empty) user data sting is defined.
Definition: ZConfig.cc:898
zypp::ZConfig::ZConfig
ZConfig()
Default ctor.
Definition: ZConfig.cc:817
zypp::ZConfig::setUpdateMessagesNotify
void setUpdateMessagesNotify(const std::string &val_r)
Set a new command definition (see update.messages.notify in zypp.conf).
Definition: ZConfig.cc:1162
zypp::LocaleSet
std::unordered_set< Locale > LocaleSet
Definition: Locale.h:27
zypp::ZConfig::setGpgCheck
void setGpgCheck(bool val_r)
Change the value.
Definition: ZConfig.cc:1085
zypp::ZConfig::repoMetadataPath
Pathname repoMetadataPath() const
Path where the repo metadata is downloaded and kept (repoCachePath()/raw).
Definition: ZConfig.cc:937
Locale.h
zypp::ZConfig::download_use_deltarpm_always
bool download_use_deltarpm_always() const
Whether to consider using a deltarpm even when rpm is local.
Definition: ZConfig.cc:1046
zypp::filesystem::Pathname
Pathname.
Definition: Pathname.h:45
zypp::ZConfig::resetGpgCheck
void resetGpgCheck()
Reset to the zconfig default.
Definition: ZConfig.cc:1089
RpmFlags.h
zypp::ZConfig::download_mediaMountdir
Pathname download_mediaMountdir() const
Path where media are preferably mounted or downloaded.
Definition: ZConfig.cc:1073
zypp::ZConfig::credentialsGlobalDir
Pathname credentialsGlobalDir() const
Defaults to /etc/zypp/credentials.d.
Definition: ZConfig.cc:1180
zypp::ZConfig::systemRoot
Pathname systemRoot() const
The target root directory.
Definition: ZConfig.cc:831
zypp::ZConfig::userData
std::string userData() const
User defined string value to be passed to log, history, plugins...
Definition: ZConfig.cc:901
str
String related utilities and Regular expression matching.
zypp::ZConfig::builtinRepoCachePath
Pathname builtinRepoCachePath() const
The builtin config file value.
Definition: ZConfig.cc:970
zypp::TriBool
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition: String.h:30
zypp::ZConfig::Impl
ZConfig implementation.
Definition: ZConfig.cc:307
zypp::ZConfig::rpmInstallFlags
target::rpm::RpmInstFlags rpmInstallFlags() const
The default target::rpm::RpmInstFlags for ZYppCommitPolicy.
Definition: ZConfig.cc:1170
zypp::ZConfig::distroverpkg
std::string distroverpkg() const
Package telling the "product version" on systems not using /etc/product.d/baseproduct.
Definition: ZConfig.cc:1194
zypp::ZConfig::set_download_media_prefer_download
void set_download_media_prefer_download(bool yesno_r)
Set download_media_prefer_download to a specific value.
Definition: ZConfig.cc:1052
zypp::ZConfig::download_use_deltarpm
bool download_use_deltarpm() const
Whether to consider using a deltarpm when downloading a package.
Definition: ZConfig.cc:1043
zypp::Locale
'Language[_Country]' codes.
Definition: Locale.h:50
zypp::ZConfig::builtinRepoMetadataPath
Pathname builtinRepoMetadataPath() const
The builtin config file value.
Definition: ZConfig.cc:973
zypp::ZConfig::repo_refresh_delay
unsigned repo_refresh_delay() const
Amount of time in minutes that must pass before another refresh.
Definition: ZConfig.cc:1031
zypp::ZConfig::download_media_prefer_volatile
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:308
zypp::ZConfig::resetPkgGpgCheck
void resetPkgGpgCheck()
Reset to the zconfig default.
Definition: ZConfig.cc:1091
zypp::RepoManager
creates and provides information about known sources.
Definition: RepoManager.h:106
zypp::ZConfig::credentialsGlobalFile
Pathname credentialsGlobalFile() const
Defaults to /etc/zypp/credentials.cat.
Definition: ZConfig.cc:1186
zypp::ZConfig::pluginsPath
Pathname pluginsPath() const
Defaults to /usr/lib/zypp/plugins.
Definition: ZConfig.cc:1199
zypp::ZConfig::solver_checkSystemFile
Pathname solver_checkSystemFile() const
File in which dependencies described which has to be fulfilled for a running system.
Definition: ZConfig.cc:1109
zypp::ZConfig::systemArchitecture
Arch systemArchitecture() const
The system architecture zypp uses.
Definition: ZConfig.cc:856
NonCopyable.h