Changeset 28402

Show
Ignore:
Timestamp:
14.10.2013 10:12:55 (6 years ago)
Author:
davidb
Message:

Changes to support running these scripts from Cygwin

Location:
main/trunk/greenstone2/bin/script
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/jdb2txt.pl

    r26490 r28402  
    6363my $jdbmwrapper_jar = &util::filename_cat($ENV{'GSDLHOME'},"bin","java","JDBMWrapper.jar"); 
    6464 
    65 &util::envvar_prepend("CLASSPATH",$jdbm_jar); 
    66 &util::envvar_prepend("CLASSPATH",$jdbmwrapper_jar); 
    6765 
    68 my $cmd = "java Jdb2Txt " . join(" ", map {$_ = "\"$_\""} @ARGV); 
     66my $classpath = &util::pathname_cat($jdbmwrapper_jar,$jdbm_jar); 
     67 
     68if ($^O eq "cygwin") { 
     69    # Away to run a java program, using a binary that is native to Windows, so need 
     70    # Windows directory and path separators 
     71     
     72    $classpath = `cygpath -wp "$classpath"`; 
     73    chomp($classpath); 
     74    $classpath =~ s%\\%\\\\%g;     
     75} 
     76 
     77#&util::envvar_prepend("CLASSPATH",$jdbm_jar); 
     78#&util::envvar_prepend("CLASSPATH",$jdbmwrapper_jar); 
     79 
     80my $cmd = "java -cp \"$classpath\" Jdb2Txt " . join(" ", map {$_ = "\"$_\""} @ARGV); 
    6981 
    7082if (system($cmd)!=0) { 
  • main/trunk/greenstone2/bin/script/lucene_passes.pl

    r27331 r28402  
    4444  # Is there a collection-specific bin/java/LuceneWrapper3.jar file? 
    4545  my $bin_java = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'},"bin","java"); 
    46   my $classpath = &FileUtils::filenameConcatenate($bin_java,"LuceneWrapper3.jar"); 
     46  my $classpath = &FileUtils::javaFilenameConcatenate($bin_java,"LuceneWrapper3.jar"); 
    4747  if (!-f $classpath) 
    4848  { 
    4949      # No, so use the Greenstone one 
    5050      $bin_java = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"bin","java"); 
    51       $classpath = &FileUtils::filenameConcatenate($bin_java,"LuceneWrapper3.jar"); 
     51      $classpath = &FileUtils::javaFilenameConcatenate($bin_java,"LuceneWrapper3.jar"); 
    5252      if(!-f $classpath) { 
    5353      die "***** ERROR: $classpath does not exist\n";      
     
    5757  my $java_lucene = "java -classpath \"$classpath\" org.greenstone.LuceneWrapper3.GS2LuceneIndexer"; 
    5858  my $java_cmd = "$java_lucene $java_lucene_options $doc_tag_level \"$full_builddir\" $indexdir"; 
     59 
     60##  print STDERR "**** lucene java cmd = $java_cmd\n"; 
    5961 
    6062  open (PIPEOUT, "| $java_cmd") or die "lucene_passes.pl - couldn't run $java_cmd\n";