RpmPostTransCollector implementation.
More...
|
struct | Dumpfile |
| Data regarding the dumpfile used if rpm --runposttrans is supported. More...
|
|
|
using | ScriptList = std::list< std::pair< std::string, std::string > > |
| <posttrans script basename, pkgname> pairs.
|
|
|
std::ostream & | operator<< (std::ostream &str, const Impl &obj) |
|
std::ostream & | dumpOn (std::ostream &str, const Impl &obj) |
|
◆ ScriptList
◆ Impl()
zypp::target::RpmPostTransCollector::Impl::Impl |
( |
const Pathname & |
root_r | ) |
|
|
inline |
◆ ~Impl()
zypp::target::RpmPostTransCollector::Impl::~Impl |
( |
| ) |
|
|
inline |
◆ hasPosttransScript()
bool zypp::target::RpmPostTransCollector::Impl::hasPosttransScript |
( |
const Pathname & |
rpmPackage_r | ) |
|
|
inline |
◆ collectPosttransInfo() [1/2]
void zypp::target::RpmPostTransCollector::Impl::collectPosttransInfo |
( |
const Pathname & |
rpmPackage_r, |
|
|
const std::vector< std::string > & |
runposttrans_r |
|
) |
| |
|
inline |
◆ collectPosttransInfo() [2/2]
void zypp::target::RpmPostTransCollector::Impl::collectPosttransInfo |
( |
const std::vector< std::string > & |
runposttrans_r | ) |
|
|
inline |
◆ collectScriptFromHeader()
◆ collectScriptForPackage()
void zypp::target::RpmPostTransCollector::Impl::collectScriptForPackage |
( |
const Pathname & |
rpmPackage_r | ) |
|
|
inline |
◆ collectDumpPosttransLines()
bool zypp::target::RpmPostTransCollector::Impl::collectDumpPosttransLines |
( |
const std::vector< std::string > & |
runposttrans_r | ) |
|
|
inline |
Return whether runposttrans lines were collected.
If runposttrans is supported, rpm issues at least one 'dump_posttrans: enabled' line with every install/remove. If no line is issued, rpm does not support –runposttrans. Interesting for executeScripts is whether the final call to rpm supported it.
Definition at line 113 of file RpmPostTransCollector.cc.
◆ executeScripts()
void zypp::target::RpmPostTransCollector::Impl::executeScripts |
( |
rpm::RpmDb & |
rpm_r | ) |
|
|
inline |
Execute the remembered scripts.
Crucial is the mixed case, where scripts and dumpfile are present at the end. If rpm was updated in the transaction to a version supporting –runposttrans, run scripts and then the dumpfile. If rpm was downgraded in the transaction to a version no longer supporting –runposttrans, we need to extract missing posttrans scripts from the dumpfile and execute them before the collected scripts.
Definition at line 148 of file RpmPostTransCollector.cc.
◆ discardScripts()
void zypp::target::RpmPostTransCollector::Impl::discardScripts |
( |
| ) |
|
|
inline |
Discard all remembered scrips.
As we are just logging the omitted actions, we don't pay further attention to the mixed case, where scripts and dumpfile are present (see executeScripts).
Definition at line 300 of file RpmPostTransCollector.cc.
◆ tmpDir()
Pathname zypp::target::RpmPostTransCollector::Impl::tmpDir |
( |
| ) |
|
|
inlineprivate |
◆ headerHasPosttrans()
◆ getHeaderIfPosttrans()
Cache RpmHeader for consecutive hasPosttransScript / collectScriptForPackage calls.
- Returns
- RpmHeader::constPtr IFF rpmPackage_r has a posttrans
Definition at line 353 of file RpmPostTransCollector.cc.
◆ recallFromDumpfile()
void zypp::target::RpmPostTransCollector::Impl::recallFromDumpfile |
( |
const Pathname & |
dumpfile_r, |
|
|
std::function< void(std::string, std::string, std::string, std::string)> |
consume_r |
|
) |
| |
|
inlineprivate |
Retrieve "dump_posttrans: install" lines from dumpfile_r and pass n,v,r,a to the consumer_r.
Definition at line 370 of file RpmPostTransCollector.cc.
◆ operator<< [1/2]
std::ostream & operator<< |
( |
std::ostream & |
str, |
|
|
const Impl & |
obj |
|
) |
| |
|
friend |
◆ dumpOn [1/2]
std::ostream & dumpOn |
( |
std::ostream & |
str, |
|
|
const Impl & |
obj |
|
) |
| |
|
friend |
◆ operator<<() [2/2]
◆ dumpOn() [2/2]
◆ _root
Pathname zypp::target::RpmPostTransCollector::Impl::_root |
|
private |
◆ _scripts
std::optional<ScriptList> zypp::target::RpmPostTransCollector::Impl::_scripts |
|
private |
◆ _dumpfile
std::optional<Dumpfile> zypp::target::RpmPostTransCollector::Impl::_dumpfile |
|
private |
◆ _ptrTmpdir
boost::scoped_ptr<filesystem::TmpDir> zypp::target::RpmPostTransCollector::Impl::_ptrTmpdir |
|
private |
◆ _myJobReport
◆ _headercache
The documentation for this class was generated from the following file: