libzypp 17.37.10

RpmPostTransCollector.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
11#ifndef ZYPP_TARGET_RPMPOSTTRANSCOLLECTOR_H
12#define ZYPP_TARGET_RPMPOSTTRANSCOLLECTOR_H
13
14#include <iosfwd>
15
16#include <zypp/base/PtrTypes.h>
17#include <zypp/Pathname.h>
18#include <zypp/IdString.h>
19
21 namespace zypp
22{
24 namespace target
25 {
26 namespace rpm { class RpmDb; }
27
40 class RpmPostTransCollector
41 {
42 friend std::ostream & operator<<( std::ostream & str, const RpmPostTransCollector & obj );
43 friend std::ostream & dumpOn( std::ostream & str, const RpmPostTransCollector & obj );
44
45 public:
47 RpmPostTransCollector( Pathname root_r );
48
50 ~RpmPostTransCollector();
51
52 public:
54 bool hasPosttransScript( const Pathname & rpmPackage_r );
55
57 void collectPosttransInfo( const Pathname & rpmPackage_r, const std::vector<std::string> & runposttrans_r );
59 void collectPosttransInfo( const std::vector<std::string> & runposttrans_r );
60
62 void executeScripts( rpm::RpmDb & rpm_r, const IdStringSet & obsoletedPackages_r );
63
65 void discardScripts();
66
67 public:
68 class Impl;
69 private:
70 RW_pointer<Impl> _pimpl;
71 };
72
74 std::ostream & operator<<( std::ostream & str, const RpmPostTransCollector & obj );
75
77 std::ostream & dumOn( std::ostream & str, const RpmPostTransCollector & obj );
78
79 } // namespace target
81} // namespace zypp
83#endif // ZYPP_TARGET_RPMPOSTTRANSCOLLECTOR_H
IdString.h
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:47
zypp::target::RpmPostTransCollector::Impl
RpmPostTransCollector implementation.
Definition RpmPostTransCollector.cc:49
zypp::target::RpmPostTransCollector
Extract and remember posttrans scripts for later execution.
Definition RpmPostTransCollector.h:41
zypp::target::RpmPostTransCollector::collectPosttransInfo
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.
Definition RpmPostTransCollector.cc:420
zypp::target::RpmPostTransCollector::_pimpl
RW_pointer< Impl > _pimpl
Implementation class.
Definition RpmPostTransCollector.h:70
zypp::target::RpmPostTransCollector::RpmPostTransCollector
RpmPostTransCollector(Pathname root_r)
Default ctor.
Definition RpmPostTransCollector.cc:410
zypp::target::RpmPostTransCollector::hasPosttransScript
bool hasPosttransScript(const Pathname &rpmPackage_r)
Test whether a package defines a posttrans script.
Definition RpmPostTransCollector.cc:417
zypp::target::RpmPostTransCollector::executeScripts
void executeScripts(rpm::RpmDb &rpm_r, const IdStringSet &obsoletedPackages_r)
Execute the remembered scripts and/or or dump_posttrans lines.
Definition RpmPostTransCollector.cc:426
zypp::target::RpmPostTransCollector::~RpmPostTransCollector
~RpmPostTransCollector()
Dtor.
Definition RpmPostTransCollector.cc:414
zypp::target::RpmPostTransCollector::operator<<
friend std::ostream & operator<<(std::ostream &str, const RpmPostTransCollector &obj)
Definition RpmPostTransCollector.cc:432
zypp::target::RpmPostTransCollector::dumpOn
friend std::ostream & dumpOn(std::ostream &str, const RpmPostTransCollector &obj)
Definition RpmPostTransCollector.cc:435
zypp::target::RpmPostTransCollector::discardScripts
void discardScripts()
Discard all remembered scripts and/or or dump_posttrans lines.
Definition RpmPostTransCollector.cc:429
zypp::target::RpmPostTransCollector::dumOn
std::ostream & dumOn(std::ostream &str, const RpmPostTransCollector &obj)
Verbose stream output.
zypp::target::rpm::RpmDb
Interface to the rpm program.
Definition RpmDb.h:51
str
String related utilities and Regular expression matching.
zypp::target::rpm
Definition KeyRing.h:327
zypp::target
Definition KeyRing.h:325
zypp::target::operator<<
std::ostream & operator<<(std::ostream &str, const CommitPackageCache &obj)
Definition CommitPackageCache.cc:160
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::IdStringSet
std::unordered_set< IdString > IdStringSet
Definition IdString.h:29
zypp::RW_pointer
Wrapper for const correct access via Smart pointer types.
Definition PtrTypes.h:293
Pathname.h
PtrTypes.h