libzypp: zypp::target::RpmPostTransCollector Class Reference

libzypp 17.38.15

zypp::target::RpmPostTransCollector Class Reference

Extract and remember posttrans scripts for later execution. More...

`#include <zypp/target/RpmPostTransCollector.h>`

## Classes
class | Impl
| RpmPostTransCollector implementation. More...

## Public Member Functions
| RpmPostTransCollector (Pathname root_r)
| Default ctor.
| ~RpmPostTransCollector ()
| Dtor.
bool | hasPosttransScript (const Pathname &rpmPackage_r)
| Test whether a package defines a posttrans script.
void | collectPosttransInfo (const Pathname &rpmPackage_r, const std::vector< std::string > &runposttrans_r)
| Extract and remember a packages posttrans script or dump_posttrans lines for later execution.
void | collectPosttransInfo (const std::vector< std::string > &runposttrans_r)
void | executeScripts (rpm::RpmDb &rpm_r, const IdStringSet &obsoletedPackages_r)
| Execute the remembered scripts and/or or dump_posttrans lines.
void | discardScripts ()
| Discard all remembered scripts and/or or dump_posttrans lines.

## Private Attributes
RW_pointer< Impl > | _pimpl
| Implementation class.

## Friends
std::ostream & | operator<< (std::ostream &str, const RpmPostTransCollector &obj)
| relates: RpmPostTransCollector Stream output
std::ostream & | dumpOn (std::ostream &str, const RpmPostTransCollector &obj)

## Detailed Description

Extract and remember posttrans scripts for later execution.

bsc#1041742: Attempt to delay also transfiletrigger(postun|in) execution iff rpm supports it. Rpm versions supporting –runposttrans will inject "dump_posttrans:..." lines into the output if macro "_dump_posttrans" is defined during execution. Those lines are collected and later fed into "rpm --runposttrans". If rpm does not support it, those lines are not injected. In this case we collect and later execute the posttrans script on our own.

Definition at line 40 of file RpmPostTransCollector.h.

## Constructor & Destructor Documentation

## ◆ RpmPostTransCollector()

zypp::target::RpmPostTransCollector::RpmPostTransCollector | ( | Pathname | root_r | ) |

Default ctor.

Definition at line 410 of file RpmPostTransCollector.cc.

## ◆ ~RpmPostTransCollector()

zypp::target::RpmPostTransCollector::~RpmPostTransCollector | ( |  | ) |

Dtor.

Definition at line 414 of file RpmPostTransCollector.cc.

## Member Function Documentation

## ◆ hasPosttransScript()

bool zypp::target::RpmPostTransCollector::hasPosttransScript | ( | const Pathname & | rpmPackage_r | ) |

Test whether a package defines a posttrans script.

Definition at line 417 of file RpmPostTransCollector.cc.

## ◆ collectPosttransInfo() [1/2]

void zypp::target::RpmPostTransCollector::collectPosttransInfo | ( | const Pathname & | rpmPackage_r,
|  | const std::vector< std::string > & | runposttrans_r )

Extract and remember a packages posttrans script or dump_posttrans lines for later execution.

Definition at line 420 of file RpmPostTransCollector.cc.

## ◆ collectPosttransInfo() [2/2]

void zypp::target::RpmPostTransCollector::collectPosttransInfo | ( | const std::vector< std::string > & | runposttrans_r | ) |

Definition at line 423 of file RpmPostTransCollector.cc.

## ◆ executeScripts()

void zypp::target::RpmPostTransCollector::executeScripts | ( | rpm::RpmDb & | rpm_r,
|  | const IdStringSet & | obsoletedPackages_r )

Execute the remembered scripts and/or or dump_posttrans lines.

Definition at line 426 of file RpmPostTransCollector.cc.

## ◆ discardScripts()

void zypp::target::RpmPostTransCollector::discardScripts | ( |  | ) |

Discard all remembered scripts and/or or dump_posttrans lines.

Definition at line 429 of file RpmPostTransCollector.cc.

## Friends And Related Symbol Documentation

## ◆ operator<<

std::ostream & operator<< | ( | std::ostream & | str,
|  | const RpmPostTransCollector & | obj )
| friend

relates: RpmPostTransCollector Stream output

Definition at line 432 of file RpmPostTransCollector.cc.

## ◆ dumpOn

std::ostream & dumpOn | ( | std::ostream & | str,
|  | const RpmPostTransCollector & | obj )
| friend

Definition at line 435 of file RpmPostTransCollector.cc.

## Member Data Documentation

## ◆ _pimpl

RW_pointer<Impl> zypp::target::RpmPostTransCollector::_pimpl
| private

Implementation class.

Pointer to implementation.

Definition at line 70 of file RpmPostTransCollector.h.

The documentation for this class was generated from the following files:

- zypp/target/RpmPostTransCollector.h
- zypp/target/RpmPostTransCollector.cc