[zypp-commit] r11505 - in /branches/SuSE-Linux-11_0-Branch/libzypp: VERSION.cmake package/libzypp.changes zypp/RepoManager.cc
Author: mlandres Date: Mon Oct 27 14:56:24 2008 New Revision: 11505 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11505&view=rev Log: - Rewrote repo2solv.sh call to use execv, getting rid of any need for argument quoting. (#439058) Modified: branches/SuSE-Linux-11_0-Branch/libzypp/VERSION.cmake branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes branches/SuSE-Linux-11_0-Branch/libzypp/zypp/RepoManager.cc Modified: branches/SuSE-Linux-11_0-Branch/libzypp/VERSION.cmake URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-11_0-Branch/libzypp/VERSION.cmake?rev=11505&r1=11504&r2=11505&view=diff ============================================================================== --- branches/SuSE-Linux-11_0-Branch/libzypp/VERSION.cmake (original) +++ branches/SuSE-Linux-11_0-Branch/libzypp/VERSION.cmake Mon Oct 27 14:56:24 2008 @@ -47,4 +47,4 @@ SET(LIBZYPP_MAJOR "4") SET(LIBZYPP_MINOR "27") SET(LIBZYPP_COMPATMINOR "24") -SET(LIBZYPP_PATCH "3") +SET(LIBZYPP_PATCH "4") Modified: branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes?rev=11505&r1=11504&r2=11505&view=diff ============================================================================== --- branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes (original) +++ branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes Mon Oct 27 14:56:24 2008 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Mon Oct 27 14:51:59 CET 2008 - ma@suse.de + +- Rewrote repo2solv.sh call to use execv, getting rid of any need + for argument quoting. (#439058) +- revision 11505 +- version 4.27.4 + +------------------------------------------------------------------- Wed Oct 15 15:31:40 CEST 2008 - ma@suse.de - Fix quoting of arguments passed in repo2solv.sh calls (bnc #420046) Modified: branches/SuSE-Linux-11_0-Branch/libzypp/zypp/RepoManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-11_0-Branch/libzypp/zypp/RepoManager.cc?rev=11505&r1=11504&r2=11505&view=diff ============================================================================== --- branches/SuSE-Linux-11_0-Branch/libzypp/zypp/RepoManager.cc (original) +++ branches/SuSE-Linux-11_0-Branch/libzypp/zypp/RepoManager.cc Mon Oct 27 14:56:24 2008 @@ -18,7 +18,7 @@ #include <map> #include <algorithm> #include "zypp/base/InputStream.h" -#include "zypp/base/Logger.h" +#include "zypp/base/LogTools.h" #include "zypp/base/Gettext.h" #include "zypp/base/Function.h" #include "zypp/base/Regex.h" @@ -772,38 +772,42 @@ case RepoType::RPMMD_e : case RepoType::YAST2_e : case RepoType::RPMPLAINDIR_e : - { + { // Take care we unlink the solvfile on exception ManagedFile guard( solvfile, filesystem::unlink ); - ostringstream cmd; - std::string toFile( str::gsub(solvfile.asString(),"\"","\\\"") ); - if ( repokind.toEnum() == RepoType::RPMPLAINDIR_e ) - { - cmd << str::form( "repo2solv.sh '%s' > '%s'", - info.baseUrlsBegin()->getPathName().c_str(), - toFile.c_str() ); - } + std::string inputpath; + if ( repokind == RepoType::RPMPLAINDIR ) + // FIXME this does only work form dir: URLs + inputpath = info.baseUrlsBegin()->getPathName(); else - { - cmd << str::form( "repo2solv.sh '%s' > '%s'", - rawpath.asString().c_str(), - toFile.c_str() ); - } - MIL << "Executing: " << cmd.str() << endl; - ExternalProgram prog( cmd.str(), ExternalProgram::Stderr_To_Stdout ); + inputpath = rawpath.asString(); + + const char * cmd[] = { + "repo2solv.sh", + "-o", // repo2solv expects -o as 1st arg! + solvfile.asString().c_str(), + inputpath.c_str(), + NULL + }; - cmd << endl; - for ( string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() ) { + ExternalProgram prog( cmd, ExternalProgram::Stderr_To_Stdout ); + std::string errdetail; + + for ( std::string output( prog.receiveLine() ); output.length(); output = prog.receiveLine() ) { WAR << " " << output; - cmd << " " << output; + if ( errdetail.empty() ) { + errdetail = prog.command(); + errdetail += '\n'; + } + errdetail += output; } int ret = prog.close(); if ( ret != 0 ) { RepoException ex(str::form("Failed to cache repo (%d).", ret)); - ex.remember( cmd.str() ); + ex.remember( errdetail ); ZYPP_THROW(ex); } -- 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