diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-12-11 16:07:25 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-12-11 16:07:25 +0000 |
commit | 336388893e4fd7e45b584c484e2a208d20b98bfe (patch) | |
tree | eb6ccd7dce49dcd221b6d0240d89481537bc194a /Build/source/utils/xindy-new/xindy/user-commands/texindy.in | |
parent | 44869a4834bf127ee87ce2f61d50efbd52ea6d57 (diff) |
xindy-new: update -- almost finished
git-svn-id: svn://tug.org/texlive/trunk@16362 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/xindy-new/xindy/user-commands/texindy.in')
-rw-r--r-- | Build/source/utils/xindy-new/xindy/user-commands/texindy.in | 49 |
1 files changed, 36 insertions, 13 deletions
diff --git a/Build/source/utils/xindy-new/xindy/user-commands/texindy.in b/Build/source/utils/xindy-new/xindy/user-commands/texindy.in index 1774614638e..1c6424641ec 100644 --- a/Build/source/utils/xindy-new/xindy/user-commands/texindy.in +++ b/Build/source/utils/xindy-new/xindy/user-commands/texindy.in @@ -307,7 +307,7 @@ BEGIN { use File::Basename; use Cwd; -our ($isW32, $isTL, $lib_dir); +our ($isW32, $isTL); our $xindy; our ($cmd_dir, $cmd); BEGIN { @@ -320,7 +320,7 @@ BEGIN { 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; @@ -335,12 +335,12 @@ BEGIN { } $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); @@ -415,8 +415,21 @@ push (@opt, '-I', $input_markup); print "Calling xindy as: $xindy @opt @ARGV\n" if (grep /^script$/, @debug); -exec $xindy, @opt, @ARGV; -die "$cmd: could not execute xindy: $!\n"; +# FIXME: There ought to be be a subroutine call_xindy used here and in output_version. + +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"; +} # ------------------------------------------------------------ @@ -477,16 +490,26 @@ sub output_version () { 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"; + } } sub output_xindy_release () { my $version = 'unknown'; my $version_file; - if ( $isTL && -f "$lib_dir/VERSION" ) { - $version_file = "$lib_dir/VERSION"; - } elsif ( -f "$cmd_dir/../VERSION" ) { + if ( -f "$cmd_dir/../VERSION" ) { $version_file = "$cmd_dir/../VERSION"; } else { # Where is the library directory? |