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
30 /** Options and policies for ZYpp::commit.
31 * \see \ref ZYpp::commit
33 class ZYppCommitPolicy
40 /** Restrict commit to media 1.
41 * Fake outstanding YCP fix: Honour restriction to media 1
42 * at installation, but install all remaining packages if
43 * post-boot (called with <tt>mediaNr_r > 1</tt>).
45 ZYppCommitPolicy & restrictToMedia( unsigned mediaNr_r );
47 /** Process all media (default) */
48 ZYppCommitPolicy & allMedia()
49 { return restrictToMedia( 0 ); }
51 unsigned restrictToMedia() const;
54 /** Set dry run (default: false).
55 * Dry-run should not change anything on the system, unless
56 * the \ref downloadMode is set to \ref DownloadOnly. In that
57 * case packages are downloaded to the local cache.
59 ZYppCommitPolicy & dryRun( bool yesNo_r );
64 /** Commit download policy to use. (default: \ref DownloadDefault)
65 * \note \ref DownloadOnly also implies a \ref dryRun.
67 ZYppCommitPolicy & downloadMode( DownloadMode val_r );
69 DownloadMode downloadMode() const;
72 /** The default \ref target::rpm::RpmInstFlags. (default: none)*/
73 ZYppCommitPolicy & rpmInstFlags( target::rpm::RpmInstFlags newFlags_r );
75 /** Use rpm option --nosignature (default: false) */
76 ZYppCommitPolicy & rpmNoSignature( bool yesNo_r );
78 /** Use rpm option --excludedocs (default: false) */
79 ZYppCommitPolicy & rpmExcludeDocs( bool yesNo_r );
81 target::rpm::RpmInstFlags rpmInstFlags() const;
83 bool rpmNoSignature() const;
85 bool rpmExcludeDocs() const;
88 /** Kepp pool in sync with the Target databases after commit (default: true) */
89 ZYppCommitPolicy & syncPoolAfterCommit( bool yesNo_r );
91 bool syncPoolAfterCommit() const;
97 /** Pointer to data. */
98 RWCOW_pointer<Impl> _pimpl;
100 ///////////////////////////////////////////////////////////////////
102 /** \relates ZYppCommitPolicy Stream output. */
103 std::ostream & operator<<( std::ostream & str, const ZYppCommitPolicy & obj );
105 /////////////////////////////////////////////////////////////////
107 ///////////////////////////////////////////////////////////////////
108 #endif // ZYPP_ZYPPCOMMITPOLICY_H