[zypp-commit] r8903 - /trunk/libzypp/zypp/target/TargetImpl.cc
Author: mlandres Date: Mon Feb 25 16:14:15 2008 New Revision: 8903 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8903&view=rev Log: more detailed error reporting Modified: trunk/libzypp/zypp/target/TargetImpl.cc Modified: trunk/libzypp/zypp/target/TargetImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/TargetImpl.cc?rev=8903&r1=8902&r2=8903&view=diff ============================================================================== --- trunk/libzypp/zypp/target/TargetImpl.cc (original) +++ trunk/libzypp/zypp/target/TargetImpl.cc Mon Feb 25 16:14:15 2008 @@ -329,35 +329,30 @@ filesystem::TmpFile tmpsolv( Pathname::assertprefix( _root, ZConfig::instance().repoCachePath() ) /*dir*/, sat::Pool::instance().systemRepoName() /* prefix */ ); + ostringstream cmd; + cmd << "rpmdb2solv"; - MIL << "Executing solv converter" << endl; + if ( ! _root.empty() ) + cmd << " -r '" << _root << "'"; - // FIXME add root to rpmdb2solv - ostringstream cmd; - cmd << "rpmdb2solv"; + if ( solvexisted ) + cmd << " '" << rpmsolv << "'"; - if ( ! _root.empty() ) - cmd << " -r '" << _root << "'"; - - if ( solvexisted ) - cmd << " '" << rpmsolv << "'"; - - cmd << " > '" << tmpsolv.path() << "'"; + cmd << " > '" << tmpsolv.path() << "'"; + MIL << "Executing: " << cmd << endl; ExternalProgram prog( cmd.str(), ExternalProgram::Stderr_To_Stdout ); for ( string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() ) { - MIL << " " << output; + WAR << " " << output; } int ret = prog.close(); if ( ret != 0 ) - ZYPP_THROW(Exception("Failed to cache rpm database")); + ZYPP_THROW(Exception(str::form("Failed to cache rpm database (%d).", ret))); ret = filesystem::rename( tmpsolv, rpmsolv ); - if ( ret != 0 ) ZYPP_THROW(Exception("Failed to move cache to final destination")); - // if this fails, don't bother throwing exceptions filesystem::chmod( rpmsolv, 0644 ); @@ -378,8 +373,9 @@ //now add the repos to the pool MIL << "adding " << rpmsolv << " to pool(" << sat::Pool::instance().systemRepoName() << ")"; - sat::Repo system = sat::Pool::instance().reposInsert(sat::Pool::instance().systemRepoName()); + sat::Repo system = sat::Pool::instance().systemRepo(); system.addSolv(rpmsolv); + MIL << "Target loaded: " << system.solvablesSize() << " resolvables" << endl; } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
mlandres@svn.opensuse.org