diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-12-11 17:33:49 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-12-11 17:33:49 +0000 |
commit | 0021f310470a4bbc682ebece240c34c416223e82 (patch) | |
tree | 5ab04751068b05b926eb84b68ec3f10d6c106f90 | |
parent | 255ba44b76120637be9f2d3d81ddda836a37c128 (diff) |
xindy-new: update texindy perl script
git-svn-id: svn://tug.org/texlive/trunk@16367 c570f23f-e606-0410-a88d-b1316a301751
3 files changed, 54 insertions, 57 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 8d8b6bca0e6..0b0acc1599f 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,8 +1,7 @@ 2009-12-11 Peter Breitenlohner <peb@mppmu.mpg.de> * patch-26-TL-texindy_pl (new): Adapt texindy perl script for - use in TL, using code for W32 from - Tomasz M. Trzeciak <t34www@googlemail.com>. + use in TL, using code from Tomasz M. Trzeciak. * 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-26-TL-texindy_pl b/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-26-TL-texindy_pl index 3126ce470af..2e7fc76ce0c 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,11 +1,13 @@ Determine cmd_dir (for VERSION) and xindy. + Call xindy via 'exec' (Unix) or 'system $^X' (Windows). + 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-11 16:14:10.000000000 +0100 ++++ xindy/user-commands/texindy.in 2009-12-11 18:02:58.000000000 +0100 @@ -306,10 +306,44 @@ # Determine environment. Where is our library directory, and our modules? @@ -68,40 +70,24 @@ 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,10 +413,23 @@ +@@ -388,21 +413,36 @@ @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"; -+} ++print "Calling xindy as: $xindy @opt @ARGV\n" if (grep /^script$/, @debug); ++call_xindy(@opt, @ARGV); # ------------------------------------------------------------ -@@ -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; + + ++sub call_xindy { + if ($isW32) { -+ system ($^X, @xindy_cmd); ++ system ($^X, $xindy, @_); + if ($? == -1) { + die "$cmd: could not execute xindy: $!\n"; + } elsif ($? & 127) { @@ -110,9 +96,31 @@ diff -ur -x Makefile.in -x autom4te.cache xindy.orig/user-commands/texindy.in xi + exit ($? >> 8); + } + } else { -+ exec @xindy_cmd; ++ exec ($xindy, @_); + die "$cmd: could not execute xindy: $!\n"; + } ++} ++ ++ + sub parse_options() { + + my ($german, $letter_ordering, $no_ranges); + GetOptions( + 'version|V' => \$output_version, +- 'help|h|?' => \&usage, ++ + 'quiet|q' => \$quiet, + 'verbose|v' => \$verbose, + 'stdin|i' => \$stdin, +@@ -450,9 +490,9 @@ + sub output_version () { + output_xindy_release(); + print "$cmd script version: $VERSION\n"; +- my @xindy_cmd = ($xindy, '--internal-version'); ++ my @xindy_cmd = ('--internal-version'); + push (@xindy_cmd, qw(-d script --foobar)) if grep(/^script$/, @debug); +- exec @xindy_cmd; ++ call_xindy(@xindy_cmd); } 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 1c6424641ec..34f0e6dc103 100644 --- a/Build/source/utils/xindy-new/xindy/user-commands/texindy.in +++ b/Build/source/utils/xindy-new/xindy/user-commands/texindy.in @@ -414,33 +414,35 @@ push (@opt, map { ('-M', $_) } ($ENV{TEXINDY_AUTO_MODULE} || 'texindy', push (@opt, '-I', $input_markup); print "Calling xindy as: $xindy @opt @ARGV\n" if (grep /^script$/, @debug); +call_xindy(@opt, @ARGV); -# 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"; +# ------------------------------------------------------------ + + +sub call_xindy { + if ($isW32) { + system ($^X, $xindy, @_); + if ($? == -1) { + die "$cmd: could not execute xindy: $!\n"; + } elsif ($? & 127) { + die "xindy died with signal " . ($? & 127) ."\n"; + } else { + exit ($? >> 8); + } } else { - exit ($? >> 8); + exec ($xindy, @_); + die "$cmd: could not execute xindy: $!\n"; } -} else { - exec $xindy, @opt, @ARGV; - die "$cmd: could not execute xindy: $!\n"; } -# ------------------------------------------------------------ - - sub parse_options() { my ($german, $letter_ordering, $no_ranges); GetOptions( 'version|V' => \$output_version, - 'help|h|?' => \&usage, + 'quiet|q' => \$quiet, 'verbose|v' => \$verbose, 'stdin|i' => \$stdin, @@ -488,21 +490,9 @@ sub parse_options() { sub output_version () { output_xindy_release(); print "$cmd script version: $VERSION\n"; - my @xindy_cmd = ($xindy, '--internal-version'); + my @xindy_cmd = ('--internal-version'); push (@xindy_cmd, qw(-d script --foobar)) if grep(/^script$/, @debug); - 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"; - } + call_xindy(@xindy_cmd); } |