From e305bacf7942f17f6ab75aaa769d205462cd4015 Mon Sep 17 00:00:00 2001 From: Vladimir Volovich Date: Sat, 10 May 2008 09:14:29 +0000 Subject: stop if the input file(s) do not exist; otherwise xindy showed a warning in create_raw_index() and continued. ======================================== workaround for a woe32 problem (it is yet unclear how to solve it): apparently the "nul" file, when opened multiple times, causes a problem. when no logfile is given, it defaulted to nul file, which caused error in xindy-lisp.exe. still reproducible by specifying "-t nul", e.g.: xindy -t nul -M texindy x.idx [...] ERROR: OPEN: # already points to file "Z:\\Master\\texmf\\xindy\\base\\latex.xdy", opening the file again for :INPUT-IMMUTABLE may produce unexpected results so we set the log file to *.ilg on woe32 unless it is explicitly specified. another contributor factor to this problem is the "-q" option which also tries to use "nul" and this causes a problem: xindy -q -M texindy x.idx ERROR: OPEN: # already points to file "Z:\\Master\\texmf\\xindy\\base\\numeric-sort.xdy", opening the file again for :INPUT-IMMUTABLE may produce unexpected results ======================================== workaround for a woe32 problem: delete the output file if it already exists prior to calling xindy, otherwise it is unable to overwrite it. (this does not happen with the log file which it is able to overwrite) ======================================== strangely, i did not see the last 2 problems in my previous tests. it may be caused by a clisp bug. git-svn-id: svn://tug.org/texlive/trunk@8008 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/xindy/xindy.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Master/texmf') diff --git a/Master/texmf/scripts/xindy/xindy.pl b/Master/texmf/scripts/xindy/xindy.pl index a1d42291503..0dfdade507b 100755 --- a/Master/texmf/scripts/xindy/xindy.pl +++ b/Master/texmf/scripts/xindy/xindy.pl @@ -424,6 +424,7 @@ END { our $raw_index = File::Spec->devnull; unless ( $interactive ) { + for my $f (@ARGV) { die "$f does not exist" if ! -f $f } $raw_index = create_raw_index(); # processes @ARGV my $filter_cmd = ''; if ( $input_markup eq 'latex' ) { @@ -511,6 +512,8 @@ sub parse_options() { } my ($name, $path, $suffix) = fileparse ($ARGV[0], '\.[^\.]+'); $outfile = "$path$name.ind"; + # FIXME opening "nul" multiple times causes a problem on woe32 + $logfile = "$path$name.ilg" if $^O eq "MSWin32" && ! defined $logfile; } # FIXME: xindy wants a log file. Really? @@ -670,7 +673,7 @@ sub xindy_expression () { } $style_file = quotify($style_file); - $outfile = quotify($outfile); + my $outfile_q = quotify($outfile); $raw_index = quotify($raw_index); $logging = ':logfile ' . quotify($logfile) if $logfile; $tracing = ':markup-trace :on' if $debug{markup}; @@ -683,7 +686,7 @@ sub xindy_expression () { (xindy:startup :idxstyle $style_file :rawindex $raw_index - :output $outfile + :output $outfile_q $logging $tracing $trace_level) @@ -722,6 +725,7 @@ sub call_xindy ( $$ ) { if ( $quiet && ! $interactive ) { open (STDOUT, '>', File::Spec->devnull); } + unlink($outfile) if $^O eq "MSWin32" && -f $outfile; system @command; if ( $? == -1 ) { print STDERR "$cmd: Could not execute xindy kernel: $!\n"; -- cgit v1.2.3