make script execution abortable by user request.
authorMichael Andres <ma@suse.de>
Wed, 22 Nov 2006 14:46:49 +0000 (14:46 +0000)
committerMichael Andres <ma@suse.de>
Wed, 22 Nov 2006 14:46:49 +0000 (14:46 +0000)
zypp/target/TargetImpl.cc

index 09582915d65958c6b4a1bcfd77c7d94065b9eaf7..c7e42af323179125db202bae6a87091156c2eee6 100644 (file)
@@ -101,7 +101,11 @@ namespace zypp
         ExternalProgram prog( path.asString(), ExternalProgram::Stderr_To_Stdout, false, -1, true );
         for ( std::string output = prog.receiveLine(); output.length(); output = prog.receiveLine() )
         {
-          report->progress( ScriptResolvableReport::OUTPUT, output );
+          if ( ! report->progress( ScriptResolvableReport::OUTPUT, output ) )
+            {
+              WAR << "User request to abort script." << endl;
+              prog.kill(); // the rest is handled by exit code evaluation.
+            }
         }
 
         int exitCode = prog.close();