QString tmpDirName() { return QString( "/INSTALLWORK" ) + QString::number( getpid() ); }
#define TEMPDIRNAME tmpDirName()
+// uncomment next line to redirect all shell output (usually for errors) to /dev/null device
+// #define USE_DEV_NULL
+
// ================================================================
/*!
* Script
if ( !fi.exists() ) {
// VSR: Create directory and set permissions to allow other users to remove it
Script script;
- script << "mkdir" << QUOTE( fi.absFilePath() ) << ">& /dev/null" << "&&";
- script << "chmod 777" << QUOTE( fi.absFilePath() ) << ">& /dev/null";
+ script << "mkdir" << QUOTE( fi.absFilePath() );
+#ifdef USE_DEV_NULL
+ script << ">& /dev/null";
+#endif
+ script << "&&";
+ script << "chmod 777" << QUOTE( fi.absFilePath() );
+#ifdef USE_DEV_NULL
+ script << ">& /dev/null";
+#endif
___MESSAGE___( "script = " << script.script().latin1() );
if ( system( script.script().latin1() ) )
return false;
if ( !QFileInfo( aDir ).exists() ) {
// VSR: Create directory, other users should NOT have possibility to remove it!!!
Script script;
- script << "mkdir" << QUOTE( aDir ) << ">& /dev/null";
+ script << "mkdir" << QUOTE( aDir );
+#ifdef USE_DEV_NULL
+ script << ">& /dev/null";
+#endif
___MESSAGE___( "script = " << script.script().latin1() );
if ( system( script.script().latin1() ) )
return false;
int PID = (int)shellProcess->processIdentifier();
if ( PID > 0 ) {
Script script;
- script << "kill -9" << QString::number( PID ) << ">& /dev/null";
+ script << "kill -9" << QString::number( PID );
+#ifdef USE_DEV_NULL
+ script << ">& /dev/null";
+#endif
___MESSAGE___( "script: " << script.script().latin1() );
if ( system( script.script().latin1() ) ) {
// error
script << (*it).script() << "execute";
script << QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() );
script << QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() );
+#ifdef USE_DEV_NULL
script << ">& /dev/null";
+#endif
___MESSAGE___( "script: " << script.script().latin1() );
if ( (*it).script().isEmpty() || system( script.script().latin1() ) ) {
QMessageBox::warning( this,
script << "cd" << QUOTE( rd.filePath( "config_files" ) ) << ";";
script << "remove_tmp.sh" << QUOTE( tempFolder->text().stripWhiteSpace() + TEMPDIRNAME );
script << QUOTE( getAllProducts( productsMap ) );
+#ifdef USE_DEV_NULL
script << ">& /dev/null";
+#endif
___MESSAGE___( "script = " << script.script().latin1() );
if ( system( script.script().latin1() ) ) {
// error
if ( rmDir && !tmpCreated.isNull() ) {
script.clear();
script << "rm -rf" << QUOTE( tmpCreated );
+#ifdef USE_DEV_NULL
script << ">& /dev/null";
+#endif
if ( system( script.script().latin1() ) ) {
// error
}
script << (*it).script() << "check_enabled";
script << QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() );
script << QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() );
+#ifdef USE_DEV_NULL
script << ">& /dev/null";
+#endif
___MESSAGE___( "script: " << script.script().latin1() );
(*it).button()->setEnabled( !(*it).script().isEmpty() && !system( script.script().latin1() ) );
}