15#include <zypp-core/base/String.h>
16#include <zypp-core/base/StringV.h>
20#include <zypp-core/base/LogControl.h>
21#include <zypp-core/TriBool.h>
22#include <zypp/PathInfo.h>
34#ifdef SINGLE_RPMTRANS_AS_DEFAULT_FOR_ZYPPER
35 static bool singleTrans =
ImZYPPER();
37 static bool singleTrans =
ImZYPPER() && ([]()->
bool{
38 const char *val = ::getenv(
"ZYPP_SINGLE_RPMTRANS");
39 bool ret = ( val && std::string_view( val ) ==
"1" );
40#ifdef NO_SINGLETRANS_USERMERGE
45 WAR <<
"Ignore $ZYPP_SINGLE_RPMTRANS=1: Bug 1189788 - UsrMerge: filesystem package breaks system when upgraded in a single rpm transaction" << std::endl;
47 "[boo#1189788] Tumbleweeds filesystem package seems to be unable to perform the\n"
48 " UsrMerge reliably in a single transaction. The requested\n"
49 " $ZYPP_SINGLE_RPMTRANS=1 will therefore be IGNORED because\n"
50 " the UsrMerge did not yet happen on this system."
57 "[TechPreview] $ZYPP_SINGLE_RPMTRANS=1 : New rpm install backend is enabled\n"
58 " If you find any bugs or issues please let us know:\n"
59 " https://bugzilla.opensuse.org/\n"
60 " Component: libzypp (or zypper)\n"
61 " And please attach the /var/log/zypper.log to the bug report."
95 friend Impl * rwcowClone<Impl>(
const Impl * rhs );
112 {
_pimpl->_restrictToMedia = ( mediaNr_r == 1 ) ? 1 : 0;
return *
this; }
115 {
return _pimpl->_restrictToMedia; }
127 DBG << val_r <<
" is not compatible with singleTransMode, falling back to " <<
DownloadInAdvance << std::endl;
130 _pimpl->_downloadMode = val_r;
return *
this;
136 DBG <<
_pimpl->_downloadMode <<
" is not compatible with singleTransMode, falling back to " <<
DownloadInAdvance << std::endl;
139 return _pimpl->_downloadMode;
143 {
_pimpl->_rpmInstFlags = newFlags_r;
return *
this; }
152 {
return _pimpl->_rpmInstFlags; }
173 {
_pimpl->_syncPoolAfterCommit = yesNo_r;
return *
this; }
176 {
return _pimpl->_syncPoolAfterCommit; }
179 {
return _pimpl->_singleTransMode; }
183 str <<
"CommitPolicy(";
190 str <<
" syncPoolAfterCommit";
Interim helper class to collect global options and settings.
Impl * clone() const
clone for RWCOW_pointer
bool _syncPoolAfterCommit
DownloadMode _downloadMode
target::rpm::RpmInstFlags _rpmInstFlags
unsigned _restrictToMedia
Options and policies for ZYpp::commit.
bool allowDowngrade() const
ZYppCommitPolicy & rpmInstFlags(target::rpm::RpmInstFlags newFlags_r)
The default target::rpm::RpmInstFlags.
bool singleTransModeEnabled() const
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
Typesafe passing of user data via callbacks.
Wrapper class for stat/lstat.
String related utilities and Regular expression matching.
int readlink(const Pathname &symlink_r, Pathname &target_r)
Like 'readlink'.
std::string hexstring(char n, int w=4)
Easy-to use interface to the ZYPP dependency resolver.
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
DownloadMode
Supported commit download policies.
@ DownloadAsNeeded
Alternating download and install.
@ DownloadInAdvance
First download all packages to the local cache.
static bool info(const std::string &msg_r, const UserData &userData_r=UserData())
send message text