13 #include <solv/transaction.h> 14 #include <solv/solver.h> 53 typedef std::unordered_set<detail::IdType>
set_type;
54 typedef std::unordered_map<detail::IdType,detail::IdType>
map_type;
63 ,
_arch( solv_r.arch() )
70 typedef std::unordered_map<detail::IdType,PostMortem>
pmmap_type;
84 if ( ! pi.status().transacts() )
86 decisionq.
push( pi.isSystem() ? -pi.id() : pi.id() );
91 noobsq.
push( SOLVER_NOOBSOLETES | SOLVER_SOLVABLE );
92 noobsq.
push( solv.id() );
95 ::solver_calculate_noobsmap(
myPool().getPool(), noobsq, noobsmap );
96 _trans = ::transaction_create_decisionq(
myPool().getPool(), decisionq, noobsmap );
128 { ::transaction_free(
_trans ); }
144 ::transaction_order(
_trans, SOLVER_TRANSACTION_KEEP_ORDERDATA );
150 int ret = transaction_order_add_choices(
_trans, chosen, choices );
151 MIL << ret <<
": " << chosen <<
": " << choices << endl;
160 ::transaction_order(
_trans, 0 );
167 {
return(
_trans->steps.count == 0 ); }
170 {
return _trans->steps.count; }
189 { return ::transaction_installedresult(
_trans, result_r ); }
206 switch( ::transaction_type(
_trans, solv_r.
id(), SOLVER_TRANSACTION_RPM_ONLY ) )
224 pmmap_type::const_iterator it(
_pmMap.find( solv_r.
id() ) );
225 return( it ==
_pmMap.end() ? _none : it->second );
231 map_type::const_iterator res(
_linkMap.find( solv_r.
id() ) );
232 return( res ==
_linkMap.end() ? solv_r.
id() : res->second );
236 {
return( set_r.find( sid_r ) != set_r.end() ); }
250 if ( stage != newval_r )
267 if ( solv_r &&
_trans->steps.elements )
295 static shared_ptr<Impl> _nullimpl(
new Impl );
303 return str <<
"Transaction: " << obj.
size() <<
" (" << (obj.
valid()?
"valid":
"INVALID") <<
")";
363 {
return str << *obj.
_pimpl; }
410 str <<
'[' << obj.
ident() <<
'-' << obj.
edition() <<
'.' << obj.
arch() <<
']';
418 #define OUTS(E,S) case Transaction::E: return str << #S; break 432 #define OUTS(E,S) case Transaction::E: return str << #S; break 438 return str <<
"[??]";
449 Transaction_const_iterator::Transaction_const_iterator()
int installedResult(Queue &result_r) const
Simple serial number watcher.
int IdType
Generic Id type.
A Solvable object within the sat Pool.
friend bool operator==(const Transaction &lhs, const Transaction &rhs)
IdType id() const
Expert backdoor.
Transaction const_iterator.
[M] Install(multiversion) item (
Solvable satSolvable() const
Return the corresponding Solvable.
const_iterator find(const sat::Solvable &solv_r) const
Return iterator pointing to solv_r or end.
iterator find(const RW_pointer< Transaction::Impl > &self_r, const sat::Solvable &solv_r)
friend std::ostream & dumpOn(std::ostream &str, const Transaction &obj)
std::unordered_map< detail::IdType, detail::IdType > map_type
const MultiversionList & multiversionList() const
size_t size() const
Number of steps in transaction steps.
StepStage stepStage() const
Step action result.
StepType stepType(Solvable solv_r) const
RW_pointer< Transaction::Impl > _pimpl
Pointer to implementation.
String related utilities and Regular expression matching.
StepStage
Step action result.
bool valid() const
Whether transaction actually contains data and also fits the current pools content.
Transaction()
Default ctor: empty transaction.
bool isKind(const ResKind &kind_r) const
Test whether a Solvable is of a certain ResKind.
sat::Solvable buddy() const
Return the buddy we share our status object with.
const_iterator find(const RW_pointer< Transaction::Impl > &self_r, const sat::Solvable &solv_r) const
Access to the sat-pools string space.
Libsolv transaction wrapper.
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Edition represents [epoch:]version[-release]
std::ostream & operator<<(std::ostream &str, const Transaction::Impl &obj)
const_iterator end() const
Iterator behind the last TransactionStep.
std::unordered_set< detail::IdType > set_type
iterator begin(const RW_pointer< Transaction::Impl > &self_r)
const_iterator end(const RW_pointer< Transaction::Impl > &self_r) const
StepStage stepStage(detail::IdType sid_r) const
StringQueue autoInstalled() const
Return the ident strings of all packages that would be auto-installed after the transaction is run...
[ ] Nothing (includes implicit deletes due to obsoletes and non-package actions)
void push(value_type val_r)
Push a value to the end off the Queue.
void stepStage(detail::IdType sid_r, StepStage newval_r)
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
PostMortem(const sat::Solvable &solv_r)
value_type pop_front()
Pop and return the 1st Id from the queue or 0 if empty.
Backlink to the associated PoolImpl.
RW_pointer< Impl > _pimpl
Pointer to implementation.
mutable ::Transaction * _trans
friend std::ostream & operator<<(std::ostream &str, const Transaction &obj)
A single step within a Transaction.
SerialNumberWatcher _watcher
detail::IdType * _find(const sat::Solvable &solv_r) const
detail::Transaction_const_iterator const_iterator
void autoInstalled(const StringQueue &queue_r)
Transaction implementation.
int installedResult(Queue &result_r) const
Return all packages that would be installed after the transaction is run.
Transaction_const_iterator()
bool order()
Order transaction steps for commit.
static PoolImpl & myPool()
bool isIn(const set_type &set_r, detail::IdType sid_r) const
const_iterator begin(const RW_pointer< Transaction::Impl > &self_r) const
bool isSystem() const
Return whether this Solvable belongs to the system repo.
Libsolv Id queue wrapper.
StepType
Type of (rpm) action to perform in a Step.
DefaultIntegral< bool, false > _ordered
const PostMortem & pmdata(Solvable solv_r) const
StringQueue autoInstalled() const
static constexpr LoadFromPoolType loadFromPool
const_iterator begin() const
Iterator to the first TransactionStep.
StepType stepType() const
Type of action to perform in this step.
static shared_ptr< Impl > nullimpl()
Offer default Impl.
bool empty() const
Whether the transaction contains any steps.
int erase(const Pathname &path)
Erase whatever happens to be located at path (file or directory).
bool isClean(unsigned serial_r) const
Return whether serial_r is still unchanged.
detail::IdType resolve(const Solvable &solv_r) const
Wrapper for const correct access via Smart pointer types.
friend std::ostream & operator<<(std::ostream &str, const Impl &obj)
StepStage stepStage(Solvable solv_r) const
Combining sat::Solvable and ResStatus.
std::unordered_map< detail::IdType, PostMortem > pmmap_type
iterator end(const RW_pointer< Transaction::Impl > &self_r)
Libsolv (bit)Map wrapper.
Easy-to use interface to the ZYPP dependency resolver.
void stepStage(Solvable solv_r, StepStage newval_r)
StringQueue _autoInstalled
detail::Transaction_iterator iterator
static ResPool instance()
Singleton ctor.