diff options
author | Vladimir Volovich <vvv@vsu.ru> | 2008-04-19 09:35:50 +0000 |
---|---|---|
committer | Vladimir Volovich <vvv@vsu.ru> | 2008-04-19 09:35:50 +0000 |
commit | ba27f568a1af1d55353f4deb35d9d839fc762287 (patch) | |
tree | bc5b5e33fa2b7ba7cbe6c77f5cbfd7d7b7a91b18 /Master/texmf/scripts/xindy | |
parent | 1377cd8f12dbd3c49673ee5a4f7705c65cd04b43 (diff) |
check-in fixes to xindy frontend perl scripts, as built from source tree
git-svn-id: svn://tug.org/texlive/trunk@7510 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf/scripts/xindy')
-rwxr-xr-x | Master/texmf/scripts/xindy/texindy.pl | 26 | ||||
-rwxr-xr-x | Master/texmf/scripts/xindy/xindy.pl | 49 |
2 files changed, 55 insertions, 20 deletions
diff --git a/Master/texmf/scripts/xindy/texindy.pl b/Master/texmf/scripts/xindy/texindy.pl index 8e4d8f932d2..f0d85fd7777 100755 --- a/Master/texmf/scripts/xindy/texindy.pl +++ b/Master/texmf/scripts/xindy/texindy.pl @@ -364,6 +364,9 @@ if ( -f "$cmd_dir/xindy" && -x _ ) { $xindy = "$cmd_dir/xindy"; } elsif ( -f "$cmd_dir/xindy.pl" && -x _ ) { $xindy = "$cmd_dir/xindy.pl"; +} elsif ( -f "$ENV{SELFAUTOLOC}/xindy.texlua" ) { # woe32 + $xindy = "$ENV{SELFAUTOLOC}/xindy.texlua"; + $cmd_dir = $ENV{"SELFAUTOLOC"}; } else { die "$cmd: cannot locate xindy\n"; } @@ -387,10 +390,15 @@ unshift (@ARGV, map { ('-M', $_) } ($ENV{TEXINDY_AUTO_MODULE} || 'texindy', @modules)); unshift (@ARGV, '-I', $input_markup); -print "Calling xindy as: $cmd_dir/xindy @ARGV\n" if (grep /^script$/, @debug); +print "Calling xindy as: $xindy @ARGV\n" if (grep /^script$/, @debug); -exec $xindy, @ARGV; -die "$cmd: could not execute xindy: $!\n"; +if ($xindy =~ m,\.texlua$,) { + system("texlua", $xindy, @ARGV); + exit $? if $? != -1; +} else { + exec $xindy, @ARGV; +} +die "$cmd: could not execute $xindy: $!\n"; # ------------------------------------------------------------ @@ -461,22 +469,28 @@ sub output_xindy_release () { if ( -f "$cmd_dir/../VERSION" ) { $version_file = "$cmd_dir/../VERSION"; } else { + my $xindy_run; + if ($^O eq "MSWin32" || $^O eq "cygwin") { + $xindy_run = "xindy-lisp.exe"; + } else { + $xindy_run = "xindy.run"; + } # Where is the library directory? my $lib_dir; if ( $ENV{XINDY_LIBDIR} ) { $lib_dir = $ENV{XINDY_LIBDIR}; + } elsif ( -f "$cmd_dir/$xindy_run" ) { # texlive style + $lib_dir = $cmd_dir; } elsif ( '@libdir@' ne '@libdir' . '@' ) { # GNU configure at work? if ( -d '@libdir@/xindy' ) { # /usr style $lib_dir = '@libdir@/xindy'; } else { $lib_dir = '@libdir@'; # /opt style } - } elsif ( -f "$cmd_dir/../lib/xindy.run" ) { # /opt style + } elsif ( -f "$cmd_dir/../lib/$xindy_run" ) { # /opt style $lib_dir = "$cmd_dir/../lib"; } elsif ( -d "$cmd_dir/../lib/xindy" ) { # /usr style $lib_dir = "$cmd_dir/../lib/xindy"; - } elsif ( -f "$cmd_dir/xindy.run" ) { # texlive style - $lib_dir = $cmd_dir; } else { die "Cannot locate xindy library directory"; } diff --git a/Master/texmf/scripts/xindy/xindy.pl b/Master/texmf/scripts/xindy/xindy.pl index f8350a6d048..a1d42291503 100755 --- a/Master/texmf/scripts/xindy/xindy.pl +++ b/Master/texmf/scripts/xindy/xindy.pl @@ -286,25 +286,38 @@ BEGIN { # Determine environment. Where is our library directory, and our modules? use File::Basename; -our ($cmd_dir, $cmd, $lib_dir, $modules_dir); +our ($cmd_dir, $cmd, $xindy_run, $lib_dir, $modules_dir, $path_sep); BEGIN { $cmd_dir = dirname($0); $cmd = basename($0); + if ($^O eq "MSWin32" || $^O eq "cygwin") { + $xindy_run = "xindy-lisp.exe"; + $path_sep = ";"; + } else { + $xindy_run = "xindy.run"; + $path_sep = ":"; + } + # library directory if ( $ENV{XINDY_LIBDIR} ) { $lib_dir = $ENV{XINDY_LIBDIR}; - } elsif ( -f "$cmd_dir/xindy.run" ) { # texlive style + die "$cmd: Invalid XINDY_LIBDIR setting: cannot find $lib_dir/$xindy_run" if ! -f "$lib_dir/$xindy_run"; + } elsif ( -f "$cmd_dir/$xindy_run" ) { # texlive unix $lib_dir = $cmd_dir; - } elsif ( '/home/vvv/src/texlive/source/utils/01/lib' ne '@libdir' . '@' ) { # GNU configure at work? - if ( -d '/home/vvv/src/texlive/source/utils/01/lib/xindy' ) { # /usr style - $lib_dir = '/home/vvv/src/texlive/source/utils/01/lib/xindy'; + } elsif ( exists $ENV{"SELFAUTOLOC"} && -f "$ENV{SELFAUTOLOC}/$xindy_run" ) { # texlive woe32 + $lib_dir = $ENV{"SELFAUTOLOC"}; + $cmd_dir = $ENV{"SELFAUTOLOC"}; + } elsif ( '/home/vvv/src/tex/texlive/source/utils/01/lib' ne '@libdir' . '@' ) { # GNU configure at work? + if ( -d '/home/vvv/src/tex/texlive/source/utils/01/lib/xindy' ) { # /usr style + $lib_dir = '/home/vvv/src/tex/texlive/source/utils/01/lib/xindy'; } else { - $lib_dir = '/home/vvv/src/texlive/source/utils/01/lib'; # /opt style + $lib_dir = '/home/vvv/src/tex/texlive/source/utils/01/lib'; # /opt style } - } elsif ( -f "$cmd_dir/../lib/xindy.run" ) { # /opt style + die "$cmd: Cannot locate $lib_dir/$xindy_run" if ! -f "$lib_dir/$xindy_run"; + } elsif ( -f "$cmd_dir/../lib/$xindy_run" ) { # /opt style $lib_dir = "$cmd_dir/../lib"; - } elsif ( -d "$cmd_dir/../lib/xindy" ) { # /usr style + } elsif ( -f "$cmd_dir/../lib/xindy/$xindy_run" ) { # /usr style $lib_dir = "$cmd_dir/../lib/xindy"; } else { die "$cmd: Cannot locate xindy library directory"; @@ -590,7 +603,7 @@ sub filter_index ( $$ ) { # Construct final xindy expression, from options. sub xindy_expression () { - my ($logging, $tracing, $trace_level); + my ($logging, $tracing, $trace_level, $searchpath); # Determine language module of make-rules framework. Part of the # complexity below is from compatibility with the TLC2 @@ -658,16 +671,18 @@ sub xindy_expression () { $style_file = quotify($style_file); $outfile = quotify($outfile); + $raw_index = quotify($raw_index); $logging = ':logfile ' . quotify($logfile) if $logfile; $tracing = ':markup-trace :on' if $debug{markup}; $trace_level = ":trace-level $debug{trace_level}" if $debug{trace_level}; + $searchpath = quotify(join($path_sep, ".", $modules_dir, "$modules_dir/base")); my $exp = <<_EOT_ (progn - (searchpath ".:$modules_dir:$modules_dir/base") + (searchpath $searchpath) (xindy:startup :idxstyle $style_file - :rawindex "$raw_index" + :rawindex $raw_index :output $outfile $logging $tracing @@ -685,12 +700,18 @@ _EOT_ sub call_xindy ( $$ ) { my ($mem_file, $xindy_exp) = @_; - my @command = ("$lib_dir/xindy.run", '-q', + my @command = ("$lib_dir/$xindy_run", '-q', '-B', $lib_dir, '-M', $mem_file, '-E', 'iso-8859-1'); if ( $interactive ) { print "Proposed xindy expression:\n\n$xindy_exp\n" unless $quiet; } else { - push (@command, '-x', $xindy_exp); + #push (@command, '-x', $xindy_exp); + my ($output, $outfile) = tempfile(); + push (@temp_files, $outfile); + print $output $xindy_exp; + close ($output); + print "xindy startup file: $outfile\n" if $debug{script}; + push (@command, $outfile); } if ( $debug{script} ) { @@ -748,7 +769,7 @@ sub output_xindy_release () { sub quotify ( $ ) { my $s = shift; - $s =~ s:[\\\"]:\\&1:g ; # quote double-quote and backslash + $s =~ s:([\\\"]):\\$1:g ; # quote double-quote and backslash return "\"$s\""; } |