Changeset 24166 for main/trunk/greenstone2/bin
- Timestamp:
- 2011-06-16T19:16:15+12:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/bin/script/gsConvert.pl
r24164 r24166 786 786 my ($input_filename, $output_filestem) = @_; 787 787 788 my $vbScript = &util::filename_cat($ENV{'GSDLHOME'}, "bin", 789 $ENV{'GSDLOS'}, "word2html");788 # build up the path to the doc-to-html conversion tool we're going to use 789 my $vbScript = &util::filename_cat($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}); 790 790 791 791 if ($ENV{'GSDLOS'} =~ m/^windows$/i) { 792 # if windows scripting with docx input, use new VBscript 793 if($input_filename =~ m/docx$/i) { 794 $vbScript = "docx2html.vbs"; 795 } else { # use the usual word2html conversion VB executable 796 $vbScript = "word2html"; 797 } 798 } 792 # if windows scripting with docx input, use new VBscript to get the local Word install (if 793 # any) to do the conversion, since docX can't be processed by word2html's windows_scripting 794 795 if($input_filename =~ m/docx$/i) { # need to use full path to docx2html script, 796 # else script launch fails when there are error msgs 797 $vbScript = &util::filename_cat($vbScript, "docx2html.vbs"); 798 $vbScript = "CScript //Nologo \"$vbScript\""; # launche with CScript for error output in STDERR 799 # //Nologo flag avoids Microsoft's opening/logo msgs 800 } 801 else { # old doc versions. use the usual VB executable word2html for the 802 # conversion. Doesn't need full path, since bin\windows is on PATH 803 $vbScript = "word2html"; #$vbScript = "\"".&util::filename_cat($vbScript, "word2html")."\""; 804 } 805 } 806 else { # not windows 807 $vbScript = "\"".&util::filename_cat($vbScript, "word2html")."\""; 808 } 799 809 800 810 if (-e "$output_filestem.html") { … … 812 822 813 823 # redirecting STDERR 814 $cmd .= " 2> \"$output_filestem.err\"" 815 if ($ENV {'GSDLOS'} !~ m/^windows$/i || $is_winnt_2000); 816 824 825 $cmd .= " 2> \"$output_filestem.err\"" 826 if ($ENV {'GSDLOS'} !~ m/^windows$/i || $is_winnt_2000); 827 #print STDERR "@@@@@@@@@ cmd=$cmd\n"; 828 817 829 # execute the command 818 830 $!=0; … … 822 834 if (-s "$output_filestem.err") { 823 835 open (ERRFILE, "<$output_filestem.err"); 824 836 825 837 my $write_to_fail_log=0; 826 838 if ($faillogfile ne "" && defined(open(FAILLOG,">>$faillogfile")))
Note:
See TracChangeset
for help on using the changeset viewer.