{
public:
ZYppCommitPolicy()
- : _restrictToMedia( 0 )
- , _dryRun( false )
- , _rpmNoSignature( false )
+ : _restrictToMedia ( 0 )
+ , _dryRun ( false )
+ , _rpmNoSignature ( false )
+ , _syncPoolAfterCommit( true )
{}
public:
bool rpmNoSignature() const
{ return _rpmNoSignature; }
+ bool syncPoolAfterCommit() const
+ { return _syncPoolAfterCommit; }
+
public:
/** Restrict commit to a certain media number
* \deprecated
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;
};
///////////////////////////////////////////////////////////////////
ZYppCommitResult res = _target->_pimpl->commit( pool(), policy_r );
if (! policy_r.dryRun() ) {
- // reload new status from target
- removeInstalledResolvables();
+ // Tag target data invalid, so they are reloaded on the next call to
+ // target->resolvables(). Actually the target should do this without
+ // foreign help.
_target->reset();
- addResolvables( _target->resolvables(), true );
+ removeInstalledResolvables();
+ if ( policy_r.syncPoolAfterCommit() )
+ {
+ // reload new status from target
+ addResolvables( _target->resolvables(), true );
+ }
}
MIL << "Commit (" << policy_r << ") returned: "