1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/ZYppCommitPolicy.h
12 #ifndef ZYPP_ZYPPCOMMITPOLICY_H
13 #define ZYPP_ZYPPCOMMITPOLICY_H
17 #include "zypp/base/PtrTypes.h"
19 #include "zypp/DownloadMode.h"
20 #include "zypp/target/rpm/RpmFlags.h"
22 ///////////////////////////////////////////////////////////////////
24 { /////////////////////////////////////////////////////////////////
26 ///////////////////////////////////////////////////////////////////
28 // CLASS NAME : ZYppCommitPolicy
31 class ZYppCommitPolicy
38 /** Restrict commit to media 1.
39 * Fake outstanding YCP fix: Honour restriction to media 1
40 * at installation, but install all remaining packages if
41 * post-boot (called with <tt>mediaNr_r > 1</tt>).
43 ZYppCommitPolicy & restrictToMedia( unsigned mediaNr_r );
45 /** Process all media (default) */
46 ZYppCommitPolicy & allMedia()
47 { return restrictToMedia( 0 ); }
49 unsigned restrictToMedia() const;
52 /** Set dry run (default: false).
53 * Dry-run should not change anything on the system, unless
54 * the \ref downloadMode is set to \ref DownloadOnly. In that
55 * case packages are downloaded to the local cache.
57 ZYppCommitPolicy & dryRun( bool yesNo_r );
62 /** Commit download policy to use. (default: \ref DownloadDefault)
63 * \note \ref DownloadOnly also implies a \ref dryRun.
65 ZYppCommitPolicy & downloadMode( DownloadMode val_r );
67 DownloadMode downloadMode() const;
70 /** The default \ref target::rpm::RpmInstFlags. (default: none)*/
71 ZYppCommitPolicy & rpmInstFlags( target::rpm::RpmInstFlags newFlags_r );
73 /** Use rpm option --nosignature (default: false) */
74 ZYppCommitPolicy & rpmNoSignature( bool yesNo_r );
76 /** Use rpm option --excludedocs (default: false) */
77 ZYppCommitPolicy & rpmExcludeDocs( bool yesNo_r );
79 target::rpm::RpmInstFlags rpmInstFlags() const;
81 bool rpmNoSignature() const;
83 bool rpmExcludeDocs() const;
86 /** Kepp pool in sync with the Target databases after commit (default: true) */
87 ZYppCommitPolicy & syncPoolAfterCommit( bool yesNo_r );
89 bool syncPoolAfterCommit() const;
95 /** Pointer to data. */
96 RWCOW_pointer<Impl> _pimpl;
98 ///////////////////////////////////////////////////////////////////
100 /** \relates ZYppCommitPolicy Stream output. */
101 std::ostream & operator<<( std::ostream & str, const ZYppCommitPolicy & obj );
103 /////////////////////////////////////////////////////////////////
105 ///////////////////////////////////////////////////////////////////
106 #endif // ZYPP_ZYPPCOMMITPOLICY_H