Changeset 28661
- Timestamp:
- 2013-11-20T17:34:45+13:00 (10 years ago)
- Location:
- other-projects/nightly-tasks/diffcol/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/nightly-tasks/diffcol/trunk/diffcol/diffcol.pl
r28609 r28661 50 50 my ($gv_test_os, $gv_model_os); # still just file globals 51 51 52 $gv_strModelColRoot = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"/model-collect"); 53 $gv_strTestColRoot = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"/collect"); 52 if($ENV{'GSDL3SRCHOME'}) { 53 $gv_strModelColRoot = &FileUtils::filenameConcatenate($ENV{'GSDL3SRCHOME'},"web","sites","localsite","/model-collect"); 54 $gv_strTestColRoot = &FileUtils::filenameConcatenate($ENV{'GSDL3SRCHOME'},"web","sites","localsite","/collect"); 55 } else { 56 $gv_strModelColRoot = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"/model-collect"); 57 $gv_strTestColRoot = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"/collect"); 58 } 54 59 55 60 $gv_blnErrorStop = "false"; -
other-projects/nightly-tasks/diffcol/trunk/diffcol/gdbdiff.pm
r28238 r28661 34 34 } 35 35 36 sub read_db 37 { 38 # need to sort text output of both test and model col database files, to normalise them for the comparison 39 # the -sort option to db2txt was added specifically to support diffcol 40 my($db_file) = @_; 41 my $db_cmd = "db2txt -sort $db_file 2>&1"; 42 if($db_file =~ m/\.jdb$/) { 43 print STDERR "NOT YET IMPLEMENTED\n"; 44 #$db_cmd = "jdb2txt -sort $db_file 2>&1"; 45 } 46 47 my $db_text = readin_gdb($db_cmd); 48 return $db_text; 49 } 50 51 sub text_to_db_to_text 52 { 53 my($db_text, $db_filename) = @_; 54 55 # http://stackoverflow.com/questions/1909262/how-can-i-pipe-input-into-a-java-command-from-perl 56 open PIPE, "| txt2db $db_filename"; 57 print PIPE "$db_text"; 58 close(PIPE); 59 60 return &read_db("$db_filename"); 61 } 62 36 63 # for debugging. Prints txt contents of db to file 37 64 sub print_string_to_file 38 65 { 39 40 41 66 my ($text, $outfile) = @_; 67 68 open(FOUT, ">$outfile") or die "ERROR failed to write to $outfile: $!\n"; 42 69 print FOUT $text; 43 70 close(FOUT); … … 51 78 my ($dbname, $dirname, $suffix)= &File::Basename::fileparse($full_testdb, "\\.[^\\.]+\$"); 52 79 53 # need to sort text output of both test and model col database files, to normalise them for the comparison 54 # the -sort option to db2txt was added specifically to support diffcol 55 my $model_cmd = "db2txt -sort $full_modeldb 2>&1"; 56 my $test_cmd = "db2txt -sort $full_testdb 2>&1"; 57 58 my $model_text = readin_gdb($model_cmd); 59 my $test_text = readin_gdb($test_cmd); 80 my $model_text = read_db($full_modeldb); 81 my $test_text = read_db($full_testdb); 60 82 61 83 # my $savepath = &getcwd."/../"; # TASK_HOME env var does not exist at this stage, but it's one level up from current directory … … 244 266 # so that we get the tmp files in the same order in both model and test collections 245 267 246 # http://stackoverflow.com/questions/1909262/how-can-i-pipe-input-into-a-java-command-from-perl 247 open PIPE, "| txt2db model.gdb"; 248 print PIPE "$model_text"; 249 close(PIPE); 250 open PIPE, "| txt2db test.gdb"; 251 print PIPE "$test_text"; 252 close(PIPE); 253 254 $model_cmd = " db2txt -sort model.gdb 2>&1"; 255 $test_cmd = "db2txt -sort test.gdb 2>&1"; 256 $model_text = readin_gdb($model_cmd); 257 $test_text = readin_gdb($test_cmd); 268 $model_text = text_to_db_to_text($model_text, "model.gdb"); 269 $test_text = text_to_db_to_text($test_text, "test.gdb"); 258 270 } 259 271 -
other-projects/nightly-tasks/diffcol/trunk/task.pl
r28634 r28661 47 47 my $pathsep = $isWin ? ";" : ":"; 48 48 #my $script_ext = $isWin ? ".bat" : ".bash"; 49 my $setup_script = "setup"; # needs tobecome gs3-setup for GS349 my $setup_script = "setup"; # will become gs3-setup for GS3 50 50 my $use_blat = 0; # if we ever get blat to send mail/attachments on Windows working, set this to 1 51 51 … … 126 126 } elsif($ARGV[$i] =~ m/--gs(2|3)/) { 127 127 $install_version = $1; 128 $setup_script = $install_version eq "3" ? "gs3-setup" : "setup"; # needs to become gs3-setup for GS3 128 129 splice @ARGV, $i, 1; # remove the element from the argument array 129 130 } … … 190 191 } 191 192 192 #print STDERR "Install type $install_type\n"; 193 #print STDERR "Install version $install_version\n"; 194 193 print STDERR "Install type $install_type\n"; 194 print STDERR "Install version $install_version\n"; 195 195 196 196 #check key environment vars are set … … 239 239 240 240 #set the location of the full report 241 my $xmlout=filename_concat($ENV{'DATA_DIR'}, "full-report-$ dateid.xml");241 my $xmlout=filename_concat($ENV{'DATA_DIR'}, "full-report-$install_version-$dateid.xml"); 242 242 ##print STDERR "XML: $xmlout\n"; 243 243 244 244 # the toplevel folder of the greenstone installation being used 245 my $greenstone_home=""; 245 my $greenstone3_home=""; 246 my $greenstone_home=""; # gs2build for gs3, toplevel install folder for gs2 246 247 # gsdl is the checkout folder and can be greenstone2 or greenstone3 247 248 my $gsdl="greenstone2"; 248 249 249 250 250 # Check if using existing compiled-up greenstone installation 251 251 # and set the greenstone_home location accordingly … … 253 253 if(defined $ENV{'GSDL3SRCHOME'} || defined $ENV{'GSDLHOME'}) { 254 254 print STDERR "Found existing Greenstone home, will use that instead\n"; 255 $greenstone_home=$ENV{'GSDLHOME'}; 255 $greenstone_home=$ENV{'GSDLHOME'} if defined $ENV{'GSDLHOME'}; 256 257 if(defined $ENV{'GSDL3SRCHOME'}) { 258 print STDERR "*** GSDL3SRCHOME set, changing to using installed GS3\n"; 259 $gsdl = "greenstone3"; 260 $install_version = "3"; 261 $greenstone3_home=$ENV{'GSDL3SRCHOME'}; 262 $greenstone_home=filename_concat($greenstone3_home, "gs2build") unless defined $ENV{'GSDLHOME'}; 263 } 256 264 } else { 257 $greenstone_home=filename_concat($ENV{'DATA_DIR'}, $gsdl); 265 if($install_version eq "3") { 266 $gsdl = "greenstone3"; 267 $greenstone3_home=filename_concat($ENV{'DATA_DIR'}, $gsdl); 268 $greenstone_home=filename_concat($greenstone3_home, "gs2build"); 269 } else { 270 $greenstone_home=filename_concat($ENV{'DATA_DIR'}, $gsdl); 271 } 258 272 } 259 273 ##print STDERR "GSHOME: $greenstone_home\n"; … … 300 314 sub setup_greenstone 301 315 { 316 if($install_version eq "3" && !defined $ENV{'JAVA_HOME'}) { 317 print "*** JAVA_HOME not set. Set it and add its bin folder to the PATH\n"; 318 exit 0; 319 } 320 302 321 #clean up from previous tests 303 322 print STDERR "about to clean up any old tests (Ctrl-C to cancel)"; # no newline … … 310 329 # http://perldoc.perl.org/File/Path.html 311 330 print STDERR "cleaning up previous tests\n"; 312 &File::Path::remove_tree($ENV{'DATA_DIR'}); 313 331 #&File::Path::remove_tree($ENV{'DATA_DIR'}); 332 if(-d $greenstone_home && $install_version eq "2") { 333 &File::Path::remove_tree($greenstone_home); 334 } 335 if(-d $greenstone3_home && $install_version eq "3") { 336 &File::Path::remove_tree($greenstone3_home); 337 } 338 unlink glob "$ENV{'DATA_DIR'}$sep"."*report-$install_version*"; 339 unlink "$ENV{'DATA_DIR'}$sep"."compilation-errors"; 314 340 print STDERR "creating the data dir\n"; 315 &File::Path::make_path($ENV{'DATA_DIR'}); # works like mkdir -p341 #&File::Path::make_path($ENV{'DATA_DIR'}); # works like mkdir -p 316 342 317 343 chdir($ENV{'DATA_DIR'}); … … 324 350 325 351 # Else checkout a GS from svn into DATA_DIR 352 if($install_type eq "svn") { 353 &checkout_gs_from_svn(); 354 ##print STDERR "$ENV{'DATA_DIR'}$sep$gsdl\n"; 355 356 if($install_version eq "2") { 357 &compile_gs2_svn(); 358 } else { 359 &compile_gs3_svn(); 360 } 361 } 362 363 } 364 365 sub checkout_gs_from_svn { 326 366 327 367 #svn checkout of main gsdl directory 328 368 print STDERR "checkout $gsdl:\n"; 329 my $cmd = "svn co ".$ENV{'SVN_OPT_REV'}." http://svn.greenstone.org/main/trunk/greenstone 2$gsdl";369 my $cmd = "svn co ".$ENV{'SVN_OPT_REV'}." http://svn.greenstone.org/main/trunk/greenstone$install_version $gsdl"; 330 370 ##print STDERR "Checkout CMD: $cmd\n"; 331 371 … … 333 373 # http://stackoverflow.com/questions/758611/how-to-flush-output-in-backticks-in-perl?rq=1 334 374 my $status = system "$cmd"; #my $status = `$cmd`; 335 336 337 338 375 if($status != 0) { 376 print STDERR "@@@ SVN checkout of $gsdl failed\n"; 377 exit -1; 378 } 339 379 print STDERR "done\n"; 340 341 ##print STDERR "$ENV{'DATA_DIR'}$sep$gsdl\n"; 342 343 chdir("$ENV{'DATA_DIR'}$sep$gsdl"); 344 345 ##print STDERR "@@@ OS: $^O.|".$Config{'archname64'}."|\n"; 346 347 if($isWin) { 348 print STDERR "Compiling $gsdl using makegs2.bat running in auto (silent) mode\n"; 349 350 # we're now in the GS2 folder, call makegs2 with silent param 351 $cmd = "makegs2.bat silent 2>> $ENV{'DATA_DIR'}/compilation-errors"; # STDERR is sent to compilation-errors file 352 $status = system $cmd; 353 if($status != 0) { 354 print STDERR "Greenstone compilation on Windows failed\n"; 355 exit -1; 356 } 357 358 } else { # if we're on linux/darwin, need gnome-lib for the correct architecture. And need imagemagick to build imgs in collections 380 } 381 382 sub getImageMagickBins { 383 my ($cmd, $status); 384 my $imagickzip = ""; 385 386 chdir ("$greenstone_home"); 387 if(!$isWin) { # if we're on linux/darwin, need gnome-lib for the correct architecture. And need imagemagick to build imgs in collections 359 388 360 389 my $bit_arch=`uname -m`; 361 362 # imag magick binary390 391 # imagemagick binary 363 392 print STDERR "Getting imagemagick binary\n"; 364 393 365 394 my $os = $isMac ? "darwin" : "linux"; 366 my$imagickzip = "imagemagick-$os";395 $imagickzip = "imagemagick-$os"; 367 396 368 397 if($isMac) { 369 # 398 # $imagickzip .= "-10.5.tar.gz"; 370 399 # at present, only the Imagemagick binaries created by Max for darwin work on the Macs 371 &File::Path::make_path($ENV{'DATA_DIR'}."$sep$gsdl$sep$os"); # need to ensure gsdl/bin/darwin exists400 # &File::Path::make_path("$greenstone_home$sep"."bin"."$sep$os"); # need to ensure gsdl/bin/darwin exists 372 401 $cmd = "svn export http://svn.greenstone.org/main/trunk/binaries/mac/intel/imagemagick bin/darwin/imagemagick"; 373 402 $status = system($cmd); 374 375 376 377 378 403 if($status != 0) { 404 print STDERR "@@@ Unable to get imagemagick for darwin\n"; 405 } 406 407 # need ghostscript mac binary too for pdf to img conversions on mac 379 408 $cmd = "svn export http://svn.greenstone.org/main/trunk/binaries/mac/intel/ghostscript bin/darwin/ghostscript"; 380 409 $status = system($cmd); 381 382 383 384 385 386 # system("chmod -R u+x $ENV{'DATA_DIR'}/$gsdl/bin/darwin/imagemagick/bin/*");387 # system("chmod -R u+x $ENV{'DATA_DIR'}/$gsdl/bin/darwin/ghostscript/bin/*");410 if($status != 0) { 411 print STDERR "@@@ Unable to get ghostscript for darwin\n"; 412 } 413 414 # the imagemagick and ghostscript binaries have been set to executable on svn trac now 415 # system("chmod -R u+x $greenstone_home/bin/darwin/imagemagick/bin/*"); 416 # system("chmod -R u+x $greenstone_home/bin/darwin/ghostscript/bin/*"); 388 417 } else { # linux 389 418 my $extension64 = ($bit_arch =~ m/64$/) ? "-x64" : ""; … … 395 424 system("cd ext && tar -xvzf $imagickzip"); 396 425 } 426 } 427 return $imagickzip; 428 } 429 430 sub getGnomeLibExt 431 { 432 my ($cmd, $status); 433 my $bit_arch=`uname -m`; 434 my $os = $isMac ? "darwin" : "linux"; 397 435 398 436 # gnomelib binary … … 412 450 413 451 #svn checkout gnome-lib for this linux/darwin 414 chdir("$ ENV{'DATA_DIR'}$sep$gsdl$sep"."ext"); #cd $DATA_DIR/$gsdl/ext452 chdir("$greenstone_home$sep"."ext"); #cd $DATA_DIR/$gsdl/ext 415 453 416 454 ##print STDERR "**** gnomelib: $gnome_lib_file\n"; … … 423 461 system ("tar -xvzf gl.tar.gz"); 424 462 425 chdir("gnome-lib-minimal");426 463 ##print STDERR "*** ARCH: $bit_arch\n"; 427 464 } 465 466 467 468 sub compile_gs3_svn() { 469 my ($cmd, $status); 470 chdir ("$greenstone3_home"); 471 472 $cmd = "ant"; # creates the build.properties file from the .in template 473 $status = system $cmd; 474 if($status != 0) { 475 print STDERR "Unable to run the ant command: $status\n"; 476 exit -1; 477 } 478 479 $cmd = "ant -Dproperties.ok=y -Dcheckout.gnomelib.ext=true prepare"; # pass in confirmation to ant prepare step 480 $status = system $cmd; 481 if($status != 0) { 482 print STDERR "Failed to run $cmd command: $status\n"; 483 exit -1; 484 } 485 486 my $imagickzip = &getImageMagickBins(); 487 chdir ("$greenstone3_home"); 488 489 $cmd = "ant -Dcheckout.gnomelib.ext=true install"; # Compile with gnome-lib. 490 $status = system $cmd; 491 if($status != 0) { 492 print STDERR "Failed to run $cmd command: $status\n"; 493 exit -1; 494 } 495 } 496 497 sub compile_gs2_svn() { 498 my $imagickzip = &getImageMagickBins(); 499 &getGnomeLibExt(); 500 501 my ($cmd, $status); 502 my $os = $isMac ? "darwin" : "linux"; 503 504 chdir("$greenstone_home"); #chdir("$ENV{'DATA_DIR'}$sep$gsdl"); # goes into toplevel gs2 or gs3 folder 505 506 ##print STDERR "@@@ OS: $^O.|".$Config{'archname64'}."|\n"; 507 508 if($isWin) { 509 print STDERR "Compiling $gsdl using makegs2.bat running in auto (silent) mode\n"; 510 511 # we're now in the GS2 folder, call makegs2 with silent param 512 $cmd = "makegs2.bat silent 2>> $ENV{'DATA_DIR'}/compilation-errors"; # STDERR is sent to compilation-errors file 513 $status = system $cmd; 514 if($status != 0) { 515 print STDERR "Greenstone compilation on Windows failed\n"; 516 exit -1; 517 } 518 519 } else { # if we're on linux/darwin, need gnome-lib for the correct architecture. And need imagemagick to build imgs in collections 520 521 chdir("ext$sep"."gnome-lib-minimal"); 522 428 523 # need to run source devel.bash on gnome-lib followed by configure, make, make install 429 524 # in one go, in order to preserve the compile environment set up by sourcing devel.bash … … 464 559 465 560 if(!$isMac) { # Linux 466 # Moving imagemagick after instead of before compilation, since bin/darwin gets overwritten during compilation467 move("$ ENV{'DATA_DIR'}$sep$gsdl$sep"."ext/imagemagick/$os", "$ENV{'DATA_DIR'}$sep$gsdl$sep"."bin/$os/imagemagick"); # http://www.perlmonks.org/?node_id=586537468 unlink "$ ENV{'DATA_DIR'}/$gsdl"."/ext/$imagickzip" or warn "Could not unlink ext/$imagickzip: $!";469 &File::Path::remove_tree("$ ENV{'DATA_DIR'}$sep$gsdl$sep"."ext/imagemagick"); # the untarred parent folder470 } 471 472 } 473 474 475 476 477 478 479 &getIsisGdl("$ ENV{'DATA_DIR'}/$gsdl");561 # Moving imagemagick after instead of before compilation, since bin/darwin and bin/linux gets overwritten during compilation 562 move("$greenstone_home$sep"."ext/imagemagick/$os", "$greenstone_home$sep"."bin/$os/imagemagick"); # http://www.perlmonks.org/?node_id=586537 563 unlink "$greenstone_home$sep"."ext$sep$imagickzip" or warn "Could not unlink ext/$imagickzip: $!"; 564 &File::Path::remove_tree("$greenstone_home$sep"."ext$sep"."imagemagick"); # the untarred parent folder 565 } 566 567 } 568 569 if($status != 0) { 570 print STDERR "@@@ Compilation of Greenstone on Linux/Mac failed\n"; 571 exit -1; 572 } 573 574 &getIsisGdl("$greenstone_home"); #&getIsisGdl("$ENV{'DATA_DIR'}/$gsdl"); 480 575 481 576 # set the path to the greenstone_home variable 482 $greenstone_home="$ENV{'DATA_DIR'}$sep$gsdl"; 483 577 #$greenstone_home="$ENV{'DATA_DIR'}$sep$gsdl"; 484 578 } 485 579 … … 542 636 543 637 if(!$isWin) { 638 chdir($greenstone_home); 544 639 my $bit_arch=`uname -m`; 545 640 if ($bit_arch =~ m/64$/) { … … 560 655 # http://stackoverflow.com/questions/3377879/how-do-i-receive-command-output-immediately 561 656 sub run_test 562 { 657 { 658 my $collect_parent = $greenstone_home; 659 my $model_collect = "model-collect"; 660 my $build_options = ""; 661 if($install_version eq "3") { 662 $collect_parent = &filename_concat($greenstone3_home,"web","sites","localsite"); 663 $model_collect = "gs3-model-collect"; 664 $build_options = " -site localsite "; 665 chdir($greenstone3_home); 666 } else { 667 chdir($greenstone_home); 668 } 669 563 670 my $num_cols = scalar(@collections); # remember the empty case 564 671 … … 594 701 595 702 if(!$use_local_rebuild) { 596 print $xml_fh "Updating $ENV{'TASK_HOME'}/ model-collect:\n";703 print $xml_fh "Updating $ENV{'TASK_HOME'}/$model_collect:\n"; 597 704 for my $col (@collections) { 598 $cmd = "svn up $ENV{'TASK_HOME'}/ model-collect$col"; #chdir("$ENV{'TASK_HOME'}/model-collect");705 $cmd = "svn up $ENV{'TASK_HOME'}/$model_collect$col"; #chdir("$ENV{'TASK_HOME'}/$model_collect"); 599 706 $status = system "$cmd"; 600 707 } 601 708 } 602 709 603 # go to whichever greenstone_homewe're using604 chdir($ greenstone_home);710 # go to whichever collecthome parent we're using 711 chdir($collect_parent); 605 712 606 713 # get svn info … … 619 726 #copy the model collections to the collect folder to be rebuilt 620 727 print STDERR "installing test collections and model collections to new $gsdl installation... "; 621 622 728 #clean up 623 729 if(-d "collect") { … … 642 748 #copy to collect and strip .svn subfolders 643 749 &File::Path::make_path("collect$col"); # create the folder and copy contents across 644 ©_recursively(&filename_concat("$ENV{'TASK_HOME'}"," model-collect$col"), "collect$col", ".svn");750 ©_recursively(&filename_concat("$ENV{'TASK_HOME'}","$model_collect$col"), "collect$col", ".svn"); 645 751 646 752 #make the model copy … … 659 765 @collections = (); # get rid of the empty string put in the array to represent "all collections" 660 766 661 opendir my($collect_handle), "collect" or die "Could not open dir $ greenstone_home/collect: $!";767 opendir my($collect_handle), "collect" or die "Could not open dir $collect_parent/collect: $!"; 662 768 663 769 for my $collection (readdir $collect_handle) { … … 687 793 print STDERR "*** Found collection $collection\n"; 688 794 print $xml_fh "<collection-test name=\"$collection\">\n"; 795 796 # run the building scripts from the toplevel of the GS installation 797 if($install_version eq "3") { 798 chdir($greenstone3_home); 799 } else { 800 chdir($greenstone_home); 801 } 689 802 690 803 if(!$use_local_rebuild) { … … 696 809 print STDERR "$collection - Importing:\n"; 697 810 print $xml_fh "<import>\n"; 698 &run_build_script("import.pl -removeold $collection"); #-OIDtype hash_on_full_filename811 &run_build_script("import.pl $build_options -removeold $collection"); #-OIDtype hash_on_full_filename 699 812 print $xml_fh "</import>\n"; 700 813 print STDERR "done\n"; … … 703 816 print STDERR "$collection - Building:\n"; 704 817 print $xml_fh "<build>\n"; 705 &run_build_script("buildcol.pl -removeold $collection");818 &run_build_script("buildcol.pl $build_options -removeold $collection"); 706 819 print $xml_fh "</build>\n"; 707 820 print STDERR "done\n"; … … 709 822 #rename the intermediate 'building' directory 'index' 710 823 print STDERR "$collection - Move \"building\" to \"index\"... "; 711 my $index = &filename_concat( "collect", $collection, "index");712 my $building = &filename_concat( "collect", $collection, "building");824 my $index = &filename_concat($collect_parent, "collect", $collection, "index"); 825 my $building = &filename_concat($collect_parent, "collect", $collection, "building"); 713 826 &File::Path::remove_tree($index); 714 827 # Renaming Directories, http://www.perlmonks.org/?node_id=177421 … … 720 833 my $diffcol_dir = &filename_concat($ENV{'TASK_HOME'},"diffcol"); 721 834 835 # chdir($collect_parent); # this is actually where we are 722 836 # help diffcol to know on what os the model cols were generated 723 837 # and what os this test machine is (on which the test cols will be generated) … … 725 839 &run_diff_script($cmd, $xml_fh, $diffcol_dir); 726 840 727 chdir($greenstone_home); # this is actually where we are 841 if($install_version eq "3") { 842 chdir($greenstone3_home); # this is actually where we are 843 } else { 844 chdir($greenstone_home); # this is actually where we are 845 } 728 846 print STDERR "done\n"; 729 847 print $xml_fh "</collection-test>\n"; … … 741 859 my ($cmd, $fh, $diffcol_dir) = @_; 742 860 861 my $linux_ext = ($install_version eq "3") ? "sh" : "bash"; 862 743 863 # we're in greenstone_home now 744 864 if(!$isWin) { 745 $cmd = "bash -c \"export GSDL HOME=&& source $setup_script.bash&& cd $diffcol_dir && ./$cmd\"";865 $cmd = "bash -c \"export GSDL3SRCHOME=&& export GSDLHOME=&& source $setup_script.$linux_ext && cd $diffcol_dir && ./$cmd\""; 746 866 747 867 } else { # Need to prefix cmd -c/-k as necessary 748 $cmd = "cmd /c \"set GSDL HOME=&& $setup_script.bat && cd $diffcol_dir && perl -S $cmd\"";868 $cmd = "cmd /c \"set GSDL3SRCHOME=&& set GSDLHOME=&& $setup_script.bat && cd $diffcol_dir && perl -S $cmd\""; 749 869 ## print STDERR "@@@@ Going to call command: $cmd\n"; 750 870 } … … 756 876 sub run_build_script { 757 877 my ($cmd, $fh) = @_; 878 my $linux_ext = ($install_version eq "3") ? "sh" : "bash"; 758 879 759 880 # chdir($greenstone_home); 760 881 # we are in $greenstone_home already, can directly run the build cmd on the collection 761 882 if(!$isWin) { 762 $cmd = "bash -c \"export GSDL HOME=&& source $setup_script.bash&& $cmd\"";883 $cmd = "bash -c \"export GSDL3SRCHOME=&& export GSDLHOME=&& source $setup_script.$linux_ext && $cmd\""; 763 884 764 885 } else { # Need to prefix cmd -c/-k as necessary 765 $cmd = "cmd /c \"set GSDL HOME=&& $setup_script.bat && perl -S $cmd\"";886 $cmd = "cmd /c \"set GSDL3SRCHOME=&& set GSDLHOME=&& $setup_script.bat && perl -S $cmd\""; 766 887 } 767 888 ## print STDERR "@@@@ Going to call command: $cmd\n"; … … 845 966 # make a summarised Xml report 846 967 print STDERR "Summarizing the xml report... "; 847 my $cmd = "java org.apache.xalan.xslt.Process -IN $xmlout -XSL $ENV{'TASK_HOME'}/xsl/xml-report.xsl -OUT $ENV{'DATA_DIR'}/report-$ dateid.xml";968 my $cmd = "java org.apache.xalan.xslt.Process -IN $xmlout -XSL $ENV{'TASK_HOME'}/xsl/xml-report.xsl -OUT $ENV{'DATA_DIR'}/report-$install_version-$dateid.xml"; 848 969 my $status = system($cmd); 849 970 print STDERR "done\n"; … … 851 972 # make a summarised HTMl report 852 973 print STDERR "Creating an html summary report... "; 853 $cmd = "java org.apache.xalan.xslt.Process -IN $ENV{'DATA_DIR'}/report-$ dateid.xml -XSL $ENV{'TASK_HOME'}/xsl/html-report.xsl -OUT $ENV{'DATA_DIR'}/report-$dateid.html";974 $cmd = "java org.apache.xalan.xslt.Process -IN $ENV{'DATA_DIR'}/report-$install_version-$dateid.xml -XSL $ENV{'TASK_HOME'}/xsl/html-report.xsl -OUT $ENV{'DATA_DIR'}/report-$install_version-$dateid.html"; 854 975 $status = system($cmd); 855 976 print STDERR "done\n"; … … 880 1001 for my $entry (readdir $dh) { 881 1002 next if ($entry !~ m/(\.xml|\.html?)$/); 1003 next if ($entry !~ m/(report-$install_version)/); 882 1004 883 1005 # copy the reports across with different names: with OS prefixed to them. And for the HTML file on Win, rename to HTM … … 923 1045 # if you need to touch the file on windows: http://stackoverflow.com/questions/51435/windows-version-of-the-unix-touch-command 924 1046 925 # the report we want to upload is actually just os-diffcol-report-$ dateid.html1047 # the report we want to upload is actually just os-diffcol-report-$install_version-$dateid.html 926 1048 my $command = "cd \"$ENV{'UPLOAD_DIR'}\" && tar -c *.htm* | "; #&& cat *.html | "; # && tar -c * | 927 1049 $command .= ($^O eq "MSWin32" ? "plink" : "ssh"); … … 955 1077 my $msg = "$gsdl regression test for $dateid failed"; 956 1078 my $subject = "Regression Test Failed"; #"$gsdl regression test for $dateid failed\n"; 957 my $attach_file = &filename_concat($ENV{'DATA_DIR'}, "report-$ dateid.html");1079 my $attach_file = &filename_concat($ENV{'DATA_DIR'}, "report-$install_version-$dateid.html"); 958 1080 959 1081 if($isWin) {
Note:
See TracChangeset
for help on using the changeset viewer.