#include <ZConfig.h>
Classes | |
class | Impl |
ZConfig implementation. More... | |
Public Member Functions | |
std::ostream & | about (std::ostream &str) const |
Print some detail about the current libzypp version. | |
Pathname | systemRoot () const |
The target root directory. | |
Arch | systemArchitecture () const |
The system architecture zypp uses. | |
void | setSystemArchitecture (const Arch &arch_r) |
Override the zypp system architecture. | |
void | resetSystemArchitecture () |
Reset the zypp system architecture to the default. | |
Locale | textLocale () const |
The locale for translated texts zypp uses. | |
void | setTextLocale (const Locale &locale_r) |
Set the prefered locale for translated texts. | |
void | resetTextLocale () |
Reset the locale for translated texts to the default. | |
Pathname | repoCachePath () const |
Path where the caches are kept (/var/cache/zypp). | |
Pathname | repoMetadataPath () const |
Path where the repo metadata is downloaded and kept (repoCachePath()/raw). | |
Pathname | repoSolvfilesPath () const |
Path where the repo solv files are created and kept (repoCachePath()/solv). | |
Pathname | repoPackagesPath () const |
Path where the repo packages are downloaded and kept (repoCachePath()/packages). | |
Pathname | configPath () const |
Path where the configfiles are kept (/etc/zypp). | |
Pathname | knownReposPath () const |
Path where the known repositories .repo files are kept (configPath()/repos.d). | |
Pathname | knownServicesPath () const |
Path where the known services .service files are kept (configPath()/services.d). | |
bool | repo_add_probe () const |
Whether repository urls should be probed. | |
unsigned | repo_refresh_delay () const |
Amount of time in minutes that must pass before another refresh. | |
bool | repoLabelIsAlias () const |
Whether to use repository alias or name in user messages (progress, exceptions, . | |
void | repoLabelIsAlias (bool yesno_r) |
Whether to use repository alias or name in user messages (progress, exceptions, . | |
long | download_max_concurrent_connections () const |
Maximum number of concurrent connections for a single transfer. | |
long | download_min_download_speed () const |
Minimum download speed (bytes per second) until the connection is dropped. | |
long | download_max_download_speed () const |
Maximum download speed (bytes per second). | |
long | download_max_silent_tries () const |
Maximum silent tries. | |
long | download_transfer_timeout () const |
Maximum time in seconds that you allow a transfer operation to take. | |
bool | download_use_deltarpm () const |
Whether to consider using a deltarpm when downloading a package. | |
bool | download_use_deltarpm_always () const |
Whether to consider using a deltarpm even when rpm is local. | |
bool | download_media_prefer_download () const |
Hint which media to prefer when installing packages (download vs. | |
bool | download_media_prefer_volatile () const |
void | set_download_media_prefer_download (bool yesno_r) |
Set download_media_prefer_download to a specific value. | |
void | set_default_download_media_prefer_download () |
Set download_media_prefer_download to the configfiles default. | |
DownloadMode | commit_downloadMode () const |
Commit download policy to use as default. | |
Pathname | vendorPath () const |
Directory for equivalent vendor definitions (configPath()/vendors.d). | |
bool | solver_onlyRequires () const |
Solver regards required packages,patterns,. | |
Pathname | solver_checkSystemFile () const |
File in which dependencies described which has to be fulfilled for a running system. | |
bool | solver_allowVendorChange () const |
Whether vendor check is by default enabled. | |
unsigned | solver_upgradeTestcasesToKeep () const |
When committing a dist upgrade (e.g. | |
bool | solverUpgradeRemoveDroppedPackages () const |
Whether dist upgrade should remove a products dropped packages (true). | |
void | setSolverUpgradeRemoveDroppedPackages (bool val_r) |
Set solverUpgradeRemoveDroppedPackages to val_r. | |
void | resetSolverUpgradeRemoveDroppedPackages () |
Reset solverUpgradeRemoveDroppedPackages to the zypp.conf default. | |
Pathname | locksFile () const |
Path where zypp can find or create lock file (configPath()/locks). | |
bool | apply_locks_file () const |
Whether locks file should be read and applied after start (true). | |
Pathname | update_dataPath () const |
Path where the update items are kept (/var/adm). | |
Pathname | update_scriptsPath () const |
Path where the repo metadata is downloaded and kept (update_dataPath()/). | |
Pathname | update_messagesPath () const |
Path where the repo solv files are created and kept (update_dataPath()/solv). | |
Pathname | historyLogFile () const |
Path where ZYpp install history is logged. | |
Pathname | credentialsGlobalDir () const |
Defaults to /etc/zypp/credentials.d. | |
Pathname | credentialsGlobalFile () const |
Defaults to /etc/zypp/credentials.cat. | |
std::string | distroverpkg () const |
Package telling the "product version" on systems not using /etc/product.d/baseproduct. | |
~ZConfig () | |
Dtor. | |
Packages which can be installed in different versions at the same time. | |
This returns the config file values ( names or provides: .
..). For the corresponding packages use e.g sat::Pool::multiversionBegin, or sat::Solbale::multiversionInstall (ui::Selectable::multiversionInstall). | |
const std::set< std::string > & | multiversionSpec () const |
void | addMultiversionSpec (const std::string &name_r) |
void | removeMultiversionSpec (const std::string &name_r) |
Command to be invoked to send update messages. | |
std::string | updateMessagesNotify () const |
Command definition for sending update messages. | |
void | setUpdateMessagesNotify (const std::string &val_r) |
Set a new command definition (see update.messages.notify in zypp.conf). | |
void | resetUpdateMessagesNotify () |
Reset to the zypp.conf default. | |
Options for package installation | |
target::rpm::RpmInstFlags | rpmInstallFlags () const |
The default target::rpm::RpmInstFlags for ZYppCommitPolicy. | |
Plugins | |
Pathname | pluginsPath () const |
Defaults to /usr/lib/zypp/plugins . | |
Static Public Member Functions | |
static ZConfig & | instance () |
Singleton ctor. | |
static Arch | defaultSystemArchitecture () |
The autodetected system architecture. | |
static Locale | defaultTextLocale () |
The autodetected prefered locale for translated texts. | |
Private Member Functions | |
ZConfig () | |
Default ctor. | |
Private Attributes | |
RW_pointer< Impl, rw_pointer::Scoped< Impl > > | _pimpl |
Pointer to implementation. | |
Friends | |
class | Impl |
Use it to avoid hardcoded values and calls to getZYpp() just to retrieve some value like architecture, languages or tmppath.
It reads /etc/zypp/zypp.conf, the filename can be overridden by setting the ZYPP_CONF environment variable to a different file.
Note, if you add settings to this file, please follow the following convention:
namespace.settingname
should become
namespace_settingName()
Definition at line 57 of file ZConfig.h.
zypp::ZConfig::~ZConfig | ( | ) |
zypp::ZConfig::ZConfig | ( | ) | [private] |
ZConfig & zypp::ZConfig::instance | ( | ) | [static] |
Singleton ctor.
Definition at line 522 of file ZConfig.cc.
Referenced by zypp::sat::detail::PoolImpl::_postRepoAdd(), zypp::ZYpp::architecture(), zypp::Locale::bestMatch(), zypp::target::TargetImpl::buildCache(), zypp::RepoManager::checkIfToRefreshMetadata(), zypp::target::TargetImpl::commit(), zypp::solver::detail::Testcase::createTestcase(), zypp::ui::Selectable::Impl::defaultCandidate(), zypp::target::TargetImpl::defaultSolvfilesPath(), zypp::target::TargetImpl::distributionVersion(), zypp::target::rpm::RpmDb::doInstallPackage(), zypp::repo::PackageProvider::doProvidePackage(), zypp::repo::susetags::Downloader::download(), zypp::media::fillAriaCmdLine(), zypp::HistoryLog::fname(), zypp::ZYpp::getTextLocale(), zypp::ZConfig::Impl::Impl(), zypp::repo::RepoInfoBase::label(), zypp::target::TargetImpl::load(), zypp::sat::detail::PoolImpl::multiversionListInit(), zypp::repo::RepoVariablesStringReplacer::operator()(), zypp::RepoManagerOptions::pluginsPath(), zypp::sat::detail::PoolImpl::prepare(), zypp::RepoManagerOptions::RepoManagerOptions(), zypp::media::UrlResolverPlugin::resolveUrl(), zypp::ZYpp::setArchitecture(), zypp::HistoryLog::setRoot(), zypp::solver::detail::SATResolver::setSystemRequirements(), zypp::ZYpp::setTextLocale(), setTextLocale(), zypp::media::MediaCurl::setupEasy(), zypp::solver::detail::SATResolver::solverInit(), zypp::ui::Selectable::Impl::updateCandidateObj(), zypp::VendorAttr::VendorAttr(), zypp::target::writeUpgradeTestcase(), and zypp::zypp_detail::ZYppImpl::ZYppImpl().
std::ostream & zypp::ZConfig::about | ( | std::ostream & | str | ) | const |
Print some detail about the current libzypp version.
Definition at line 800 of file ZConfig.cc.
References _pimpl, defaultSystemArchitecture(), defaultTextLocale(), systemArchitecture(), and textLocale().
Referenced by ZConfig(), and zypp::zypp_detail::ZYppImpl::ZYppImpl().
Pathname zypp::ZConfig::systemRoot | ( | ) | const |
The target root directory.
Definition at line 547 of file ZConfig.cc.
Referenced by zypp::solver::detail::SATResolver::setSystemRequirements().
Arch zypp::ZConfig::defaultSystemArchitecture | ( | ) | [static] |
The autodetected system architecture.
Definition at line 559 of file ZConfig.cc.
Referenced by about(), and resetSystemArchitecture().
Arch zypp::ZConfig::systemArchitecture | ( | ) | const |
The system architecture zypp uses.
Definition at line 565 of file ZConfig.cc.
References _pimpl.
Referenced by about(), zypp::ZYpp::architecture(), zypp::repo::susetags::Downloader::download(), zypp::repo::RepoVariablesStringReplacer::operator()(), and zypp::sat::detail::PoolImpl::prepare().
void zypp::ZConfig::setSystemArchitecture | ( | const Arch & | arch_r | ) |
Override the zypp system architecture.
This is useful for test scenarious. But be warned, zypp does not expect the system architecture to change at runtime. So set it at the verry beginning before you acess any other zypp component.
Definition at line 568 of file ZConfig.cc.
Referenced by resetSystemArchitecture(), and zypp::ZYpp::setArchitecture().
void zypp::ZConfig::resetSystemArchitecture | ( | ) | [inline] |
Reset the zypp system architecture to the default.
Definition at line 89 of file ZConfig.h.
References defaultSystemArchitecture(), and setSystemArchitecture().
Locale zypp::ZConfig::defaultTextLocale | ( | ) | [static] |
The autodetected prefered locale for translated texts.
Definition at line 583 of file ZConfig.cc.
Referenced by about(), and resetTextLocale().
Locale zypp::ZConfig::textLocale | ( | ) | const |
The locale for translated texts zypp uses.
Definition at line 589 of file ZConfig.cc.
References _pimpl.
Referenced by about(), zypp::ZYpp::getTextLocale(), and zypp::sat::detail::PoolImpl::prepare().
void zypp::ZConfig::setTextLocale | ( | const Locale & | locale_r | ) |
Set the prefered locale for translated texts.
Definition at line 592 of file ZConfig.cc.
References _pimpl, instance(), setTextLocale(), and WAR.
Referenced by resetTextLocale(), zypp::ZYpp::setTextLocale(), and setTextLocale().
void zypp::ZConfig::resetTextLocale | ( | ) | [inline] |
Reset the locale for translated texts to the default.
Definition at line 105 of file ZConfig.h.
References defaultTextLocale(), and setTextLocale().
Pathname zypp::ZConfig::repoCachePath | ( | ) | const |
Path where the caches are kept (/var/cache/zypp).
Definition at line 605 of file ZConfig.cc.
References _pimpl.
Referenced by zypp::media::fillAriaCmdLine(), repoMetadataPath(), repoPackagesPath(), and repoSolvfilesPath().
Pathname zypp::ZConfig::repoMetadataPath | ( | ) | const |
Path where the repo metadata is downloaded and kept (repoCachePath()/raw).
Definition at line 611 of file ZConfig.cc.
References _pimpl, and repoCachePath().
Pathname zypp::ZConfig::repoSolvfilesPath | ( | ) | const |
Path where the repo solv files are created and kept (repoCachePath()/solv).
Definition at line 617 of file ZConfig.cc.
References _pimpl, and repoCachePath().
Pathname zypp::ZConfig::repoPackagesPath | ( | ) | const |
Path where the repo packages are downloaded and kept (repoCachePath()/packages).
Definition at line 623 of file ZConfig.cc.
References _pimpl, and repoCachePath().
Pathname zypp::ZConfig::configPath | ( | ) | const |
Path where the configfiles are kept (/etc/zypp).
Definition at line 631 of file ZConfig.cc.
References _pimpl.
Referenced by knownReposPath(), knownServicesPath(), locksFile(), solver_checkSystemFile(), and vendorPath().
Pathname zypp::ZConfig::knownReposPath | ( | ) | const |
Path where the known repositories .repo files are kept (configPath()/repos.d).
Definition at line 637 of file ZConfig.cc.
References _pimpl, and configPath().
Pathname zypp::ZConfig::knownServicesPath | ( | ) | const |
Path where the known services .service files are kept (configPath()/services.d).
Definition at line 643 of file ZConfig.cc.
References _pimpl, and configPath().
bool zypp::ZConfig::repo_add_probe | ( | ) | const |
Whether repository urls should be probed.
/ config option repo.add.probe
Definition at line 663 of file ZConfig.cc.
References _pimpl.
Referenced by zypp::RepoManagerOptions::RepoManagerOptions().
unsigned zypp::ZConfig::repo_refresh_delay | ( | ) | const |
Amount of time in minutes that must pass before another refresh.
Definition at line 668 of file ZConfig.cc.
References _pimpl.
Referenced by zypp::RepoManager::checkIfToRefreshMetadata().
bool zypp::ZConfig::repoLabelIsAlias | ( | ) | const |
Whether to use repository alias or name in user messages (progress, exceptions, .
..). True: use alias, false: use name.
Definition at line 673 of file ZConfig.cc.
References _pimpl.
void zypp::ZConfig::repoLabelIsAlias | ( | bool | yesno_r | ) |
Whether to use repository alias or name in user messages (progress, exceptions, .
..). Console applications might prefer to use and display the shorter alias instead of full repository name.
Default: false; i.e. repo label is 'name'
Definition at line 676 of file ZConfig.cc.
References _pimpl.
long zypp::ZConfig::download_max_concurrent_connections | ( | ) | const |
Maximum number of concurrent connections for a single transfer.
Definition at line 694 of file ZConfig.cc.
References _pimpl.
long zypp::ZConfig::download_min_download_speed | ( | ) | const |
Minimum download speed (bytes per second) until the connection is dropped.
Definition at line 697 of file ZConfig.cc.
References _pimpl.
long zypp::ZConfig::download_max_download_speed | ( | ) | const |
Maximum download speed (bytes per second).
Definition at line 700 of file ZConfig.cc.
References _pimpl.
long zypp::ZConfig::download_max_silent_tries | ( | ) | const |
long zypp::ZConfig::download_transfer_timeout | ( | ) | const |
Maximum time in seconds that you allow a transfer operation to take.
Definition at line 706 of file ZConfig.cc.
References _pimpl.
bool zypp::ZConfig::download_use_deltarpm | ( | ) | const |
Whether to consider using a deltarpm when downloading a package.
Config option download.use_deltarpm (true)
Definition at line 679 of file ZConfig.cc.
References _pimpl.
Referenced by zypp::repo::PackageProvider::doProvidePackage(), and download_use_deltarpm_always().
bool zypp::ZConfig::download_use_deltarpm_always | ( | ) | const |
Whether to consider using a deltarpm even when rpm is local.
This requires download_use_deltarpm being true
. Config option download.use_deltarpm.always (false)
Definition at line 682 of file ZConfig.cc.
References _pimpl, and download_use_deltarpm().
Referenced by zypp::repo::PackageProvider::doProvidePackage().
bool zypp::ZConfig::download_media_prefer_download | ( | ) | const |
Hint which media to prefer when installing packages (download vs.
CD).
Definition at line 685 of file ZConfig.cc.
References _pimpl.
Referenced by download_media_prefer_volatile().
bool zypp::ZConfig::download_media_prefer_volatile | ( | ) | const [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 223 of file ZConfig.h.
References download_media_prefer_download().
void zypp::ZConfig::set_download_media_prefer_download | ( | bool | yesno_r | ) |
Set download_media_prefer_download to a specific value.
Definition at line 688 of file ZConfig.cc.
References _pimpl.
void zypp::ZConfig::set_default_download_media_prefer_download | ( | ) |
Set download_media_prefer_download to the configfiles default.
Definition at line 691 of file ZConfig.cc.
References _pimpl.
DownloadMode zypp::ZConfig::commit_downloadMode | ( | ) | const |
Commit download policy to use as default.
Definition at line 709 of file ZConfig.cc.
References _pimpl.
Pathname zypp::ZConfig::vendorPath | ( | ) | const |
Directory for equivalent vendor definitions (configPath()/vendors.d).
Definition at line 649 of file ZConfig.cc.
References _pimpl, and configPath().
bool zypp::ZConfig::solver_onlyRequires | ( | ) | const |
Solver regards required packages,patterns,.
.. only
Definition at line 712 of file ZConfig.cc.
References _pimpl.
Pathname zypp::ZConfig::solver_checkSystemFile | ( | ) | const |
File in which dependencies described which has to be fulfilled for a running system.
Definition at line 718 of file ZConfig.cc.
References _pimpl, and configPath().
bool zypp::ZConfig::solver_allowVendorChange | ( | ) | const |
Whether vendor check is by default enabled.
Definition at line 715 of file ZConfig.cc.
References _pimpl.
unsigned zypp::ZConfig::solver_upgradeTestcasesToKeep | ( | ) | const |
When committing a dist upgrade (e.g.
zypper dup
) a solver testcase is written. It is needed in bugreports, in case something went wrong. This returns the number of testcases to keep on the system. Old cases will be deleted, as new ones are created. Use 0
to write no testcase at all.
Definition at line 722 of file ZConfig.cc.
References _pimpl.
bool zypp::ZConfig::solverUpgradeRemoveDroppedPackages | ( | ) | const |
Whether dist upgrade should remove a products dropped packages (true).
A new product may suggest a list of old and no longer supported packages (dropped packages). Performing a dist upgrade the solver may try to delete them, even if they do not cause any dependency problem.
Turning this option off, the solver will not try to remove those packages unless they actually do cause dependency trouble. At any time you may use zypper to detect orphaned packages, and do the cleanup manually. Or simply leave them installed as long as you don't need the disk space.
Definition at line 725 of file ZConfig.cc.
References _pimpl.
Referenced by zypp::solver::detail::SATResolver::solverInit().
void zypp::ZConfig::setSolverUpgradeRemoveDroppedPackages | ( | bool | val_r | ) |
Set solverUpgradeRemoveDroppedPackages to val_r.
Definition at line 726 of file ZConfig.cc.
References _pimpl.
void zypp::ZConfig::resetSolverUpgradeRemoveDroppedPackages | ( | ) |
Reset solverUpgradeRemoveDroppedPackages to the zypp.conf
default.
Definition at line 727 of file ZConfig.cc.
References _pimpl.
const std::set< std::string > & zypp::ZConfig::multiversionSpec | ( | ) | const |
void zypp::ZConfig::addMultiversionSpec | ( | const std::string & | name_r | ) |
void zypp::ZConfig::removeMultiversionSpec | ( | const std::string & | name_r | ) |
Pathname zypp::ZConfig::locksFile | ( | ) | const |
Path where zypp can find or create lock file (configPath()/locks).
Definition at line 655 of file ZConfig.cc.
References _pimpl, and configPath().
bool zypp::ZConfig::apply_locks_file | ( | ) | const |
Whether locks file should be read and applied after start (true).
Definition at line 733 of file ZConfig.cc.
References _pimpl.
Pathname zypp::ZConfig::update_dataPath | ( | ) | const |
Path where the update items are kept (/var/adm).
Definition at line 736 of file ZConfig.cc.
References _pimpl.
Referenced by update_messagesPath(), and update_scriptsPath().
Pathname zypp::ZConfig::update_scriptsPath | ( | ) | const |
Path where the repo metadata is downloaded and kept (update_dataPath()/).
Definition at line 748 of file ZConfig.cc.
References _pimpl, and update_dataPath().
Pathname zypp::ZConfig::update_messagesPath | ( | ) | const |
Path where the repo solv files are created and kept (update_dataPath()/solv).
Definition at line 742 of file ZConfig.cc.
References _pimpl, and update_dataPath().
std::string zypp::ZConfig::updateMessagesNotify | ( | ) | const |
Command definition for sending update messages.
Definition at line 754 of file ZConfig.cc.
References _pimpl.
void zypp::ZConfig::setUpdateMessagesNotify | ( | const std::string & | val_r | ) |
Set a new command definition (see update.messages.notify in zypp.conf).
Definition at line 757 of file ZConfig.cc.
References _pimpl.
void zypp::ZConfig::resetUpdateMessagesNotify | ( | ) |
target::rpm::RpmInstFlags zypp::ZConfig::rpmInstallFlags | ( | ) | const |
The default target::rpm::RpmInstFlags for ZYppCommitPolicy.
Or-combination of target::rpm::RpmInstFlag.
ZConfig.instance().rpmInstallFlags().testFlag( target::rpm::RPMINST_EXCLUDEDOCS );
Definition at line 765 of file ZConfig.cc.
References _pimpl.
Pathname zypp::ZConfig::historyLogFile | ( | ) | const |
Path where ZYpp install history is logged.
Defaults to /var/log/zypp/history.
Definition at line 769 of file ZConfig.cc.
References _pimpl.
Referenced by zypp::HistoryLog::fname(), and zypp::HistoryLog::setRoot().
Pathname zypp::ZConfig::credentialsGlobalDir | ( | ) | const |
Pathname zypp::ZConfig::credentialsGlobalFile | ( | ) | const |
Defaults to /etc/zypp/credentials.cat.
Definition at line 782 of file ZConfig.cc.
References _pimpl.
std::string zypp::ZConfig::distroverpkg | ( | ) | const |
Package telling the "product version" on systems not using /etc/product.d/baseproduct.
On RHEL, Fedora and others the "product version" is determined by the first package providing 'redhat-release'. This value is not hardcoded in YUM and can be configured with the $distroverpkg variable.
Defaults to 'redhat-release'.
Definition at line 790 of file ZConfig.cc.
Referenced by zypp::target::TargetImpl::distributionVersion().
Pathname zypp::ZConfig::pluginsPath | ( | ) | const |
Defaults to /usr/lib/zypp/plugins
.
Definition at line 795 of file ZConfig.cc.
References _pimpl, and zypp::RW_pointer< _D, _Traits >::get().
Referenced by zypp::media::UrlResolverPlugin::resolveUrl().
friend class Impl [friend] |
RW_pointer<Impl, rw_pointer::Scoped<Impl> > zypp::ZConfig::_pimpl [private] |
Pointer to implementation.
Definition at line 394 of file ZConfig.h.
Referenced by about(), addMultiversionSpec(), apply_locks_file(), commit_downloadMode(), configPath(), credentialsGlobalDir(), credentialsGlobalFile(), download_max_concurrent_connections(), download_max_download_speed(), download_max_silent_tries(), download_media_prefer_download(), download_min_download_speed(), download_transfer_timeout(), download_use_deltarpm(), download_use_deltarpm_always(), historyLogFile(), zypp::ZConfig::Impl::Impl(), knownReposPath(), knownServicesPath(), locksFile(), multiversionSpec(), pluginsPath(), removeMultiversionSpec(), repo_add_probe(), repo_refresh_delay(), repoCachePath(), repoLabelIsAlias(), repoMetadataPath(), repoPackagesPath(), repoSolvfilesPath(), resetSolverUpgradeRemoveDroppedPackages(), resetUpdateMessagesNotify(), rpmInstallFlags(), set_default_download_media_prefer_download(), set_download_media_prefer_download(), setSolverUpgradeRemoveDroppedPackages(), setSystemArchitecture(), setTextLocale(), setUpdateMessagesNotify(), solver_allowVendorChange(), solver_checkSystemFile(), solver_onlyRequires(), solver_upgradeTestcasesToKeep(), solverUpgradeRemoveDroppedPackages(), systemArchitecture(), textLocale(), update_dataPath(), update_messagesPath(), update_scriptsPath(), updateMessagesNotify(), and vendorPath().