1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/ZYppCommitPolicy.h
12 #ifndef ZYPP_ZYPPCOMMITPOLICY_H
13 #define ZYPP_ZYPPCOMMITPOLICY_H
17 ///////////////////////////////////////////////////////////////////
19 { /////////////////////////////////////////////////////////////////
21 ///////////////////////////////////////////////////////////////////
23 // CLASS NAME : ZYppCommitPolicy
26 class ZYppCommitPolicy
30 : _restrictToMedia ( 0 )
32 , _rpmNoSignature ( false )
33 , _syncPoolAfterCommit( true )
37 unsigned restrictToMedia() const
38 { return _restrictToMedia; }
43 bool rpmNoSignature() const
44 { return _rpmNoSignature; }
46 bool syncPoolAfterCommit() const
47 { return _syncPoolAfterCommit; }
50 /** Restrict commit to a certain media number
53 ZYppCommitPolicy & restrictToMedia( unsigned mediaNr_r )
54 { _restrictToMedia = mediaNr_r; return *this; }
56 /** Process all media (default) */
57 ZYppCommitPolicy & allMedia()
58 { return restrictToMedia( 0 ); }
60 /** Set dry run (default: false) */
61 ZYppCommitPolicy & dryRun( bool yesNo_r = true )
62 { _dryRun = yesNo_r; return *this; }
64 /** Use rpm option --nosignature (default: false) */
65 ZYppCommitPolicy & rpmNoSignature( bool yesNo_r = true )
66 { _rpmNoSignature = yesNo_r; return *this; }
68 /** Kepp pool in sync with the Target databases after commit (default: true) */
69 ZYppCommitPolicy & syncPoolAfterCommit( bool yesNo_r = true )
70 { _syncPoolAfterCommit = yesNo_r; return *this; }
73 unsigned _restrictToMedia;
76 bool _syncPoolAfterCommit;
78 ///////////////////////////////////////////////////////////////////
80 /** \relates ZYppCommitPolicy Stream output. */
81 std::ostream & operator<<( std::ostream & str, const ZYppCommitPolicy & obj );
83 /////////////////////////////////////////////////////////////////
85 ///////////////////////////////////////////////////////////////////
86 #endif // ZYPP_ZYPPCOMMITPOLICY_H