diff options
Diffstat (limited to 'Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-26-TL-texindy_pl')
-rw-r--r-- | Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-26-TL-texindy_pl | 74 |
1 files changed, 51 insertions, 23 deletions
diff --git a/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-26-TL-texindy_pl b/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-26-TL-texindy_pl index cccf6f665dd..3126ce470af 100644 --- a/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-26-TL-texindy_pl +++ b/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-26-TL-texindy_pl @@ -1,17 +1,17 @@ - Determine lib_dir (for VERSION) and xindy. + Determine cmd_dir (for VERSION) and xindy. Also implement symlinks, e.g., in /usr/local/bin/ for standalone version. diff -ur -x Makefile.in -x autom4te.cache xindy.orig/user-commands/texindy.in xindy/user-commands/texindy.in --- xindy.orig/user-commands/texindy.in 2009-12-03 01:27:06.000000000 +0100 -+++ xindy/user-commands/texindy.in 2009-12-10 23:53:25.000000000 +0100 ++++ xindy/user-commands/texindy.in 2009-12-11 16:14:10.000000000 +0100 @@ -306,10 +306,44 @@ # Determine environment. Where is our library directory, and our modules? use File::Basename; +use Cwd; -+our ($isW32, $isTL, $lib_dir); ++our ($isW32, $isTL); +our $xindy; our ($cmd_dir, $cmd); BEGIN { @@ -25,7 +25,7 @@ diff -ur -x Makefile.in -x autom4te.cache xindy.orig/user-commands/texindy.in xi + + if ($isTL) { + if ($isW32) { -+ $xindy = "$cmd_dir/../../../bin/win32/xindy.exe"; ++ $xindy = "$cmd_dir/xindy.pl"; + } else { + die "$cmd: not a symlink as required for TeX Live" unless -l $0; + $r0 = $0; @@ -40,12 +40,12 @@ diff -ur -x Makefile.in -x autom4te.cache xindy.orig/user-commands/texindy.in xi + } + $xindy = "$lcmd_dir/xindy"; + } -+ $lib_dir = "$cmd_dir/../../xindy"; -+ } elsif ($isW32) { -+ # FIXME: For win32 we should have a wrapper script, -+ # FIXME: e.g., 'xindy.bat' invoking 'perl xindy' -+ die "$cmd: not yet implemented"; ++ $cmd_dir = Cwd::realpath("$cmd_dir/../../xindy/modules"); ++ die "Cannot locate xindy modules directory" unless -f "$cmd_dir/../VERSION"; + } else { ++ # FIXME: For win32 there should be wrapper scripts 'xindy.bat' or 'xindy.cmd' ++ # FIXME: invoking 'perl xindy' and similar for texindy. ++ # FIXME: When calling xindy from texindy we bypass this wrapper. + $xindy = "$cmd_dir/xindy"; + } + die "$cmd: cannot locate xindy\n" unless -f $xindy && ($isW32 || -x $xindy); @@ -68,23 +68,51 @@ diff -ur -x Makefile.in -x autom4te.cache xindy.orig/user-commands/texindy.in xi parse_options(); output_version() if $output_version; # will not return usage(1) if ( ! $stdin && @ARGV == 0 ); # brain damaged, but like makeindex -@@ -388,7 +413,7 @@ +@@ -388,10 +413,23 @@ @modules)); push (@opt, '-I', $input_markup); -print "Calling xindy as: $cmd_dir/xindy @opt @ARGV\n" if (grep /^script$/, @debug); +print "Calling xindy as: $xindy @opt @ARGV\n" if (grep /^script$/, @debug); ++ ++# FIXME: There ought to be be a subroutine call_xindy used here and in output_version. + +-exec $xindy, @opt, @ARGV; +-die "$cmd: could not execute xindy: $!\n"; ++if ($isW32) { ++ system ($^X, $xindy, @opt, @ARGV); ++ if ($? == -1) { ++ die "$cmd: could not execute xindy: $!\n"; ++ } elsif ($? & 127) { ++ die "xindy died with signal " . ($? & 127) ."\n"; ++ } else { ++ exit ($? >> 8); ++ } ++} else { ++ exec $xindy, @opt, @ARGV; ++ die "$cmd: could not execute xindy: $!\n"; ++} + + + # ------------------------------------------------------------ +@@ -452,7 +490,19 @@ + print "$cmd script version: $VERSION\n"; + my @xindy_cmd = ($xindy, '--internal-version'); + push (@xindy_cmd, qw(-d script --foobar)) if grep(/^script$/, @debug); +- exec @xindy_cmd; ++ if ($isW32) { ++ system ($^X, @xindy_cmd); ++ if ($? == -1) { ++ die "$cmd: could not execute xindy: $!\n"; ++ } elsif ($? & 127) { ++ die "xindy died with signal " . ($? & 127) ."\n"; ++ } else { ++ exit ($? >> 8); ++ } ++ } else { ++ exec @xindy_cmd; ++ die "$cmd: could not execute xindy: $!\n"; ++ } + } + - exec $xindy, @opt, @ARGV; - die "$cmd: could not execute xindy: $!\n"; -@@ -459,7 +484,9 @@ - sub output_xindy_release () { - my $version = 'unknown'; - my $version_file; -- if ( -f "$cmd_dir/../VERSION" ) { -+ if ( $isTL && -f "$lib_dir/VERSION" ) { -+ $version_file = "$lib_dir/VERSION"; -+ } elsif ( -f "$cmd_dir/../VERSION" ) { - $version_file = "$cmd_dir/../VERSION"; - } else { - # Where is the library directory? |