13#include <solv/transaction.h>
14#include <solv/solver.h>
19#include <zypp-core/base/DefaultIntegral>
55 using set_type = std::unordered_set<detail::IdType>;
56 using map_type = std::unordered_map<detail::IdType, detail::IdType>;
72 using pmmap_type = std::unordered_map<detail::IdType, PostMortem>;
88 if ( !
pi.status().transacts() )
118 if (
solv.isSystem() )
132 { ::transaction_free(
_trans ); }
164 ::transaction_order(
_trans, 0 );
171 {
return(
_trans->steps.count == 0 ); }
174 {
return _trans->steps.count; }
307 return str <<
"Transaction: " <<
obj.size() <<
" (" << (
obj.valid()?
"valid":
"INVALID") <<
")";
317 : _pimpl(
Impl::nullimpl() )
321 : _pimpl(
new Impl( loadFromPool ) )
328 {
return _pimpl->valid(); }
331 {
return _pimpl->order(); }
334 {
return _pimpl->empty(); }
337 {
return _pimpl->size(); }
361 {
return _pimpl->autoInstalled(); }
391 {
return _pimpl->stepType( _solv ); }
394 {
return _pimpl->stepStage( _solv ); }
400 {
return _solv ? _solv.ident() :
_pimpl->pmdata(_solv )._ident; }
403 {
return _solv ? _solv.edition() :
_pimpl->pmdata(_solv )._edition; }
406 {
return _solv ? _solv.arch() :
_pimpl->pmdata(_solv )._arch; }
410 str <<
obj.stepType() <<
obj.stepStage() <<
" ";
411 if (
obj.satSolvable() )
414 str <<
'[' <<
obj.ident() <<
'-' <<
obj.edition() <<
'.' <<
obj.arch() <<
']';
422 #define OUTS(E,S) case Transaction::E: return str << #S; break
436 #define OUTS(E,S) case Transaction::E: return str << #S; break
442 return str <<
"[??]";
453 Transaction_const_iterator::Transaction_const_iterator()
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
shared_ptr< Impl > _pimpl
Edition represents [epoch:]version[-release]
Access to the sat-pools string space.
Combining sat::Solvable and ResStatus.
static ResPool instance()
Singleton ctor.
Simple serial number watcher.
bool isClean(unsigned serial_r) const
Return whether serial_r is still unchanged.
Libsolv (bit)Map wrapper.
Libsolv Id queue wrapper.
A Solvable object within the sat Pool.
A single step within a Transaction.
StepType stepType() const
Type of action to perform in this step.
StepStage stepStage() const
Step action result.
Libsolv transaction wrapper.
detail::Transaction_iterator iterator
const_iterator end() const
Iterator behind the last TransactionStep.
RW_pointer< Impl > _pimpl
Pointer to implementation.
int installedResult(Queue &result_r) const
Return all packages that would be installed after the transaction is run.
StringQueue autoInstalled() const
Return the ident strings of all packages that would be auto-installed after the transaction is run.
const_iterator begin() const
Iterator to the first TransactionStep.
detail::Transaction_const_iterator const_iterator
bool valid() const
Whether transaction actually contains data and also fits the current pools content.
Transaction()
Default ctor: empty transaction.
bool order()
Order transaction steps for commit.
friend std::ostream & operator<<(std::ostream &str, const Transaction &obj)
static constexpr LoadFromPoolType loadFromPool
const_iterator find(const sat::Solvable &solv_r) const
Return iterator pointing to solv_r or end.
StepType
Type of (rpm) action to perform in a Step.
@ TRANSACTION_MULTIINSTALL
[M] Install(multiversion) item (
@ TRANSACTION_INSTALL
[+] Install(update) item
@ TRANSACTION_IGNORE
[ ] Nothing (includes implicit deletes due to obsoletes and non-package actions)
@ TRANSACTION_ERASE
[-] Delete item
size_t size() const
Number of steps in transaction steps.
StepStage
Step action result.
@ STEP_TODO
[__] unprocessed
bool empty() const
Whether the transaction contains any steps.
Transaction const_iterator.
Transaction_const_iterator()
String related utilities and Regular expression matching.
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
int IdType
Generic Id type.
std::ostream & operator<<(std::ostream &str, const FileConflicts &obj)
std::ostream & dumpOn(std::ostream &str, const LocaleSupport &obj)
bool operator==(const Map &lhs, const Map &rhs)
Easy-to use interface to the ZYPP dependency resolver.
PostMortem(const sat::Solvable &solv_r)
Transaction implementation.
void stepStage(Solvable solv_r, StepStage newval_r)
const_iterator find(const RW_pointer< Transaction::Impl > &self_r, const sat::Solvable &solv_r) const
std::unordered_map< detail::IdType, detail::IdType > map_type
void autoInstalled(const StringQueue &queue_r)
Impl & operator=(const Impl &)=delete
std::unordered_set< detail::IdType > set_type
int installedResult(Queue &result_r) const
StringQueue _autoInstalled
iterator end(const RW_pointer< Transaction::Impl > &self_r)
SerialNumberWatcher _watcher
Impl(const Impl &)=delete
static shared_ptr< Impl > nullimpl()
Offer default Impl.
iterator find(const RW_pointer< Transaction::Impl > &self_r, const sat::Solvable &solv_r)
std::unordered_map< detail::IdType, PostMortem > pmmap_type
detail::IdType resolve(const Solvable &solv_r) const
friend std::ostream & operator<<(std::ostream &str, const Impl &obj)
DefaultIntegral< bool, false > _ordered
StepStage stepStage(Solvable solv_r) const
mutable::Transaction * _trans
bool isIn(const set_type &set_r, detail::IdType sid_r) const
detail::IdType * _find(const sat::Solvable &solv_r) const
const_iterator end(const RW_pointer< Transaction::Impl > &self_r) const
StepType stepType(Solvable solv_r) const
const PostMortem & pmdata(Solvable solv_r) const
iterator begin(const RW_pointer< Transaction::Impl > &self_r)
const_iterator begin(const RW_pointer< Transaction::Impl > &self_r) const
StringQueue autoInstalled() const
std::ostream & operator<<(std::ostream &str, const Transaction::Impl &obj)
Stream output.
Impl & operator=(Impl &&)=delete
StepStage stepStage(detail::IdType sid_r) const
void stepStage(detail::IdType sid_r, StepStage newval_r)
Backlink to the associated PoolImpl.
static PoolImpl & myPool()
#define for_(IT, BEG, END)
Convenient for-loops using iterator.