-------------------------------------------------------------------
+Fri Apr 21 12:17:27 CEST 2006 - mvidner@suse.cz
+
+- when installing a xml-store resolvable (all except package,
+ message, script), delete older versions (#160792).
+- rev 3164
+
+-------------------------------------------------------------------
Thu Apr 20 14:10:41 CEST 2006 - kkaempf@suse.de
- properly clear transaction flag after successful commit
#include "zypp/target/TargetImpl.h"
#include "zypp/target/TargetCallbackReceiver.h"
+#include "zypp/solver/detail/Helper.h"
#include "zypp/solver/detail/InstallOrder.h"
using namespace std;
+using zypp::solver::detail::Helper;
using zypp::solver::detail::InstallOrder;
///////////////////////////////////////////////////////////////////
MIL << "Restrict to media number " << policy_r.restrictToMedia() << endl;
}
- commit (to_uninstall, policy_r );
+ commit (to_uninstall, policy_r, pool_r );
if (policy_r.restrictToMedia() == 0) { // commit all
- result._remaining = commit( to_install, policy_r );
- result._srcremaining = commit( to_srcinstall, policy_r );
+ result._remaining = commit( to_install, policy_r, pool_r );
+ result._srcremaining = commit( to_srcinstall, policy_r, pool_r );
}
else
{
current_install.push_back( *it );
}
}
- TargetImpl::PoolItemList bad = commit( current_install, policy_r );
+ TargetImpl::PoolItemList bad = commit( current_install, policy_r, pool_r );
result._remaining.insert(result._remaining.end(), bad.begin(), bad.end());
for (TargetImpl::PoolItemList::iterator it = to_srcinstall.begin(); it != to_srcinstall.end(); ++it)
current_srcinstall.push_back( *it );
}
}
- bad = commit( current_srcinstall, policy_r );
+ bad = commit( current_srcinstall, policy_r, pool_r );
result._srcremaining.insert(result._srcremaining.end(), bad.begin(), bad.end());
}
TargetImpl::PoolItemList
TargetImpl::commit( const TargetImpl::PoolItemList & items_r,
- const ZYppCommitPolicy & policy_r )
+ const ZYppCommitPolicy & policy_r,
+ const ResPool & pool_r )
{
TargetImpl::PoolItemList remaining;
}
else
{
+ // #160792 do not just add, also remove older versions
+ if (true) // !installOnly - only on Package?!
+ {
+ for (PoolItem_Ref old = Helper::findInstalledItem (pool_r, *it); old; )
+ {
+ _storage.deleteObject(old.resolvable());
+ }
+ }
_storage.storeObject(it->resolvable());
}
success = true;
void enableStorage(const Pathname &root_r);
/** Commit ordered changes
- return uncommitted ones (due to error) */
- PoolItemList commit( const PoolItemList & items_r, const ZYppCommitPolicy & policy_r );
+ * @param pool_r only needed for #160792
+ * @return uncommitted ones (due to error)
+ */
+ PoolItemList commit( const PoolItemList & items_r, const ZYppCommitPolicy & policy_r, const ResPool & pool_r );
/** Overload to realize stream output. */
virtual std::ostream & dumpOn( std::ostream & str ) const