_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.") ) );
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 )
*/
//@{
/** 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 );
// 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.
}
/** 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 )