Changeset 27668
- Timestamp:
- 2013-06-19T22:00:17+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/nightly-tasks/diffcol/trunk/task.pl
r27667 r27668 38 38 # TASK_HOME should be the toplevel diffcol folder 39 39 $ENV{'TASK_HOME'} = getcwd unless defined $ENV{'TASK_HOME'}; 40 $ENV{'TASK_HOME'} =~ s@\/@\\@g if $isWin; 40 41 ## print STDERR "@@@ TASK_HOME: ".$ENV{'TASK_HOME'}."\n"; 41 42 42 43 43 $ENV{'DATA_DIR'} = filename_concat($ENV{'TASK_HOME'}, "diffcol-data");44 $ENV{'UPLOAD_DIR'} = filename_concat($ENV{'TASK_HOME'}, "diffcol-reports");44 $ENV{'DATA_DIR'} = &filename_concat($ENV{'TASK_HOME'}, "diffcol-data"); 45 $ENV{'UPLOAD_DIR'} = &filename_concat($ENV{'TASK_HOME'}, "diffcol-reports"); 45 46 $ENV{'MONITOR_EMAIL'} = "greenstone_team\@cs.waikato.ac.nz"; # need to escape @ sign 46 47 $ENV{'GSDL_SMTP'} = ""; … … 115 116 my @files = <$jar_lib_path/*.jar>; # /full/path/to/diffcol/lib/*jar 116 117 foreach my $file (@files) { 118 $file =~ s@\/@\\@g if $isWin; 117 119 $ENV{'CLASSPATH'}=$file.$pathsep.$ENV{'CLASSPATH'}; 118 120 } … … 169 171 print STDERR "Run as: $0 (help|setup_greenstone|run_test|summarise|upload|all)\n"; 170 172 } 171 172 173 173 174 #http://stackoverflow.com/questions/7427262/read-a-file-and-save-it-in-variable-using-shell-script … … 208 209 # http://stackoverflow.com/questions/758611/how-to-flush-output-in-backticks-in-perl?rq=1 209 210 my $status = system "$cmd"; #my $status = `$cmd`; 211 if($status != 0) { 212 print STDERR "@@@ SVN checkout of $gsdl failed\n"; 213 exit -1; 214 } 210 215 print STDERR "done\n"; 211 216 … … 216 221 ##print STDERR "@@@ OS: $^O.|".$Config{'archname64'}."|\n"; 217 222 218 # if we're on linux/darwin, need gnome-lib for the correct architecture. 219 if(!$isWin) { 220 223 224 if($isWin) { 225 print STDERR "Compiling $gsdl using makegs2.bat running in auto (silent) mode\n"; 226 227 # we're now in the GS2 folder, call makegs2 with silent param 228 $cmd = "makegs2.bat silent 2>> $ENV{'DATA_DIR'}/compilation-errors"; # STDERR is sent to compilation-errors file 229 $status = system $cmd; 230 231 } else { # if we're on linux/darwin, need gnome-lib for the correct architecture. 232 221 233 print STDERR "setting up gnome-lib-minimal for compilation\n"; 222 234 … … 282 294 283 295 $cmd .= "\""; # close off cmd to bash and run it 284 system $cmd; 285 } 286 296 $status = system $cmd; 297 } 298 299 if($status != 0) { 300 print STDERR "@@@ Compile failed\n"; 301 exit -1; 302 } 303 287 304 # set the path to the greenstone_home variable 288 305 $greenstone_home="$ENV{'DATA_DIR'}$sep$gsdl"; … … 293 310 sub run_test 294 311 { 295 open (my $xml_fh, '>'.$xmlout) || die "Could not open xml file $xmlout for appending: $!\n"; 312 open (my $xml_fh, '>'.$xmlout) || die "Could not open xml file $xmlout for appending: $!\n"; 296 313 297 314 # perform the requested subcommands, outputting xml information … … 309 326 print STDERR "getting svn info: $xmlout\n"; 310 327 print $xml_fh "<svn-info>\n"; 311 run_and_print_cmd("svn info", $xml_fh);328 &run_and_print_cmd("svn info", $xml_fh); 312 329 print $xml_fh "</svn-info>\n"; 313 330 print STDERR "done\n"; … … 405 422 406 423 } else { # Need to prefix cmd -c/-k as necessary 407 $cmd = "cd $greenstone_home && set GSDLHOME=&& source $setup_script.bat && cd $diffcol_dir && $cmd"; 424 $cmd = "cmd /c \"set GSDLHOME=&& $setup_script.bat && cd $diffcol_dir && perl -S $cmd\""; 425 ## print STDERR "@@@@ Going to call command: $cmd\n"; 408 426 } 409 427 … … 422 440 423 441 } else { # Need to prefix cmd -c/-k as necessary 424 $cmd = "set GSDLHOME=&& source $setup_script.bat && $cmd"; 425 } 426 427 return system($cmd); 442 $cmd = "cmd /c \"set GSDLHOME=&& $setup_script.bat && perl -S $cmd\""; 443 ## print STDERR "@@@@ Going to call command: $cmd\n"; 444 445 } 446 447 return system($cmd); 428 448 #return &run_and_print_cmd($cmd, $fh); # doesn't work on cmds chained with bash -c 429 449 } … … 630 650 ##system("/bin/bash -c \"./task @ARGV\""); 631 651 ##print STDERR "/bin/bash -c ../etc/tasks/diffcol/task @ARGV" 652
Note:
See TracChangeset
for help on using the changeset viewer.