|
apt 3.0.3
commandline package manager
|
Perform changes to the depcache atomically. More...
#include <apt-pkg/depcache.h>
Classes | |
| struct | Private |
Public Types | |
| enum class | Behavior { COMMIT , ROLLBACK , AUTO } |
Public Member Functions | |
| Transaction (pkgDepCache &cache, Behavior behavior) | |
| void | commit () |
| Commit the transaction immediately. | |
| void | rollback () |
| Rollback the transaction immediately. | |
| void | temporaryRollback () |
| Like rollback, but can be called multiple times. | |
| ~Transaction () | |
| Commit or rollback the transaction based on default policy. | |
Perform changes to the depcache atomically.
The default policy for a transaction is to rollback if the number of broken packages increased, otherwise to commit. Call commit() or rollback() to override the default policy.
| void temporaryRollback | ( | ) |
Like rollback, but can be called multiple times.
You can for example create a new transaction, then temporarily rollback to the state before the previous transaction in that transaction.
Referenced by rollback().