Go to the documentation of this file.
13 #include <solv/transaction.h>
14 #include <solv/solver.h>
55 typedef std::unordered_set<detail::IdType>
set_type;
56 typedef std::unordered_map<detail::IdType,detail::IdType>
map_type;
65 ,
_arch( solv_r.arch() )
72 typedef std::unordered_map<detail::IdType,PostMortem>
pmmap_type;
86 if ( ! pi.status().transacts() )
88 decisionq.
push( pi.isSystem() ? -pi.id() : pi.id() );
93 noobsq.
push( SOLVER_NOOBSOLETES | SOLVER_SOLVABLE );
94 noobsq.
push( solv.id() );
97 ::solver_calculate_noobsmap(
myPool().getPool(), noobsq, noobsmap );
98 _trans = ::transaction_create_decisionq(
myPool().getPool(), decisionq, noobsmap );
130 { ::transaction_free(
_trans ); }
146 ::transaction_order(
_trans, SOLVER_TRANSACTION_KEEP_ORDERDATA );
152 int ret = transaction_order_add_choices(
_trans, chosen, choices );
153 MIL << ret <<
": " << chosen <<
": " << choices << endl;
162 ::transaction_order(
_trans, 0 );
169 {
return(
_trans->steps.count == 0 ); }
172 {
return _trans->steps.count; }
191 { return ::transaction_installedresult(
_trans, result_r ); }
208 switch( ::transaction_type(
_trans, solv_r.
id(), SOLVER_TRANSACTION_RPM_ONLY ) )
226 pmmap_type::const_iterator it(
_pmMap.find( solv_r.
id() ) );
227 return( it ==
_pmMap.end() ? _none : it->second );
233 map_type::const_iterator res(
_linkMap.find( solv_r.
id() ) );
234 return( res ==
_linkMap.end() ? solv_r.
id() : res->second );
238 {
return( set_r.find( sid_r ) != set_r.end() ); }
252 if ( stage != newval_r )
269 if ( solv_r &&
_trans->steps.elements )
297 static shared_ptr<Impl> _nullimpl(
new Impl );
305 return str <<
"Transaction: " << obj.
size() <<
" (" << (obj.
valid()?
"valid":
"INVALID") <<
")";
315 : _pimpl(
Impl::nullimpl() )
319 : _pimpl( new
Impl( loadFromPool ) )
420 #define OUTS(E,S) case Transaction::E: return str << #S; break
434 #define OUTS(E,S) case Transaction::E: return str << #S; break
440 return str <<
"[??]";
451 Transaction_const_iterator::Transaction_const_iterator()
457 , _pimpl( iter_r._pimpl )
const_iterator find(const RW_pointer< Transaction::Impl > &self_r, const sat::Solvable &solv_r) const
@ TRANSACTION_IGNORE
[ ] Nothing (includes implicit deletes due to obsoletes and non-package actions)
RW_pointer< Impl > _pimpl
Pointer to implementation.
Solvable satSolvable() const
Return the corresponding Solvable.
StepType stepType(Solvable solv_r) const
StepStage stepStage() const
Step action result.
iterator end(const RW_pointer< Transaction::Impl > &self_r)
Combining sat::Solvable and ResStatus.
bool empty() const
Whether the transaction contains any steps.
A single step within a Transaction.
friend std::ostream & operator<<(std::ostream &str, const Impl &obj)
@ TRANSACTION_MULTIINSTALL
[M] Install(multiversion) item (
A Solvable object within the sat Pool.
IdType id() const
Expert backdoor.
StepStage stepStage(detail::IdType sid_r) const
std::unordered_set< detail::IdType > set_type
@ TRANSACTION_INSTALL
[+] Install(update) item
bool valid() const
Whether transaction actually contains data and also fits the current pools content.
friend std::ostream & operator<<(std::ostream &str, const Transaction &obj)
Transaction implementation.
std::unordered_map< detail::IdType, PostMortem > pmmap_type
iterator begin(const RW_pointer< Transaction::Impl > &self_r)
bool isKind(const ResKind &kind_r) const
Test whether a Solvable is of a certain ResKind.
Edition represents [epoch:]version[-release]
detail::IdType * _find(const sat::Solvable &solv_r) const
const_iterator find(const sat::Solvable &solv_r) const
Return iterator pointing to solv_r or end.
static PoolImpl & myPool()
void autoInstalled(const StringQueue &queue_r)
static ResPool instance()
Singleton ctor.
Libsolv transaction wrapper.
SerialNumberWatcher _watcher
Transaction()
Default ctor: empty transaction.
iterator find(const RW_pointer< Transaction::Impl > &self_r, const sat::Solvable &solv_r)
std::ostream & dumpOn(std::ostream &str, const LocaleSupport &obj)
std::unordered_map< detail::IdType, detail::IdType > map_type
StepType
Type of (rpm) action to perform in a Step.
Access to the sat-pools string space.
std::ostream & operator<<(std::ostream &str, const Transaction::Impl &obj)
Stream output.
Wrapper for const correct access via Smart pointer types.
detail::Transaction_iterator iterator
DefaultIntegral< bool, false > _ordered
bool isIn(const set_type &set_r, detail::IdType sid_r) const
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
const_iterator end(const RW_pointer< Transaction::Impl > &self_r) const
Transaction_const_iterator()
const PostMortem & pmdata(Solvable solv_r) const
detail::Transaction_const_iterator const_iterator
static constexpr LoadFromPoolType loadFromPool
int IdType
Generic Id type.
std::ostream & operator<<(std::ostream &str, const FileConflicts &obj)
Easy-to use interface to the ZYPP dependency resolver.
const_iterator begin() const
Iterator to the first TransactionStep.
mutable ::Transaction * _trans
Libsolv Id queue wrapper.
PostMortem(const sat::Solvable &solv_r)
Libsolv (bit)Map wrapper.
size_t size() const
Number of steps in transaction steps.
bool isSystem() const
Return whether this Solvable belongs to the system repo.
void stepStage(detail::IdType sid_r, StepStage newval_r)
@ TRANSACTION_ERASE
[-] Delete item
Transaction const_iterator.
StepStage stepStage(Solvable solv_r) const
int installedResult(Queue &result_r) const
Return all packages that would be installed after the transaction is run.
value_type pop_front()
Pop and return the 1st Id from the queue or 0 if empty.
sat::Solvable buddy() const
Return the buddy we share our status object with.
bool order()
Order transaction steps for commit.
StringQueue _autoInstalled
@ STEP_TODO
[__] unprocessed
int installedResult(Queue &result_r) const
int erase(const Pathname &path)
Erase whatever happens to be located at path (file or directory).
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
void stepStage(Solvable solv_r, StepStage newval_r)
StepType stepType() const
Type of action to perform in this step.
Backlink to the associated PoolImpl.
StringQueue autoInstalled() const
Return the ident strings of all packages that would be auto-installed after the transaction is run.
StepStage
Step action result.
String related utilities and Regular expression matching.
const_iterator begin(const RW_pointer< Transaction::Impl > &self_r) const
static shared_ptr< Impl > nullimpl()
Offer default Impl.
bool isClean(unsigned serial_r) const
Return whether serial_r is still unchanged.
StringQueue autoInstalled() const
bool operator==(const Map &lhs, const Map &rhs)
detail::IdType resolve(const Solvable &solv_r) const
void push(value_type val_r)
Push a value to the end off the Queue.
Simple serial number watcher.
const_iterator end() const
Iterator behind the last TransactionStep.