19#include <zypp-core/APIConfig.h>
34#if APIConfig(LIBZYPP_CONFIG_USE_CLASSIC_RPMTRANS_BY_DEFAULT)
36 inline bool ImZYPPER()
41 inline bool singleTransInEnv()
43 const char *val = ::getenv(
"ZYPP_SINGLE_RPMTRANS");
47 {
return ImZYPPER() && singleTransInEnv(); }
54 inline bool singleTransInEnv()
56 const char *val = ::getenv(
"ZYPP_SINGLE_RPMTRANS");
60 {
return singleTransInEnv(); }
79 for (
const auto & pi : q.
poolItem() ) {
80 if ( pi.status().isToBeInstalled() )
90 const char *val = ::getenv(
"ZYPP_NO_USRMERGE_PROTECT");
148 {
_pimpl->_restrictToMedia = ( mediaNr_r == 1 ) ? 1 : 0;
return *
this; }
151 {
return _pimpl->_restrictToMedia; }
161 {
_pimpl->_downloadMode = val_r;
return *
this; }
164 {
return _pimpl->_downloadMode; }
167 {
_pimpl->_rpmInstFlags = newFlags_r;
return *
this; }
176 {
return _pimpl->_rpmInstFlags; }
197 {
_pimpl->_syncPoolAfterCommit = yesNo_r;
return *
this; }
200 {
return _pimpl->_syncPoolAfterCommit; }
204 if (
_pimpl->_singleTransMode ) {
209 MIL <<
"DownloadAsNeeded enforces the classic_rpmtrans backend!" << std::endl;
214 WAR <<
"Ignore $ZYPP_SINGLE_RPMTRANS=1: Bug 1189788 - UsrMerge: filesystem package breaks system when upgraded in a single rpm transaction" << std::endl;
215 if (
_pimpl->_notifyBSC1189788 ) {
216 _pimpl->_notifyBSC1189788 =
false;
218 "[bsc#1189788] The filesystem package seems to be unable to perform the pending\n"
219 " UsrMerge reliably in a single transaction. The single_rpmtrans\n"
220 " backend will therefore be IGNORED and the transaction is performed\n"
221 " by the classic_rpmtrans backend."
227 return _pimpl->_singleTransMode;
232 str <<
"CommitPolicy(";
239 str <<
" syncPoolAfterCommit";
Interim helper class to collect global options and settings.
Impl * clone() const
clone for RWCOW_pointer
friend Impl * rwcowClone(const Impl *rhs)
bool _syncPoolAfterCommit
DownloadMode _downloadMode
target::rpm::RpmInstFlags _rpmInstFlags
unsigned _restrictToMedia
bool allowDowngrade() const
ZYppCommitPolicy & rpmInstFlags(target::rpm::RpmInstFlags newFlags_r)
The default target::rpm::RpmInstFlags.
bool singleTransModeEnabled() const
Whether the single_rpmtrans backend is enabled (or the classic_rpmtrans)
ZYppCommitPolicy & syncPoolAfterCommit(bool yesNo_r)
Kepp pool in sync with the Target databases after commit (default: true)
ZYppCommitPolicy & dryRun(bool yesNo_r)
Set dry run (default: false).
ZYppCommitPolicy & restrictToMedia(unsigned mediaNr_r)
Restrict commit to media 1.
DownloadMode downloadMode() const
bool rpmNoSignature() const
target::rpm::RpmInstFlags rpmInstFlags() const
ZYppCommitPolicy & downloadMode(DownloadMode val_r)
Commit download policy to use.
unsigned restrictToMedia() const
bool rpmExcludeDocs() const
bool syncPoolAfterCommit() const
RWCOW_pointer< Impl > _pimpl
Pointer to data.
bool replaceFiles() const
ZYpp::Ptr getZYpp()
Convenience to get the Pointer to the ZYpp instance.
Wrapper class for stat/lstat.
Iterable< PoolItem_iterator > poolItem() const
Container of Solvable providing a Capability (read only).
String related utilities and Regular expression matching.
int readlink(const Pathname &symlink_r, Pathname &target_r)
Like 'readlink'.
bool strToTrue(const C_Str &str)
Parsing boolean from string.
std::string hexstring(char n, int w=4)
bool strToFalse(const C_Str &str)
Return false if str is 0, false, no, off, never.
Easy-to use interface to the ZYPP dependency resolver.
bool isPreUsrmerge(const Pathname &root_r)
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
bool singleTransEnabled()
bool transactionWillUsrmerge()
DownloadMode
Supported commit download policies.
callback::UserData UserData
typsafe map of userdata
static bool info(const std::string &msg_r, const UserData &userData_r=UserData())
send message text