1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/target/RpmPostTransCollector.h
11 #ifndef ZYPP_TARGET_RPMPOSTTRANSCOLLECTOR_H
12 #define ZYPP_TARGET_RPMPOSTTRANSCOLLECTOR_H
16 #include <zypp/base/PtrTypes.h>
17 #include <zypp/ManagedFile.h>
18 #include <zypp/Pathname.h>
20 ///////////////////////////////////////////////////////////////////
23 ///////////////////////////////////////////////////////////////////
26 ///////////////////////////////////////////////////////////////////
27 /// \class RpmPostTransCollector
28 /// \brief Extract and remember %posttrans scripts for later execution
29 /// \todo Maybe embedd this into the TransactionSteps.
30 ///////////////////////////////////////////////////////////////////
31 class RpmPostTransCollector
33 friend std::ostream & operator<<( std::ostream & str, const RpmPostTransCollector & obj );
34 friend std::ostream & dumpOn( std::ostream & str, const RpmPostTransCollector & obj );
38 RpmPostTransCollector( const Pathname & root_r );
41 ~RpmPostTransCollector();
44 /** Extract and remember a packages %posttrans script for later execution.
45 * \return whether a script was collected.
47 bool collectScriptFromPackage( ManagedFile rpmPackage_r );
49 /** Execute the remembered scripts.
50 * \return false if execution was aborted by a user callback
52 bool executeScripts();
54 /** Discard all remembered scrips. */
55 void discardScripts();
58 class Impl; ///< Implementation class.
60 RW_pointer<Impl> _pimpl; ///< Pointer to implementation.
63 /** \relates RpmPostTransCollector Stream output */
64 std::ostream & operator<<( std::ostream & str, const RpmPostTransCollector & obj );
66 /** \relates RpmPostTransCollector Verbose stream output */
67 std::ostream & dumOn( std::ostream & str, const RpmPostTransCollector & obj );
70 ///////////////////////////////////////////////////////////////////
72 ///////////////////////////////////////////////////////////////////
73 #endif // ZYPP_TARGET_RPMPOSTTRANSCOLLECTOR_H