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 media 1.
51 * Fake outstanding YCP fix: Honour restriction to media 1
52 * at installation, but install all remaining packages if
53 * post-boot (called with <tt>mediaNr_r > 1</tt>).
55 ZYppCommitPolicy & restrictToMedia( unsigned mediaNr_r )
56 { _restrictToMedia = ( mediaNr_r == 1 ) ? 1 : 0; return *this; }
58 /** Process all media (default) */
59 ZYppCommitPolicy & allMedia()
60 { return restrictToMedia( 0 ); }
62 /** Set dry run (default: false) */
63 ZYppCommitPolicy & dryRun( bool yesNo_r = true )
64 { _dryRun = yesNo_r; return *this; }
66 /** Use rpm option --nosignature (default: false) */
67 ZYppCommitPolicy & rpmNoSignature( bool yesNo_r = true )
68 { _rpmNoSignature = yesNo_r; return *this; }
70 /** Kepp pool in sync with the Target databases after commit (default: true) */
71 ZYppCommitPolicy & syncPoolAfterCommit( bool yesNo_r = true )
72 { _syncPoolAfterCommit = yesNo_r; return *this; }
75 unsigned _restrictToMedia;
78 bool _syncPoolAfterCommit;
80 ///////////////////////////////////////////////////////////////////
82 /** \relates ZYppCommitPolicy Stream output. */
83 std::ostream & operator<<( std::ostream & str, const ZYppCommitPolicy & obj );
85 /////////////////////////////////////////////////////////////////
87 ///////////////////////////////////////////////////////////////////
88 #endif // ZYPP_ZYPPCOMMITPOLICY_H