Make sure chrootCall with args list actually passes the args as list.

main
Teo Mrnjavac 11 years ago
parent 122a6036d5
commit e7e57689d8

@ -66,7 +66,8 @@ chroot_call( const boost::python::list& args,
list.append( QString::fromStdString(
boost::python::extract< std::string >( args[ i ] ) ) );
}
return CalamaresUtils::chrootCall( list.join( ' ' ),
return CalamaresUtils::chrootCall( list,
QString::fromStdString( stdin ),
timeout );
}

@ -55,7 +55,7 @@ int mount( const QString& devicePath,
return QProcess::execute( program, args );
}
int chrootCall( const QString& command,
int chrootCall( const QStringList& args,
const QString& stdInput,
int timeoutSec )
{
@ -68,11 +68,12 @@ int chrootCall( const QString& command,
return -3;
QString program( "chroot" );
QStringList args = { destDir, command };
QStringList arguments = { destDir };
arguments << args;
QProcess process;
process.setProgram( program );
process.setArguments( args );
process.setArguments( arguments );
if ( !process.waitForStarted() )
return -2;
@ -92,4 +93,15 @@ int chrootCall( const QString& command,
return process.exitCode();
}
int chrootCall( const QString& command,
const QString& stdInput,
int timeoutSec )
{
return chrootCall( QStringList() = { command },
stdInput,
timeoutSec );
}
}

@ -44,6 +44,10 @@ DLLEXPORT int mount( const QString& devicePath,
* -3 = bad arguments
* -4 = QProcess timeout
*/
DLLEXPORT int chrootCall( const QStringList& args,
const QString& stdInput = QString(),
int timeoutSec = 0 );
DLLEXPORT int chrootCall( const QString& command,
const QString& stdInput = QString(),
int timeoutSec = 0 );

Loading…
Cancel
Save