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 | |
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')
5 files changed, 93 insertions, 41 deletions
diff --git a/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/ChangeLog b/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/ChangeLog index e3410781a8a..8d8b6bca0e6 100644 --- a/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/ChangeLog +++ b/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/ChangeLog @@ -1,7 +1,8 @@ 2009-12-11 Peter Breitenlohner <peb@mppmu.mpg.de> * patch-26-TL-texindy_pl (new): Adapt texindy perl script for - use in TL. + use in TL, using code for W32 from + Tomasz M. Trzeciak <t34www@googlemail.com>. * patch-27-check-exist (new): Check existence of input files (from TL2008). diff --git a/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-22-TL-xindy_pl b/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-22-TL-xindy_pl index 5bdf726d340..9aadba65dc4 100644 --- a/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-22-TL-xindy_pl +++ b/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-22-TL-xindy_pl @@ -49,8 +49,8 @@ diff -ur -x Makefile.in -x autom4te.cache xindy.orig/user-commands/xindy.in xind + # Now $cmd_dir/$cmd -> $r0 = $rcmd_dir/$rcmd (not a symlink). + } + -+ $modules_dir = "$rcmd_dir/../../xindy/modules"; -+ die "$cmd: Cannot locate xindy modules directory" unless -d $modules_dir; ++ $modules_dir = Cwd::realpath("$rcmd_dir/../../xindy/modules"); ++ die "$cmd: Cannot locate xindy modules directory" unless -d $modules_dir; + + $lib_dir = $cmd_dir; + 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? 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? diff --git a/Build/source/utils/xindy-new/xindy/user-commands/xindy.in b/Build/source/utils/xindy-new/xindy/user-commands/xindy.in index 5333c212d85..050ab797eca 100644 --- a/Build/source/utils/xindy-new/xindy/user-commands/xindy.in +++ b/Build/source/utils/xindy-new/xindy/user-commands/xindy.in @@ -326,8 +326,8 @@ BEGIN { # Now $cmd_dir/$cmd -> $r0 = $rcmd_dir/$rcmd (not a symlink). } - $modules_dir = "$rcmd_dir/../../xindy/modules"; - die "$cmd: Cannot locate xindy modules directory" unless -d $modules_dir; + $modules_dir = Cwd::realpath("$rcmd_dir/../../xindy/modules"); + die "$cmd: Cannot locate xindy modules directory" unless -d $modules_dir; $lib_dir = $cmd_dir; |