dnl Process this file with autoconf to produce a configure script.
dnl ==================================================
m4_include([VERSION])
-AC_INIT([zypp], [LIBZYPP_CURRENT.LIBZYPP_AGE.LIBZYPP_REVISION])
+AC_INIT([zypp], [LIBZYPP_CURRENT.LIBZYPP_REVISION.LIBZYPP_AGE])
dnl ==================================================
AC_CONFIG_SRCDIR(zypp/Makefile.am)
*/
int main( int argc, char * argv[] )
{
- //zypp::base::LogControl::instance().logfile( "xxx" );
+ //zypp::base::LogControl::instance().logfile( "log.restrict" );
INT << "===[START]==========================================" << endl;
ResPool pool( getZYpp()->pool() );
{
zypp::base::LogControl::TmpLineWriter shutUp;
getZYpp()->initTarget( sysRoot );
- //getZYpp()->addResolvables( getZYpp()->target()->resolvables(), true );
USR << "Added target: " << pool << endl;
}
pool::GetResolvablesToInsDel collect( pool );
MIL << "GetResolvablesToInsDel:" << endl << collect << endl;
- dumpRange( WAR << "toInstall: " << endl,
- collect._toInstall.begin(), collect._toInstall.end() ) << endl;
- dumpRange( ERR << "toDelete: " << endl,
- collect._toDelete.begin(), collect._toDelete.end() ) << endl;
+ if ( 1 )
+ {
+ // Collect until the 1st package from an unwanted media occurs.
+ // Further collection could violate install order.
+ bool hitUnwantedMedia = false;
+ PoolItemList::iterator fst=collect._toInstall.end();
+ for ( PoolItemList::iterator it = collect._toInstall.begin(); it != collect._toInstall.end(); ++it)
+ {
+ ResObject::constPtr res( it->resolvable() );
+
+ if ( hitUnwantedMedia
+ || ( res->sourceMediaNr() && res->sourceMediaNr() != 1 ) )
+ {
+ if ( !hitUnwantedMedia )
+ fst=it;
+ hitUnwantedMedia = true;
+ }
+ else
+ {
+ }
+ }
+ dumpRange( WAR << "toInstall1: " << endl,
+ collect._toInstall.begin(), fst ) << endl;
+ dumpRange( WAR << "toInstall2: " << endl,
+ fst, collect._toInstall.end() ) << endl;
+ dumpRange( ERR << "toDelete: " << endl,
+ collect._toDelete.begin(), collect._toDelete.end() ) << endl;
+ }
+ else
+ {
+ dumpRange( WAR << "toInstall: " << endl,
+ collect._toInstall.begin(), collect._toInstall.end() ) << endl;
+ dumpRange( ERR << "toDelete: " << endl,
+ collect._toDelete.begin(), collect._toDelete.end() ) << endl;
+ }
INT << "===[END]============================================" << endl << endl;
zypp::base::LogControl::instance().logNothing();
-------------------------------------------------------------------
+Mon May 22 20:51:59 CEST 2006 - ma@suse.de
+
+- Do not violate install order when restricting commit to a certain
+ mediaNumber. (#170079)
+- Version 1.1.0
+
+-------------------------------------------------------------------
Mon May 22 19:03:20 CEST 2006 - mvidner@suse.cz
- Added SourceManager::findSourceByUrl to overcome alias mismatches
///////////////////////////////////////////////////////////////////
//
+ // METHOD NAME : ResObject::dumpOn
+ // METHOD TYPE : std::ostream &
+ //
+ std::ostream & ResObject::dumpOn( std::ostream & str ) const
+ {
+ str << "[S" << source().numericId() << ":" << sourceMediaNr() << "]";
+ return Resolvable::dumpOn( str );
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ //
// ResObject interface forwarded to implementation
//
///////////////////////////////////////////////////////////////////
/** Dtor */
virtual ~ResObject();
+ /** Helper for stream output */
+ virtual std::ostream & dumpOn( std::ostream & str ) const;
+
private:
friend class detail::ImplConnect;
/** Access implementation */
///////////////////////////////////////////////////////////////////
std::ostream & Resolvable::dumpOn( std::ostream & str ) const
- {
- const ResObject * obj = dynamic_cast<const ResObject *>(this);
- if ( obj )
- {
- str << "[S" << obj->source().numericId() << ":" << obj->sourceMediaNr() << "]";
- }
- return _pimpl->dumpOn( str );
- }
+ { return _pimpl->dumpOn( str ); }
const Resolvable::Kind & Resolvable::kind() const
{ return _pimpl->kind(); }
- ZYppCommitResult TargetImpl::commit( ResPool pool_r, const ZYppCommitPolicy & policy_r )
+ ZYppCommitResult TargetImpl::commit( ResPool pool_r, const ZYppCommitPolicy & policy_rX )
{
+ // ----------------------------------------------------------------- //
+ // Fake outstanding YCP fix: Honour restriction to media 1
+ // at installation, but install all remaining packages if post-boot.
+ ZYppCommitPolicy policy_r( policy_rX );
+ if ( policy_r.restrictToMedia() > 1 )
+ policy_r.allMedia();
+ // ----------------------------------------------------------------- //
+
MIL << "TargetImpl::commit(<pool>, " << policy_r << ")" << endl;
ZYppCommitResult result;
#warning Commit does not provide ZYppCommitResult::_errors
TargetImpl::PoolItemList current_install;
TargetImpl::PoolItemList current_srcinstall;
+ // Collect until the 1st package from an unwanted media occurs.
+ // Further collection could violate install order.
+ bool hitUnwantedMedia = false;
for (TargetImpl::PoolItemList::iterator it = to_install.begin(); it != to_install.end(); ++it)
{
- Resolvable::constPtr res( it->resolvable() );
- Package::constPtr pkg( asKind<Package>(res) );
- if (pkg && policy_r.restrictToMedia() != pkg->sourceMediaNr()) // check medianr for packages only
- {
- XXX << "Package " << *pkg << ", wrong media " << pkg->sourceMediaNr() << endl;
- result._remaining.push_back( *it );
- }
+ ResObject::constPtr res( it->resolvable() );
+
+ if ( hitUnwantedMedia
+ || ( res->sourceMediaNr() && res->sourceMediaNr() != policy_r.restrictToMedia() ) )
+ {
+ hitUnwantedMedia = true;
+ result._remaining.push_back( *it );
+ }
else
- {
- current_install.push_back( *it );
- }
+ {
+ current_install.push_back( *it );
+ }
}
+
TargetImpl::PoolItemList bad = commit( current_install, policy_r, pool_r );
result._remaining.insert(result._remaining.end(), bad.begin(), bad.end());