libzypp  13.10.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/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 
28 #include "zypp/DownloadMode.h"
30 
32 namespace zypp
33 {
34 
36  //
37  // CLASS NAME : ZConfig
38  //
58  class ZConfig : private base::NonCopyable
59  {
60  public:
61 
63  static ZConfig & instance();
64 
66  std::ostream & about( std::ostream & str ) const;
67 
68  public:
69 
73  Pathname systemRoot() const;
74 
75  public:
76 
79 
81  Arch systemArchitecture() const;
82 
89  void setSystemArchitecture( const Arch & arch_r );
90 
94 
95  public:
98  static Locale defaultTextLocale();
99 
102  Locale textLocale() const;
103 
105  void setTextLocale( const Locale & locale_r );
106 
110 
111  public:
117  bool hasUserData() const;
118 
120  std::string userData() const;
121 
126  bool setUserData( const std::string & str_r );
128 
129  public:
134  Pathname repoCachePath() const;
135 
140  Pathname repoMetadataPath() const;
141 
146  Pathname repoSolvfilesPath() const;
147 
152  Pathname repoPackagesPath() const;
153 
158  Pathname configPath() const;
159 
164  Pathname knownReposPath() const;
165 
170  Pathname knownServicesPath() const;
171 
177  bool repo_add_probe() const;
178 
182  unsigned repo_refresh_delay() const;
183 
188 
194  bool repoLabelIsAlias() const;
195 
203  void repoLabelIsAlias( bool yesno_r );
204 
209 
214  long download_min_download_speed() const;
215 
219  long download_max_download_speed() const;
220 
224  long download_max_silent_tries() const;
225 
229  long download_transfer_timeout() const;
230 
231 
235  bool download_use_deltarpm() const;
236 
241  bool download_use_deltarpm_always() const;
242 
247  bool download_media_prefer_download() const;
250  { return ! download_media_prefer_download(); }
254  void set_download_media_prefer_download( bool yesno_r );
259 
264 
269  Pathname vendorPath() const;
270 
274  bool solver_onlyRequires() const;
275 
280  Pathname solver_checkSystemFile() const;
281 
285  bool solver_allowVendorChange() const;
286 
290  bool solver_cleandepsOnRemove() const;
291 
299  unsigned solver_upgradeTestcasesToKeep() const;
300 
316  void setSolverUpgradeRemoveDroppedPackages( bool val_r );
319 
326  const std::set<std::string> & multiversionSpec() const;
327  void multiversionSpec( std::set<std::string> new_r );
328  void clearMultiversionSpec();
329  void addMultiversionSpec( const std::string & name_r );
330  void removeMultiversionSpec( const std::string & name_r );
332 
337  Pathname locksFile() const;
338 
342  bool apply_locks_file() const;
343 
347  Pathname update_dataPath() const;
348 
353  Pathname update_scriptsPath() const;
354 
359  Pathname update_messagesPath() const;
360 
364  std::string updateMessagesNotify() const;
366  void setUpdateMessagesNotify( const std::string & val_r );
370 
379  target::rpm::RpmInstFlags rpmInstallFlags() const;
381 
388  Pathname historyLogFile() const;
389 
393  Pathname credentialsGlobalDir() const;
394 
398  Pathname credentialsGlobalFile() const;
399 
408  std::string distroverpkg() const;
409 
415  Pathname pluginsPath() const;
416 
418  public:
419  class Impl;
421  ~ZConfig();
422  private:
423  friend class Impl;
425  ZConfig();
428  };
430 
432 } // namespace zypp
434 #endif // ZYPP_ZCONFIG_H
~ZConfig()
Dtor.
Definition: ZConfig.cc:677
static Locale defaultTextLocale()
The autodetected prefered locale for translated texts.
Definition: ZConfig.cc:716
void setUpdateMessagesNotify(const std::string &val_r)
Set a new command definition (see update.messages.notify in zypp.conf).
Definition: ZConfig.cc:919
void resetSystemArchitecture()
Reset the zypp system architecture to the default.
Definition: ZConfig.h:92
static ZConfig & instance()
Singleton ctor.
Definition: ZConfig.cc:655
std::ostream & about(std::ostream &str) const
Print some detail about the current libzypp version.
Definition: ZConfig.cc:961
std::string distroverpkg() const
Package telling the &quot;product version&quot; on systems not using /etc/product.d/baseproduct.
Definition: ZConfig.cc:951
unsigned solver_upgradeTestcasesToKeep() const
When committing a dist upgrade (e.g.
Definition: ZConfig.cc:882
Architecture.
Definition: Arch.h:36
Pathname knownServicesPath() const
Path where the known services .service files are kept (configPath()/services.d).
Definition: ZConfig.cc:801
Pathname vendorPath() const
Directory for equivalent vendor definitions (configPath()/vendors.d)
Definition: ZConfig.cc:807
Pathname repoCachePath() const
Path where the caches are kept (/var/cache/zypp)
Definition: ZConfig.cc:763
Pathname credentialsGlobalFile() const
Defaults to /etc/zypp/credentials.cat.
Definition: ZConfig.cc:943
void removeMultiversionSpec(const std::string &name_r)
Definition: ZConfig.cc:893
void setSystemArchitecture(const Arch &arch_r)
Override the zypp system architecture.
Definition: ZConfig.cc:701
bool apply_locks_file() const
Whether locks file should be read and applied after start (true)
Definition: ZConfig.cc:895
long download_max_download_speed() const
Maximum download speed (bytes per second)
Definition: ZConfig.cc:857
bool setUserData(const std::string &str_r)
Set a new userData string.
Definition: ZConfig.cc:746
bool solver_cleandepsOnRemove() const
Whether removing a package should also remove no longer needed requirements.
Definition: ZConfig.cc:875
bool repo_add_probe() const
Whether repository urls should be probed.
Definition: ZConfig.cc:821
void resetSolverUpgradeRemoveDroppedPackages()
Reset solverUpgradeRemoveDroppedPackages to the zypp.conf default.
Definition: ZConfig.cc:887
Pathname pluginsPath() const
Defaults to /usr/lib/zypp/plugins.
Definition: ZConfig.cc:956
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
Pointer to implementation.
Definition: ZConfig.h:427
bool solverUpgradeRemoveDroppedPackages() const
Whether dist upgrade should remove a products dropped packages (true).
Definition: ZConfig.cc:885
DownloadMode commit_downloadMode() const
Commit download policy to use as default.
Definition: ZConfig.cc:866
void addMultiversionSpec(const std::string &name_r)
Definition: ZConfig.cc:892
void set_download_media_prefer_download(bool yesno_r)
Set download_media_prefer_download to a specific value.
Definition: ZConfig.cc:845
Pathname configPath() const
Path where the configfiles are kept (/etc/zypp).
Definition: ZConfig.cc:789
Pathname historyLogFile() const
Path where ZYpp install history is logged.
Definition: ZConfig.cc:931
void setTextLocale(const Locale &locale_r)
Set the prefered locale for translated texts.
Definition: ZConfig.cc:725
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
Pathname knownReposPath() const
Path where the known repositories .repo files are kept (configPath()/repos.d).
Definition: ZConfig.cc:795
LocaleSet repoRefreshLocales() const
List of locales for which translated package descriptions should be downloaded.
Definition: ZConfig.cc:827
void set_default_download_media_prefer_download()
Set download_media_prefer_download to the configfiles default.
Definition: ZConfig.cc:848
ZConfig implementation.
Definition: ZConfig.cc:288
Provides API related macros.
Interim helper class to collect global options and settings.
Definition: ZConfig.h:58
friend class Impl
Definition: ZConfig.h:423
Pathname update_scriptsPath() const
Path where the repo metadata is downloaded and kept (update_dataPath()/).
Definition: ZConfig.cc:910
Pathname locksFile() const
Path where zypp can find or create lock file (configPath()/locks)
Definition: ZConfig.cc:813
std::tr1::unordered_set< Locale > LocaleSet
Definition: Locale.h:28
long download_min_download_speed() const
Minimum download speed (bytes per second) until the connection is dropped.
Definition: ZConfig.cc:854
void clearMultiversionSpec()
Definition: ZConfig.cc:891
bool hasUserData() const
Whether a (non empty) user data sting is defined.
Definition: ZConfig.cc:740
Pathname update_messagesPath() const
Path where the repo solv files are created and kept (update_dataPath()/solv).
Definition: ZConfig.cc:904
Pathname repoSolvfilesPath() const
Path where the repo solv files are created and kept (repoCachePath()/solv).
Definition: ZConfig.cc:775
Pathname repoPackagesPath() const
Path where the repo packages are downloaded and kept (repoCachePath()/packages).
Definition: ZConfig.cc:781
bool download_use_deltarpm() const
Whether to consider using a deltarpm when downloading a package.
Definition: ZConfig.cc:836
Pathname repoMetadataPath() const
Path where the repo metadata is downloaded and kept (repoCachePath()/raw).
Definition: ZConfig.cc:769
long download_max_silent_tries() const
Maximum silent tries.
Definition: ZConfig.cc:860
bool solver_allowVendorChange() const
Whether vendor check is by default enabled.
Definition: ZConfig.cc:872
bool solver_onlyRequires() const
Solver regards required packages,patterns,...
Definition: ZConfig.cc:869
static Arch defaultSystemArchitecture()
The autodetected system architecture.
Definition: ZConfig.cc:692
Pathname systemRoot() const
The target root directory.
Definition: ZConfig.cc:680
bool download_media_prefer_download() const
Hint which media to prefer when installing packages (download vs.
Definition: ZConfig.cc:842
const std::set< std::string > & multiversionSpec() const
Definition: ZConfig.cc:889
target::rpm::RpmInstFlags rpmInstallFlags() const
The default target::rpm::RpmInstFlags for ZYppCommitPolicy.
Definition: ZConfig.cc:927
ZConfig()
Default ctor.
Definition: ZConfig.cc:666
Wrapper for const correct access via Smart pointer types.
Definition: PtrTypes.h:265
Pathname update_dataPath() const
Path where the update items are kept (/var/adm)
Definition: ZConfig.cc:898
std::string userData() const
User defined string value to be passed to log, history, plugins...
Definition: ZConfig.cc:743
void resetTextLocale()
Reset the locale for translated texts to the default.
Definition: ZConfig.h:108
void resetUpdateMessagesNotify()
Reset to the zypp.conf default.
Definition: ZConfig.cc:922
void setSolverUpgradeRemoveDroppedPackages(bool val_r)
Set solverUpgradeRemoveDroppedPackages to val_r.
Definition: ZConfig.cc:886
Locale textLocale() const
The locale for translated texts zypp uses.
Definition: ZConfig.cc:722
std::string updateMessagesNotify() const
Command definition for sending update messages.
Definition: ZConfig.cc:916
unsigned repo_refresh_delay() const
Amount of time in minutes that must pass before another refresh.
Definition: ZConfig.cc:824
Arch systemArchitecture() const
The system architecture zypp uses.
Definition: ZConfig.cc:698
bool repoLabelIsAlias() const
Whether to use repository alias or name in user messages (progress, exceptions, ...).
Definition: ZConfig.cc:830
long download_max_concurrent_connections() const
Maximum number of concurrent connections for a single transfer.
Definition: ZConfig.cc:851
Pathname solver_checkSystemFile() const
File in which dependencies described which has to be fulfilled for a running system.
Definition: ZConfig.cc:878
bool download_use_deltarpm_always() const
Whether to consider using a deltarpm even when rpm is local.
Definition: ZConfig.cc:839
long download_transfer_timeout() const
Maximum time in seconds that you allow a transfer operation to take.
Definition: ZConfig.cc:863
Pathname credentialsGlobalDir() const
Defaults to /etc/zypp/credentials.d.
Definition: ZConfig.cc:937
DownloadMode
Supported commit download policies.
Definition: DownloadMode.h:22
bool download_media_prefer_volatile() const
Definition: ZConfig.h:249