libzypp 17.31.23
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
20namespace zypp
21{
23 namespace target
24 {
25 namespace rpm { class RpmDb; }
26
40 {
41 friend std::ostream & operator<<( std::ostream & str, const RpmPostTransCollector & obj );
42 friend std::ostream & dumpOn( std::ostream & str, const RpmPostTransCollector & obj );
43
44 public:
46 RpmPostTransCollector( const Pathname & root_r );
47
50
51 public:
53 bool hasPosttransScript( const Pathname & rpmPackage_r );
54
56 void collectPosttransInfo( const Pathname & rpmPackage_r, const std::vector<std::string> & runposttrans_r );
58 void collectPosttransInfo( const std::vector<std::string> & runposttrans_r );
59
61 void executeScripts( rpm::RpmDb & rpm_r );
62
64 void discardScripts();
65
66 public:
67 class Impl;
68 private:
70 };
71
73 std::ostream & operator<<( std::ostream & str, const RpmPostTransCollector & obj );
74
76 std::ostream & dumOn( std::ostream & str, const RpmPostTransCollector & obj );
77
78 } // namespace target
80} // namespace zypp
82#endif // ZYPP_TARGET_RPMPOSTTRANSCOLLECTOR_H
RpmPostTransCollector implementation.
Extract and remember posttrans scripts for later execution.
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 executeScripts(rpm::RpmDb &rpm_r)
Execute the remembered scripts and/or or dump_posttrans lines.
RW_pointer< Impl > _pimpl
Implementation class.
bool hasPosttransScript(const Pathname &rpmPackage_r)
Test whether a package defines a posttrans script.
friend std::ostream & operator<<(std::ostream &str, const RpmPostTransCollector &obj)
friend std::ostream & dumpOn(std::ostream &str, const RpmPostTransCollector &obj)
void discardScripts()
Discard all remembered scripts and/or or dump_posttrans lines.
std::ostream & dumOn(std::ostream &str, const RpmPostTransCollector &obj)
Verbose stream output.
Interface to the rpm program.
Definition: RpmDb.h:50
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const CommitPackageCache &obj)
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
Wrapper for const correct access via Smart pointer types.
Definition: PtrTypes.h:286