Ignore:
Timestamp:
2017-04-07T18:20:11+12:00 (7 years ago)
Author:
ak19
Message:

Removed unwanted debugging now that Windows testing of the new SafeProcess.CustomProcessHandler related changes worked out successfully too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/build/GS2PerlConstructor.java

    r31591 r31592  
    335335        // http://www.cgi101.com/class/ch3/text.html
    336336        // setenv QUERY_STRING and REQUEST_METHOD = GET.
    337         // Run the perl command as a simple process: no logging to the collection's build log
    338337        if (runPerlCommand(command_str, envvars, new File(cgi_directory)))
    339338                   //new File(GlobalProperties.getGSDL3Home() + File.separator + "WEB-INF" + File.separator + "cgi")))
     
    402401    }
    403402
    404     // ModifyMetadata operations call runSimplePerlCommand which produces no output in build log
     403    // If you want to run a Perl command without doing GS2PerlConstructor's custom logging in the build log
     404    // The use the runSimplePerlCommand() versions, which use the default behaviour of running a SafeProcess
    405405    protected boolean runSimplePerlCommand(String[] command) { 
    406406    return runSimplePerlCommand(command, null, null);
     
    417417    sendMessage(new ConstructionEvent(this, GSStatus.INFO, "command = " + command_str));
    418418   
    419     logger.info("### Running simple command = " + command_str);
     419    ///logger.info("### Running simple command = " + command_str);
    420420
    421421    // This is where we create and run our perl process safely
     
    459459    sendMessage(new ConstructionEvent(this, GSStatus.INFO, "command = " + command_str));
    460460   
    461     logger.info("### Running logged command = " + command_str);
     461    ///logger.info("### Running logged command = " + command_str);
    462462
    463463    // This is where we create and run our perl process safely
     
    526526        // Now display final message based on exit value           
    527527       
    528         if (perlProcess.getExitValue() == 0) { 
    529         //status = OK;
     528        if (perlProcess.getExitValue() == 0) { //status = OK;
     529       
    530530        sendProcessStatus(new ConstructionEvent(this, GSStatus.CONTINUING, "Success"));
    531        
    532531        success = true;
    533         } else {
    534         //status = ERROR;
     532
     533        } else { //status = ERROR;
    535534        sendProcessStatus(new ConstructionEvent(this, GSStatus.ERROR, "Failure"));
    536        
    537         //return false;
    538535        success = false;
    539536       
    540537        }
    541     } else { // cancelled
     538    } else { // cancelled. The code would never come here, including in the old version of runPerlCommand
     539        // but leaving this here for an exact port of the old runPerlCommand to the new one which
     540        // uses SafeProcess. Also to allow the cancel functionality in future
    542541       
    543542        // I need to somehow kill the child process. Unfortunately Thread.stop() and Process.destroy() both fail to do this. But now, thankx to the magic of Michaels 'close the stream suggestion', it works fine.
    544543        sendProcessStatus(new ConstructionEvent(this, GSStatus.HALTED, "killing the process"));
    545         //prcs.getOutputStream().close();
    546         //prcs.destroy();
    547         ////status = ERROR;
    548        
    549         //return false;
    550544        success = false;
    551545    }
     
    752746            }
    753747           
    754 ///         System.out.println("@@@ GOT LINE: " + line);
    755 ///         GS2PerlConstructor.logger.info("@@@ GOT LINE: " + line + " STDOUT=1: " + source);
     748            ///System.out.println("@@@ GOT LINE: " + line);
     749
    756750
    757751            //if(this.source == STDERR) {
     
    814808        bwHandle.write(line + "\n");   
    815809       
    816 ///     System.out.println("@@@ WROTE LINE: " + line);
    817810///     GS2PerlConstructor.logger.info("@@@ WROTE LINE: " + line);
    818811
Note: See TracChangeset for help on using the changeset viewer.