libzypp: zypp/ZConfig.h Source File

libzypp 17.38.6

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>
20#include <zypp-core/base/NonCopyable.h>
21#include <zypp-core/base/PtrTypes.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>
30#include <zypp/target/rpm/RpmFlags.h>
31
32namespace zyppng {
33 // just for the friend declaration
34 class RepoManager;
35}
36
38namespace zypp
39{
40
41 class RepoManager;
42
81 class ZYPP_API ZConfig : private base::NonCopyable
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
136 void resetSystemArchitecture()
137 { setSystemArchitecture( defaultSystemArchitecture() ); }
138
139 public:
142 static Locale defaultTextLocale();
143
146 Locale textLocale() const;
147
149 void setTextLocale( const Locale & locale_r );
150
152 void resetTextLocale()
153 { setTextLocale( defaultTextLocale() ); }
154
155 public:
160
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
331 long download_max_download_speed() const;
332
336 long download_max_silent_tries() const;
337
341 long download_transfer_timeout() const;
342
343
347 bool download_use_deltarpm() const;
348
353 bool download_use_deltarpm_always() const;
354
359 bool download_media_prefer_download() const;
361 bool download_media_prefer_volatile() const
362 { return ! download_media_prefer_download(); }
363
366 void set_download_media_prefer_download( bool yesno_r );
370 void set_default_download_media_prefer_download();
371
376 Pathname download_mediaMountdir() const;
378 void set_download_mediaMountdir( Pathname newval_r );
380 void set_default_download_mediaMountdir();
381
385 DownloadMode commit_downloadMode() const;
386
400 bool gpgCheck() const;
401 TriBool repoGpgCheck() const;
402 TriBool pkgGpgCheck() const;
403
404 void setGpgCheck( bool val_r );
405 void setRepoGpgCheck( TriBool val_r );
406 void setPkgGpgCheck( TriBool val_r );
407
408 void resetGpgCheck();
409 void resetRepoGpgCheck();
410 void resetPkgGpgCheck();
412 //
417 Pathname vendorPath() const;
418
422 ResolverFocus solver_focus() const;
423
427 bool solver_onlyRequires() const;
428
433 Pathname solver_checkSystemFile() const;
434
440 Pathname solver_checkSystemFileDir() const;
441
445 bool solver_allowVendorChange() const;
446
448 bool solver_dupAllowDowngrade() const;
449
451 bool solver_dupAllowNameChange() const;
452
454 bool solver_dupAllowArchChange() const;
455
457 bool solver_dupAllowVendorChange() const;
458
462 bool solver_cleandepsOnRemove() const;
463
471 unsigned solver_upgradeTestcasesToKeep() const;
472
486 bool solverUpgradeRemoveDroppedPackages() const;
488 void setSolverUpgradeRemoveDroppedPackages( bool val_r );
490 void resetSolverUpgradeRemoveDroppedPackages();
491
502 const std::set<std::string> & multiversionSpec() const;
503 void multiversionSpec( std::set<std::string> new_r );
504 void clearMultiversionSpec();
505 void addMultiversionSpec( const std::string & name_r );
506 void removeMultiversionSpec( const std::string & name_r );
508
513 Pathname locksFile() const;
514
518 bool apply_locks_file() const;
519
520#if LEGACY(1735)
524 Pathname update_dataPath() const;
525
529 Pathname update_scriptsPath() const;
530
534 Pathname update_messagesPath() const;
535#else
539 static Pathname update_dataPath();
540
544 static Pathname update_scriptsPath();
545
549 static Pathname update_messagesPath();
550#endif
551
554
555 std::string updateMessagesNotify() const;
557 void setUpdateMessagesNotify( const std::string & val_r );
559 void resetUpdateMessagesNotify();
561
564
570 target::rpm::RpmInstFlags rpmInstallFlags() const;
572
579 Pathname historyLogFile() const;
580
584 Pathname credentialsGlobalDir() const;
585
589 Pathname credentialsGlobalFile() const;
590
599 std::string distroverpkg() const;
600
603
606 Pathname pluginsPath() const;
607
611 std::string multiversionKernels() const;
612
614
615 public:
616 class Impl;
617
618 ZConfig(const ZConfig &) = delete;
619 ZConfig(ZConfig &&) = delete;
620 ZConfig &operator=(const ZConfig &) = delete;
621 ZConfig &operator=(ZConfig &&) = delete;
622
624 ~ZConfig();
625 void notifyTargetChanged();
626
627 private:
628 friend class RepoManager;
629 friend class zyppng::RepoManager;
631 Pathname builtinRepoCachePath() const;
633 Pathname builtinRepoMetadataPath() const;
635 Pathname builtinRepoSolvfilesPath() const;
637 Pathname builtinRepoPackagesPath() const;
638
639 private:
640 friend class Impl;
642 ZConfig();
644 RW_pointer<Impl, rw_pointer::Scoped<Impl> > _pimpl;
645 };
646
647
649} // namespace zypp
651#endif // ZYPP_ZCONFIG_H
Arch.h
DownloadMode.h
Globals.h
Provides API related macros.
IdString.h
Locale.h
NonCopyable.h
Pathname.h
PtrTypes.h
ResolverFocus.h
RpmFlags.h
TriBool.h
Impl
zypp::Arch
Architecture.
Definition Arch.h:37
zypp::Locale
'Language[_Country]' codes.
Definition Locale.h:51
zypp::RepoManager
creates and provides information about known sources.
Definition RepoManager.h:60
zypp::ZConfig::Impl
ZConfig implementation.
Definition ZConfig.cc:234
zypp::ZConfig::systemArchitecture
Arch systemArchitecture() const
The system architecture zypp uses.
Definition ZConfig.cc:819
zypp::ZConfig::ZConfig
ZConfig(const ZConfig &)=delete
zypp::ZConfig::builtinRepoSolvfilesPath
Pathname builtinRepoSolvfilesPath() const
The builtin config file value.
Definition ZConfig.cc:939
zypp::ZConfig::repoManagerRoot
Pathname repoManagerRoot() const
The RepoManager root directory.
Definition ZConfig.cc:796
zypp::ZConfig::resetSystemArchitecture
void resetSystemArchitecture()
Reset the zypp system architecture to the default.
Definition ZConfig.h:136
zypp::ZConfig::setRepoManagerRoot
void setRepoManagerRoot(const Pathname &root)
Sets the RepoManager root directory.
Definition ZConfig.cc:802
zypp::ZConfig::setTextLocale
void setTextLocale(const Locale &locale_r)
Set the preferred locale for translated texts.
Definition ZConfig.cc:846
zypp::ZConfig::notifyTargetChanged
void notifyTargetChanged()
internal
Definition ZConfig.cc:790
zypp::ZConfig::defaultTextLocale
static Locale defaultTextLocale()
The autodetected preferred locale for translated texts.
Definition ZConfig.cc:837
zypp::ZConfig::systemRoot
Pathname systemRoot() const
The target root directory.
Definition ZConfig.cc:793
zypp::ZConfig::operator=
ZConfig & operator=(ZConfig &&)=delete
zypp::ZConfig::ZConfig
ZConfig(ZConfig &&)=delete
zypp::ZConfig::_pimpl
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
Pointer to implementation.
Definition ZConfig.h:644
zypp::ZConfig::setSystemArchitecture
void setSystemArchitecture(const Arch &arch_r)
Override the zypp system architecture.
Definition ZConfig.cc:822
zypp::ZConfig::instance
static ZConfig & instance()
Singleton ctor.
Definition ZConfig.cc:756
zypp::ZConfig::about
std::ostream & about(std::ostream &str) const
Print some detail about the current libzypp version.
Definition ZConfig.cc:1183
zypp::ZConfig::builtinRepoCachePath
Pathname builtinRepoCachePath() const
The builtin config file value.
Definition ZConfig.cc:933
zypp::ZConfig::builtinRepoPackagesPath
Pathname builtinRepoPackagesPath() const
The builtin config file value.
Definition ZConfig.cc:942
zypp::ZConfig::builtinRepoMetadataPath
Pathname builtinRepoMetadataPath() const
The builtin config file value.
Definition ZConfig.cc:936
zypp::ZConfig::lockTimeout
long lockTimeout() const
The number of seconds to wait for the zypp lock to become available.
Definition ZConfig.cc:781
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:361
zypp::ZConfig::operator=
ZConfig & operator=(const ZConfig &)=delete
zypp::ZConfig::RepoManager
friend class RepoManager
Definition ZConfig.h:628
zypp::ZConfig::resetTextLocale
void resetTextLocale()
Reset the locale for translated texts to the default.
Definition ZConfig.h:152
zypp::ZConfig::defaultSystemArchitecture
static Arch defaultSystemArchitecture()
The autodetected system architecture.
Definition ZConfig.cc:814
zypp::ZConfig::announceSystemRoot
void announceSystemRoot(const Pathname &root_r)
Announce a target root directory without launching the Target.
Definition ZConfig.cc:805
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:1024
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:48
zyppng::RepoManager
The RepoManager class Provides knowledge and methods to maintain repo settings and metadata for a giv...
Definition repomanager.h:241
zypp::TriBool
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition String.h:31
str
String related utilities and Regular expression matching.
zypp::base::NonCopyable
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition NonCopyable.h:26
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::LocaleSet
std::unordered_set< Locale > LocaleSet
Definition Locale.h:29
zypp::ResolverFocus
ResolverFocus
The resolver's general attitude.
Definition ResolverFocus.h:24
zypp::ZYPP_API
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Definition Arch.h:173
zypp::DownloadMode
DownloadMode
Supported commit download policies.
Definition DownloadMode.h:25
zyppng
Definition MediaNetworkRequestExecutor.h:16
zypp::RW_pointer
Wrapper for const correct access via Smart pointer types.
Definition PtrTypes.h:293