Author: mlandres Date: Mon Feb 4 20:23:17 2008 New Revision: 8463 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8463&view=rev Log: throw if solv file loading fails Modified: branches/tmp/ma/jump_sat/libzypp/zypp/sat/Repo.cc branches/tmp/ma/jump_sat/libzypp/zypp/sat/Repo.h branches/tmp/ma/jump_sat/libzypp/zypp/sat/detail/PoolImpl.h Modified: branches/tmp/ma/jump_sat/libzypp/zypp/sat/Repo.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/sat/Repo.cc?rev=8463&r1=8462&r2=8463&view=diff ============================================================================== --- branches/tmp/ma/jump_sat/libzypp/zypp/sat/Repo.cc (original) +++ branches/tmp/ma/jump_sat/libzypp/zypp/sat/Repo.cc Mon Feb 4 20:23:17 2008 @@ -99,6 +99,7 @@ _id = detail::noRepoId; } +#warning NEED POOL MANIP EXEPTIONS void Repo::addSolv( const Pathname & file_r ) { NO_REPO_THROW( Exception( _("Can't add solvables to norepo.") ) ); @@ -107,10 +108,13 @@ if ( file == NULL ) { file.resetDispose(); - ZYPP_THROW( Exception( _("Can't read solv-file: ")+file_r.asString() ) ); + ZYPP_THROW( Exception( _("Can't open solv-file: ")+file_r.asString() ) ); } - myPool()._addSolv( _repo, file ); + if ( myPool()._addSolv( _repo, file ) != 0 ) + { + ZYPP_THROW( Exception( _("Error reading solv-file: ")+file_r.asString() ) ); + } } detail::SolvableIdType Repo::addSolvables( unsigned count_r ) Modified: branches/tmp/ma/jump_sat/libzypp/zypp/sat/Repo.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/sat/Repo.h?rev=8463&r1=8462&r2=8463&view=diff ============================================================================== --- branches/tmp/ma/jump_sat/libzypp/zypp/sat/Repo.h (original) +++ branches/tmp/ma/jump_sat/libzypp/zypp/sat/Repo.h Mon Feb 4 20:23:17 2008 @@ -90,7 +90,9 @@ */ //@{ /** Load \ref Solvables from a solv-file. + * In case of an exception the repo remains in the \ref Pool. * \throws Exception if loading the solv-file fails. + * \see \ref Pool::addRepoSolv and \ref Repo::EraseFromPool */ void addSolv( const Pathname & file_r ); @@ -130,6 +132,7 @@ // CLASS NAME : Repo::EraseFromPool // /** Functor removing \ref Repo from it's \ref Pool. + * * E.g. used as dispose function in. \ref AutoDispose * to provide a convenient and exception safe temporary * \ref Repo. Modified: branches/tmp/ma/jump_sat/libzypp/zypp/sat/detail/PoolImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/sat/detail/PoolImpl.h?rev=8463&r1=8462&r2=8463&view=diff ============================================================================== --- branches/tmp/ma/jump_sat/libzypp/zypp/sat/detail/PoolImpl.h (original) +++ branches/tmp/ma/jump_sat/libzypp/zypp/sat/detail/PoolImpl.h Mon Feb 4 20:23:17 2008 @@ -90,10 +90,10 @@ } /** Adding solv file to a repo. */ - void _addSolv( ::_Repo * repo_r, FILE * file_r ) + int _addSolv( ::_Repo * repo_r, FILE * file_r ) { setDirty(__FUNCTION__, repo_r->name ); - ::repo_add_solv( repo_r , file_r ); + return ::repo_add_solv( repo_r , file_r ); } /** Adding Solvables to a repo. */ detail::SolvableIdType _addSolvables( ::_Repo * repo_r, unsigned count_r ) -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org