libzypp 17.32.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/APIConfig.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
33namespace zypp
34{
35
36 class RepoManager;
37
39 //
40 // CLASS NAME : ZConfig
41 //
63 class ZConfig : private base::NonCopyable
64 {
65 public:
66
68 static ZConfig & instance();
69
71 std::ostream & about( std::ostream & str ) const;
72
73 public:
74
78 Pathname systemRoot() const;
79
84
88 void setRepoManagerRoot ( const Pathname &root );
89
90 public:
91
94
97
104 void setSystemArchitecture( const Arch & arch_r );
105
109
110 public:
113 static Locale defaultTextLocale();
114
117 Locale textLocale() const;
118
120 void setTextLocale( const Locale & locale_r );
121
125
126 public:
132 bool hasUserData() const;
133
135 std::string userData() const;
136
141 bool setUserData( const std::string & str_r );
143
144 public:
149 Pathname repoCachePath() const;
150
154 void setRepoCachePath ( const Pathname &path_r );
155
160
166
167
171 void setRepoMetadataPath ( const Pathname &path_r );
172
178
182 void setRepoSolvfilesPath ( const Pathname &path_r );
183
189
190
194 void setRepoPackagesPath ( const Pathname &path_r );
195
200 Pathname configPath() const;
201
206 Pathname knownReposPath() const;
207
213
218 Pathname needrebootFile() const;
219
224 Pathname needrebootPath() const;
225
229 void setGeoipEnabled( bool enable = true );
230
234 bool geoipEnabled () const;
235
239 Pathname geoipCachePath() const;
240
246 const std::vector<std::string> geoipHostnames () const;
247
253 Pathname varsPath() const;
254
260 bool repo_add_probe() const;
261
265 unsigned repo_refresh_delay() const;
266
271
277 bool repoLabelIsAlias() const;
278
286 void repoLabelIsAlias( bool yesno_r );
287
292
297 long download_min_download_speed() const;
298
302 long download_max_download_speed() const;
303
307 long download_max_silent_tries() const;
308
312 long download_transfer_timeout() const;
313
314
318 bool download_use_deltarpm() const;
319
324 bool download_use_deltarpm_always() const;
325
342
352
357
371 bool gpgCheck() const;
372 TriBool repoGpgCheck() const;
373 TriBool pkgGpgCheck() const;
374
375 void setGpgCheck( bool val_r );
378
379 void resetGpgCheck();
380 void resetRepoGpgCheck();
381 void resetPkgGpgCheck();
383 //
388 Pathname vendorPath() const;
389
394
398 bool solver_onlyRequires() const;
399
405
412
416 bool solver_allowVendorChange() const;
417
419 bool solver_dupAllowDowngrade() const;
420
422 bool solver_dupAllowNameChange() const;
423
425 bool solver_dupAllowArchChange() const;
426
428 bool solver_dupAllowVendorChange() const;
429
433 bool solver_cleandepsOnRemove() const;
434
442 unsigned solver_upgradeTestcasesToKeep() const;
443
462
473 const std::set<std::string> & multiversionSpec() const;
474 void multiversionSpec( std::set<std::string> new_r );
476 void addMultiversionSpec( const std::string & name_r );
477 void removeMultiversionSpec( const std::string & name_r );
479
484 Pathname locksFile() const;
485
489 bool apply_locks_file() const;
490
495
501
507
511 std::string updateMessagesNotify() const;
513 void setUpdateMessagesNotify( const std::string & val_r );
517
526 target::rpm::RpmInstFlags rpmInstallFlags() const;
528
535 Pathname historyLogFile() const;
536
541
546
555 std::string distroverpkg() const;
556
562 Pathname pluginsPath() const;
563
567 std::string multiversionKernels() const;
568
570
571 public:
572 class Impl;
573
574 ZConfig(const ZConfig &) = delete;
575 ZConfig(ZConfig &&) = delete;
576 ZConfig &operator=(const ZConfig &) = delete;
577 ZConfig &operator=(ZConfig &&) = delete;
578
580 ~ZConfig();
581 void notifyTargetChanged();
582
583 private:
584 friend class RepoManager;
594
595 private:
596 friend class Impl;
598 ZConfig();
601 };
603
605} // namespace zypp
607#endif // ZYPP_ZCONFIG_H
RepoManager implementation.
Architecture.
Definition Arch.h:37
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Definition AutoDispose.h:95
'Language[_Country]' codes.
Definition Locale.h:50
ZConfig implementation.
Definition ZConfig.cc:406
Interim helper class to collect global options and settings.
Definition ZConfig.h:64
bool hasUserData() const
Whether a (non empty) user data sting is defined.
Definition ZConfig.cc:1019
bool solver_cleandepsOnRemove() const
Whether removing a package should also remove no longer needed requirements.
Definition ZConfig.cc:1234
std::string userData() const
User defined string value to be passed to log, history, plugins...
Definition ZConfig.cc:1022
Pathname knownServicesPath() const
Path where the known services .service files are kept (configPath()/services.d).
Definition ZConfig.cc:1117
void removeMultiversionSpec(const std::string &name_r)
Definition ZConfig.cc:1263
Pathname repoPackagesPath() const
Path where the repo packages are downloaded and kept (repoCachePath()/packages).
Definition ZConfig.cc:1080
unsigned repo_refresh_delay() const
Amount of time in minutes that must pass before another refresh.
Definition ZConfig.cc:1164
Arch systemArchitecture() const
The system architecture zypp uses.
Definition ZConfig.cc:977
Locale textLocale() const
The locale for translated texts zypp uses.
Definition ZConfig.cc:1001
const std::vector< std::string > geoipHostnames() const
All hostnames we want to rewrite using the geoip feature.
Definition ZConfig.cc:1138
Pathname update_dataPath() const
Path where the update items are kept (/var/adm)
Definition ZConfig.cc:1268
ZConfig(const ZConfig &)=delete
ResolverFocus solver_focus() const
The resolver's general attitude when resolving jobs.
Definition ZConfig.cc:1227
Pathname update_messagesPath() const
Path where the repo solv files are created and kept (update_dataPath()/solv).
Definition ZConfig.cc:1274
Pathname builtinRepoSolvfilesPath() const
The builtin config file value.
Definition ZConfig.cc:1097
Pathname pluginsPath() const
Defaults to /usr/lib/zypp/plugins.
Definition ZConfig.cc:1324
Pathname repoManagerRoot() const
The RepoManager root directory.
Definition ZConfig.cc:956
void resetSystemArchitecture()
Reset the zypp system architecture to the default.
Definition ZConfig.h:107
void resetRepoGpgCheck()
Reset to the zconfig default.
Definition ZConfig.cc:1223
bool gpgCheck() const
Turn signature checking on/off (on)
Definition ZConfig.cc:1214
Pathname knownReposPath() const
Path where the known repositories .repo files are kept (configPath()/repos.d).
Definition ZConfig.cc:1111
Pathname update_scriptsPath() const
Path where the repo metadata is downloaded and kept (update_dataPath()/).
Definition ZConfig.cc:1280
long download_transfer_timeout() const
Maximum time in seconds that you allow a transfer operation to take.
Definition ZConfig.cc:1203
void setRepoManagerRoot(const Pathname &root)
Sets the RepoManager root directory.
Definition ZConfig.cc:962
bool solver_dupAllowArchChange() const
DUP tune: Whether to allow package arch changes upon DUP.
Definition ZConfig.cc:1232
void setTextLocale(const Locale &locale_r)
Set the preferred locale for translated texts.
Definition ZConfig.cc:1004
bool solverUpgradeRemoveDroppedPackages() const
Whether dist upgrade should remove a products dropped packages (true).
Definition ZConfig.cc:1237
void notifyTargetChanged()
internal
Definition ZConfig.cc:950
static Locale defaultTextLocale()
The autodetected preferred locale for translated texts.
Definition ZConfig.cc:995
Pathname download_mediaMountdir() const
Path where media are preferably mounted or downloaded.
Definition ZConfig.cc:1206
void resetSolverUpgradeRemoveDroppedPackages()
Reset solverUpgradeRemoveDroppedPackages to the zypp.conf default.
Definition ZConfig.cc:1239
bool apply_locks_file() const
Whether locks file should be read and applied after start (true)
Definition ZConfig.cc:1265
bool solver_allowVendorChange() const
Whether vendor check is by default enabled.
Definition ZConfig.cc:1229
void set_default_download_mediaMountdir()
Reset to zypp.cong default.
Definition ZConfig.cc:1208
Pathname repoCachePath() const
Path where the caches are kept (/var/cache/zypp)
Definition ZConfig.cc:1042
void setPkgGpgCheck(TriBool val_r)
Change the value.
Definition ZConfig.cc:1220
Pathname needrebootPath() const
Path where the custom needreboot config files are kept (configPath()/needreboot.d).
Definition ZConfig.cc:1126
bool setUserData(const std::string &str_r)
Set a new userData string.
Definition ZConfig.cc:1025
Pathname systemRoot() const
The target root directory.
Definition ZConfig.cc:953
long download_max_silent_tries() const
Maximum silent tries.
Definition ZConfig.cc:1200
bool repo_add_probe() const
Whether repository urls should be probed.
Definition ZConfig.cc:1161
target::rpm::RpmInstFlags rpmInstallFlags() const
The default target::rpm::RpmInstFlags for ZYppCommitPolicy.
Definition ZConfig.cc:1297
ZConfig & operator=(ZConfig &&)=delete
void setUpdateMessagesNotify(const std::string &val_r)
Set a new command definition (see update.messages.notify in zypp.conf).
Definition ZConfig.cc:1289
unsigned solver_upgradeTestcasesToKeep() const
When committing a dist upgrade (e.g.
Definition ZConfig.cc:1235
Pathname repoMetadataPath() const
Path where the repo metadata is downloaded and kept (repoCachePath()/raw).
Definition ZConfig.cc:1058
Pathname geoipCachePath() const
Path where the geoip caches are kept (/var/cache/zypp/geoip)
Definition ZConfig.cc:1135
Pathname vendorPath() const
Directory for equivalent vendor definitions (configPath()/vendors.d)
Definition ZConfig.cc:1147
long download_min_download_speed() const
Minimum download speed (bytes per second) until the connection is dropped.
Definition ZConfig.cc:1194
DownloadMode commit_downloadMode() const
Commit download policy to use as default.
Definition ZConfig.cc:1210
Pathname needrebootFile() const
Path of the default needreboot config file (configPath()/needreboot).
Definition ZConfig.cc:1123
void setGpgCheck(bool val_r)
Change the value.
Definition ZConfig.cc:1218
bool solver_dupAllowVendorChange() const
DUP tune: Whether to allow package vendor changes upon DUP.
Definition ZConfig.cc:1233
~ZConfig()
Dtor.
Definition ZConfig.cc:947
void setGeoipEnabled(bool enable=true)
Enables or disables the use of the geoip feature of download.opensuse.org.
Definition ZConfig.cc:1129
ZConfig(ZConfig &&)=delete
Pathname locksFile() const
Path where zypp can find or create lock file (configPath()/locks)
Definition ZConfig.cc:1153
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
Pointer to implementation.
Definition ZConfig.h:600
Pathname repoSolvfilesPath() const
Path where the repo solv files are created and kept (repoCachePath()/solv).
Definition ZConfig.cc:1069
bool geoipEnabled() const
Returns true if zypp should use the geoip feature of download.opensuse.org.
Definition ZConfig.cc:1132
Pathname historyLogFile() const
Path where ZYpp install history is logged.
Definition ZConfig.cc:1301
void setSystemArchitecture(const Arch &arch_r)
Override the zypp system architecture.
Definition ZConfig.cc:980
TriBool pkgGpgCheck() const
Check rpm package signatures (indeterminate - according to gpgcheck)
Definition ZConfig.cc:1216
static ZConfig & instance()
Singleton ctor.
Definition ZConfig.cc:925
void setRepoPackagesPath(const Pathname &path_r)
Set a new path as the default repo cache path.
Definition ZConfig.cc:1086
void setRepoSolvfilesPath(const Pathname &path_r)
Set a new path as the default repo cache path.
Definition ZConfig.cc:1075
void resetUpdateMessagesNotify()
Reset to the zypp.conf default.
Definition ZConfig.cc:1292
std::ostream & about(std::ostream &str) const
Print some detail about the current libzypp version.
Definition ZConfig.cc:1334
const std::set< std::string > & multiversionSpec() const
Definition ZConfig.cc:1259
void set_download_mediaMountdir(Pathname newval_r)
Set alternate value.
Definition ZConfig.cc:1207
bool download_use_deltarpm() const
Whether to consider using a deltarpm when downloading a package.
Definition ZConfig.cc:1176
TriBool repoGpgCheck() const
Check repo matadata signatures (indeterminate - according to gpgcheck)
Definition ZConfig.cc:1215
void set_download_media_prefer_download(bool yesno_r)
Set download_media_prefer_download to a specific value.
Definition ZConfig.cc:1185
std::string updateMessagesNotify() const
Command definition for sending update messages.
Definition ZConfig.cc:1286
void addMultiversionSpec(const std::string &name_r)
Definition ZConfig.cc:1262
Pathname builtinRepoCachePath() const
The builtin config file value.
Definition ZConfig.cc:1091
Pathname builtinRepoPackagesPath() const
The builtin config file value.
Definition ZConfig.cc:1100
Pathname solver_checkSystemFile() const
File in which dependencies described which has to be fulfilled for a running system.
Definition ZConfig.cc:1242
Pathname builtinRepoMetadataPath() const
The builtin config file value.
Definition ZConfig.cc:1094
void set_default_download_media_prefer_download()
Set download_media_prefer_download to the configfiles default.
Definition ZConfig.cc:1188
Pathname solver_checkSystemFileDir() const
Directory, which may or may not contain files in which dependencies described which has to be fulfill...
Definition ZConfig.cc:1246
void resetGpgCheck()
Reset to the zconfig default.
Definition ZConfig.cc:1222
void setSolverUpgradeRemoveDroppedPackages(bool val_r)
Set solverUpgradeRemoveDroppedPackages to val_r.
Definition ZConfig.cc:1238
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:332
ZConfig & operator=(const ZConfig &)=delete
void resetTextLocale()
Reset the locale for translated texts to the default.
Definition ZConfig.h:123
Pathname configPath() const
Path where the configfiles are kept (/etc/zypp).
Definition ZConfig.cc:1105
static Arch defaultSystemArchitecture()
The autodetected system architecture.
Definition ZConfig.cc:971
ZConfig()
Default ctor.
Definition ZConfig.cc:936
Pathname pubkeyCachePath() const
Path where the pubkey caches.
Definition ZConfig.cc:1048
long download_max_concurrent_connections() const
Maximum number of concurrent connections for a single transfer.
Definition ZConfig.cc:1191
void resetPkgGpgCheck()
Reset to the zconfig default.
Definition ZConfig.cc:1224
bool solver_onlyRequires() const
Solver regards required packages,patterns,... only.
Definition ZConfig.cc:1228
Pathname varsPath() const
Path containing custom repo variable definitions (configPath()/vars.d).
Definition ZConfig.cc:1141
bool solver_dupAllowNameChange() const
DUP tune: Whether to follow package renames upon DUP.
Definition ZConfig.cc:1231
bool repoLabelIsAlias() const
Whether to use repository alias or name in user messages (progress, exceptions, .....
Definition ZConfig.cc:1170
void clearMultiversionSpec()
Definition ZConfig.cc:1261
LocaleSet repoRefreshLocales() const
List of locales for which translated package descriptions should be downloaded.
Definition ZConfig.cc:1167
long download_max_download_speed() const
Maximum download speed (bytes per second)
Definition ZConfig.cc:1197
void setRepoMetadataPath(const Pathname &path_r)
Set a new path as the default repo cache path.
Definition ZConfig.cc:1064
bool solver_dupAllowDowngrade() const
DUP tune: Whether to allow version downgrades upon DUP.
Definition ZConfig.cc:1230
std::string multiversionKernels() const
Definition ZConfig.cc:1327
std::string distroverpkg() const
Package telling the "product version" on systems not using /etc/product.d/baseproduct.
Definition ZConfig.cc:1319
bool download_use_deltarpm_always() const
Whether to consider using a deltarpm even when rpm is local.
Definition ZConfig.cc:1179
void setRepoCachePath(const Pathname &path_r)
Set a new path as the default repo cache path.
Definition ZConfig.cc:1053
void setRepoGpgCheck(TriBool val_r)
Change the value.
Definition ZConfig.cc:1219
Pathname credentialsGlobalDir() const
Defaults to /etc/zypp/credentials.d.
Definition ZConfig.cc:1307
bool download_media_prefer_download() const
Hint which media to prefer when installing packages (download vs.
Definition ZConfig.cc:1182
Pathname credentialsGlobalFile() const
Defaults to /etc/zypp/credentials.cat.
Definition ZConfig.cc:1312
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:28
ResolverFocus
The resolver's general attitude.
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition String.h:30
DownloadMode
Supported commit download policies.
creates and provides information about known sources.