[zypp-commit] r8921 - in /trunk/libzypp/zypp: CapAndItem.h RepoManager.cc target/TargetImpl.cc
Author: mlandres Date: Tue Feb 26 18:02:46 2008 New Revision: 8921 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8921&view=rev Log: provide exception history if solv file creation fails Modified: trunk/libzypp/zypp/CapAndItem.h trunk/libzypp/zypp/RepoManager.cc trunk/libzypp/zypp/target/TargetImpl.cc Modified: trunk/libzypp/zypp/CapAndItem.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/CapAndItem.h?rev=8921&r1=8920&r2=8921&view=diff ============================================================================== --- trunk/libzypp/zypp/CapAndItem.h (original) +++ trunk/libzypp/zypp/CapAndItem.h Tue Feb 26 18:02:46 2008 @@ -12,6 +12,8 @@ #ifndef ZYPP_CAPANDITEM_H #define ZYPP_CAPANDITEM_H +#include "zypp/base/Deprecated.h" + #include "zypp/PoolItem.h" #include "zypp/Capability.h" @@ -23,8 +25,11 @@ // // CLASS NAME : CapAndItem // - /** */ - struct CapAndItem + /** + * + * \deprecated no longer supported + */ + struct ZYPP_DEPRECATED CapAndItem { friend std::ostream & operator<<( std::ostream & str, const CapAndItem & obj ); public: Modified: trunk/libzypp/zypp/RepoManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.cc?rev=8921&r1=8920&r2=8921&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoManager.cc (original) +++ trunk/libzypp/zypp/RepoManager.cc Tue Feb 26 18:02:46 2008 @@ -287,7 +287,7 @@ // set the metadata path for the repo Pathname metadata_path = rawcache_path_for_repoinfo(_pimpl->options, (*it)); (*it).setMetadataPath(metadata_path); - + // set the downloaded packages path for the repo Pathname packages_path = packagescache_path_for_repoinfo(_pimpl->options, (*it)); (*it).setPackagesPath(packages_path); @@ -613,7 +613,7 @@ // ok we have the metadata, now exchange // the contents - + TmpDir oldmetadata( TmpDir::makeSibling( rawpath ) ); filesystem::rename( rawpath, oldmetadata.path() ); // move the just downloaded there @@ -740,20 +740,28 @@ case RepoType::RPMMD_e : case RepoType::YAST2_e : { - MIL << "Executing solv converter" << endl; // Take care we unlink the solvfile on exception ManagedFile guard( solvfile, filesystem::unlink ); - stringstream outputstr; - string cmd( str::form( "repo2solv.sh \"%s\" > \"%s\"", rawpath.c_str(), solvfile.c_str() ) ); - ExternalProgram prog( cmd, ExternalProgram::Stderr_To_Stdout ); + ostringstream cmd; + cmd << str::form( "repo2solv.sh \"%s\" > \"%s\"", rawpath.c_str(), solvfile.c_str() ); + + MIL << "Executing: " << cmd << endl; + ExternalProgram prog( cmd.str(), ExternalProgram::Stderr_To_Stdout ); + + cmd << endl; for ( string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() ) { - MIL << " " << output; - outputstr << output; + WAR << " " << output; + cmd << " " << output; } + int ret = prog.close(); if ( ret != 0 ) - ZYPP_THROW(RepoException(outputstr.str())); + { + RepoException ex(str::form("Failed to cache repo (%d).", ret)); + ex.remember( cmd.str() ); + ZYPP_THROW(ex); + } // We keep it. guard.resetDispose(); Modified: trunk/libzypp/zypp/target/TargetImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/TargetImpl.cc?rev=8921&r1=8920&r2=8921&view=diff ============================================================================== --- trunk/libzypp/zypp/target/TargetImpl.cc (original) +++ trunk/libzypp/zypp/target/TargetImpl.cc Tue Feb 26 18:02:46 2008 @@ -342,13 +342,20 @@ MIL << "Executing: " << cmd << endl; ExternalProgram prog( cmd.str(), ExternalProgram::Stderr_To_Stdout ); + + cmd << endl; for ( string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() ) { WAR << " " << output; + cmd << " " << output; } - int ret = prog.close(); + int ret = prog.close(); if ( ret != 0 ) - ZYPP_THROW(Exception(str::form("Failed to cache rpm database (%d).", ret))); + { + Exception ex(str::form("Failed to cache rpm database (%d).", ret)); + ex.remember( cmd.str() ); + ZYPP_THROW(ex); + } ret = filesystem::rename( tmpsolv, rpmsolv ); if ( ret != 0 ) -- 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