Author: mlandres Date: Wed Mar 5 11:35:21 2008 New Revision: 9015 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9015&view=rev Log: Try to rebuild broken solv files in Target::load. Modified: trunk/libzypp/devel/devel.ma/NewPool.cc trunk/libzypp/package/libzypp.changes trunk/libzypp/zypp/target/TargetImpl.cc trunk/libzypp/zypp/target/TargetImpl.h Modified: trunk/libzypp/devel/devel.ma/NewPool.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/NewPool.cc?rev=9015&r1=9014&r2=9015&view=diff ============================================================================== --- trunk/libzypp/devel/devel.ma/NewPool.cc (original) +++ trunk/libzypp/devel/devel.ma/NewPool.cc Wed Mar 5 11:35:21 2008 @@ -508,7 +508,7 @@ } } - if ( 0 ) + if ( 1 ) { Measure x( "INIT TARGET" ); { Modified: trunk/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=9015&r1=9014&r2=9015&view=diff ============================================================================== --- trunk/libzypp/package/libzypp.changes (original) +++ trunk/libzypp/package/libzypp.changes Wed Mar 5 11:35:21 2008 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Wed Mar 5 11:33:26 CET 2008 - ma@suse.de + +- Try to rebuild broken solv files in Target::load. +- revision 9015 + +------------------------------------------------------------------- Tue Mar 4 18:17:41 CET 2008 - ma@suse.de - Try to rebuild broken solv files in RepoManager::loadFromCache. Modified: trunk/libzypp/zypp/target/TargetImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/TargetImpl.cc?rev=9015&r1=9014&r2=9015&view=diff ============================================================================== --- trunk/libzypp/zypp/target/TargetImpl.cc (original) +++ trunk/libzypp/zypp/target/TargetImpl.cc Wed Mar 5 11:35:21 2008 @@ -286,6 +286,13 @@ MIL << "Targets closed" << endl; } + void TargetImpl::clearCache() + { + Pathname base = Pathname::assertprefix( _root, + ZConfig::instance().repoCachePath() / sat::Pool::instance().systemRepoName() ); + filesystem::unlink( base.extend(".solv") ); + filesystem::unlink( base.extend(".cookie") ); + } void TargetImpl::buildCache() { @@ -379,9 +386,22 @@ sat::Pool satpool( sat::Pool::instance() ); Repository system( satpool.systemRepo() ); Pathname rpmsolv( Pathname::assertprefix( _root, ZConfig::instance().repoCachePath() + system.name() ).extend(".solv") ); - MIL << "adding " << rpmsolv << " to pool(" << system.name() << ")"; + MIL << "adding " << rpmsolv << " to pool(" << system.name() << ")" << endl; #warning PROBABLY CLEAR NONEMTY SYSTEM REPO - system.addSolv( rpmsolv ); + + try + { + system.addSolv( rpmsolv ); + } + catch ( const Exception & exp ) + { + ZYPP_CAUGHT( exp ); + MIL << "Try to handle exception by rebuilding the solv-file" << endl; + clearCache(); + buildCache(); + + system.addSolv( rpmsolv ); + } // (Re)Load the requested locales. // If the requested locales are empty, we leave the pool untouched Modified: trunk/libzypp/zypp/target/TargetImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/TargetImpl.h?rev=9015&r1=9014&r2=9015&view=diff ============================================================================== --- trunk/libzypp/zypp/target/TargetImpl.h (original) +++ trunk/libzypp/zypp/target/TargetImpl.h Wed Mar 5 11:35:21 2008 @@ -70,6 +70,8 @@ void load(); + void clearCache(); + void buildCache(); public: -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org