summaryrefslogtreecommitdiff
path: root/swig/ZYppCommitPolicy.i
blob: fe295f3a95f5c9aa0634ce605533c86a4ff5ba87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

#ifdef SWIGRUBY
%rename("dryRun=") ZYppCommitPolicy::dryRun(bool);
%rename("rpmNoSignature=") ZYppCommitPolicy::rpmNoSignature(bool);
%rename("syncPoolAfterCommit=") ZYppCommitPolicy::syncPoolAfterCommit(bool);
#endif

class ZYppCommitPolicy
{
  public:
    ZYppCommitPolicy()
    : _restrictToMedia    ( 0 )
    , _dryRun             ( false )
    , _rpmNoSignature     ( false )
    , _syncPoolAfterCommit( true )
    {}

  public:
    unsigned restrictToMedia() const
    { return _restrictToMedia; }

    bool dryRun() const
    { return _dryRun; }

    bool rpmNoSignature() const
    { return _rpmNoSignature; }

    bool syncPoolAfterCommit() const
    { return _syncPoolAfterCommit; }

  public:
    /** Restrict commit to a certain media number
     * \deprecated
     */
    ZYppCommitPolicy & restrictToMedia( unsigned mediaNr_r )
    { _restrictToMedia = mediaNr_r; return *this; }

    /** Process all media (default) */
    ZYppCommitPolicy & allMedia()
    { return restrictToMedia( 0 ); }

    /** Set dry run (default: false) */
    ZYppCommitPolicy & dryRun( bool yesNo_r = true )
    { _dryRun = yesNo_r; return *this; }

    /** Use rpm option --nosignature (default: false) */
    ZYppCommitPolicy & rpmNoSignature( bool yesNo_r = true )
    { _rpmNoSignature = yesNo_r; return *this; }

    /** Kepp pool in sync with the Target databases after commit (default: true) */
    ZYppCommitPolicy & syncPoolAfterCommit( bool yesNo_r = true )
    { _syncPoolAfterCommit = yesNo_r; return *this; }

  private:
    unsigned _restrictToMedia;
    bool     _dryRun;
    bool     _rpmNoSignature;
    bool     _syncPoolAfterCommit;
};