DeltaRpm.h \
VendorAttr.h \
UpgradeStatistics.h \
- ZYpp.h \
TranslatedText.h \
+ ZYpp.h \
+ ZYppCommitResult.h \
ZYppFactory.h \
ZYppCallbacks.h
#include <iosfwd>
#include "zypp/base/PtrTypes.h"
+#include "zypp/base/Deprecated.h"
#include "zypp/ResStore.h"
#include "zypp/Pathname.h"
static Target_Ptr nullimpl();
/** Refference to the RPM database */
target::rpm::RpmDb & rpmDb();
- /** Commit changes in the pool
+ /** Commit changes in the pool
* \param medianr 0 = all/any media
* > 0 means only the given media number
* return number of successfully committed resolvables
+ *
+ * \todo Interface to commit should be ZYpp::commit( medianr ). This call
+ * should be removed from the targets public interface, as soon as ZYpp::Impl
+ * is able to call Target::I,pl.
*/
int commit( ResPool pool_r, int medianr, PoolItemList & errors_r
- , PoolItemList & remaining_r, PoolItemList & srcremaining_r );
+ , PoolItemList & remaining_r, PoolItemList & srcremaining_r ) ZYPP_DEPRECATED;
/** If the package is installed and provides the file
Needed to evaluate split provides during Resolver::Upgrade() */
_pimpl->addResolvables (store);
}
+ ///////////////////////////////////////////////////////////////////
+
Target_Ptr ZYpp::target() const
{ return _pimpl->target(); }
void ZYpp::finishTarget()
{ _pimpl->finishTarget(); }
+ ZYpp::CommitResult ZYpp::commit( int medianr_r )
+ { return _pimpl->commit( medianr_r ); }
+
///////////////////////////////////////////////////////////////////
void ZYpp::setTextLocale( const Locale & textLocale_r )
//
// CLASS NAME : ZYpp
//
- /** */
+ /**
+ * \todo define Exceptions
+ */
class ZYpp : public base::ReferenceCounted, private base::NonCopyable
{
public:
void removeResolvables (const ResStore& store);
+ public:
/**
* \throws Exception
*/
*/
void finishTarget();
+
+ public:
+ /** Result returned from ZYpp::commit. */
+ struct CommitResult;
+
+ /** Commit changes and transactions.
+ * \param medianr 0 = all/any media
+ * > 0 means only the given media number
+ * \return \ref CommitResult
+ * \throws Exception
+ */
+ CommitResult commit( int medianr_r );
+
+ public:
/** */
Resolver_Ptr resolver() const;
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/ZYppCommitResult.h
+ *
+*/
+#ifndef ZYPP_ZYPPCOMMITRESULT_H
+#define ZYPP_ZYPPCOMMITRESULT_H
+
+#include <iosfwd>
+#include <list>
+
+#include "zypp/ZYpp.h"
+#include "zypp/PoolItem.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : ZYpp::CommitResult
+ //
+ /** Result returned from ZYpp::commit.
+ * \see \ref ZYpp::commit
+ * \todo document fields.
+ */
+ struct ZYpp::CommitResult
+ {
+ typedef std::list<PoolItem_Ref> PoolItemList;
+
+ int _result;
+ PoolItemList _errors;
+ PoolItemList _remaining;
+ PoolItemList _srcremaining;
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_ZYPPCOMMITRESULT_H
_target = 0;
}
+ /** \todo Remove workflow from target, lot's of it could be done here,
+ * and target used for transact. */
+ ZYpp::CommitResult ZYppImpl::commit( int medianr_r )
+ {
+ MIL << "Attempt to commit (medianr " << medianr_r << ")" << endl;
+ if (! _target)
+ ZYPP_THROW( Exception("Target not initialized.") );
+
+ ZYpp::CommitResult res;
+ // must redirect to Target::Impl. This kind of commit should not be
+ // in the Target interface.
+ res._result = _target->commit( pool(), medianr_r,
+ res._errors, res._remaining, res._srcremaining );
+
+ MIL << "Commit (medianr " << medianr_r << ") returned: "
+ << res._result
+ << " (errors " << res._errors.size()
+ << ", remaining " << res._remaining.size()
+ << ", srcremaining " << res._srcremaining.size()
+ << ")" << endl;
+ return res;
+ }
+
/******************************************************************
**
** FUNCTION NAME : operator<<
#include "zypp/Target.h"
#include "zypp/Resolver.h"
#include "zypp/Locale.h"
+#include "zypp/ZYppCommitResult.h"
///////////////////////////////////////////////////////////////////
namespace zypp
void removeResolvables (const ResStore& store);
+ public:
+ /** \todo Signal locale change. */
/**
* \throws Exception
*/
*/
void finishTarget();
+ /** Commit changes and transactions. */
+ ZYpp::CommitResult commit( int medianr_r );
+
public:
/** \todo Signal locale change. */
void setTextLocale( const Locale & textLocale_r )