summaryrefslogtreecommitdiff
path: root/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-22-TL-xindy_pl
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-22-TL-xindy_pl')
-rw-r--r--Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-22-TL-xindy_pl111
1 files changed, 69 insertions, 42 deletions
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 9aadba65dc4..3437f278320 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
@@ -3,82 +3,74 @@
Also implement symlinks, e.g., in /usr/local/bin/ for
standalone version.
- ToDo:
- Modify call_xindy() to use "$xindy_run" if it exists.
+ Drop xindy.v2 backwards compatibility.
+
+ Invoke either 'xindy.run' or 'clisp'.
+
+ Verify existence of input files.
diff -ur -x Makefile.in -x autom4te.cache xindy.orig/user-commands/xindy.in xindy/user-commands/xindy.in
--- xindy.orig/user-commands/xindy.in 2009-12-03 01:27:06.000000000 +0100
-+++ xindy/user-commands/xindy.in 2009-12-09 11:50:09.000000000 +0100
-@@ -286,10 +286,58 @@
++++ xindy/user-commands/xindy.in 2009-12-12 17:57:03.000000000 +0100
+@@ -286,11 +286,47 @@
# Determine environment. Where is our library directory, and our modules?
use File::Basename;
+use Cwd;
-+our ($isW32, $r0, $xindy_run);
++our ($isW32, $clisp);
our ($cmd_dir, $cmd, $lib_dir, $modules_dir);
BEGIN {
- $cmd_dir = dirname($0);
-- $cmd = basename($0);
+ $isW32 = ($^O =~ /^MSWin/i) ? 1 : 0;
-+ $r0 = Cwd::realpath($0);
-+ $cmd = basename($r0);
-+
-+ # FIXME: make two subroutines for TL2010 and !TL2010 part
++ $clisp = ($isW32 || $^O eq "cygwin") ? 'clisp.exe' : 'clisp';
+
-+ if ($cmd eq "xindy.pl") { # TL2010
++ my $r0 = Cwd::realpath($0);
++ $cmd_dir = dirname($r0);
+ $cmd = basename($0);
+
++ if (basename($r0) =~ /\.pl$/) { # TL2010
+
-+ $r0 = $0;
-+ my $rcmd_dir = dirname($0);
-+ $cmd = basename($0);
++ # modules directory
++ $modules_dir = Cwd::realpath("$cmd_dir/../../xindy/modules");
++ die "$cmd: Cannot locate xindy modules directory" unless -d $modules_dir;
+
+ if ($isW32) {
-+ $cmd_dir = "$rcmd_dir/../../../bin/win32";
++ $cmd_dir = "$cmd_dir/../../../bin/win32";
+ } else {
+ die "$cmd: not a symlink as required for TeX Live" unless -l $0;
-+ $cmd_dir = $rcmd_dir;
-+ my $rcmd = $cmd;
-+ # Follow symlinks, but remember last one
++ # Follow symlinks and determine $cmd_dir such that
++ # $cmd_dir/xindy -> $r0 = XINDY_SCRIPTDIR/xindy.pl
++ $r0 = $0;
+ while (-l $r0) {
-+ $cmd_dir = $rcmd_dir;
-+ $cmd = $rcmd;
++ $cmd_dir = dirname($r0);
+ $r0 = readlink($r0);
+ $r0 = "$cmd_dir/$r0" unless $r0 =~ m,^[\\/],; # relative link
-+ $rcmd_dir = dirname($r0);
-+ $rcmd = basename($r0);
+ }
-+ # Now $cmd_dir/$cmd -> $r0 = $rcmd_dir/$rcmd (not a symlink).
+ }
+
-+ $modules_dir = Cwd::realpath("$rcmd_dir/../../xindy/modules");
-+ die "$cmd: Cannot locate xindy modules directory" unless -d $modules_dir;
-+
++ # library directory
+ $lib_dir = $cmd_dir;
+
-+ if ($isW32 || $^O eq "cygwin") {
-+ $xindy_run = "$lib_dir/xindy-lisp.exe";
-+ } else {
-+ $xindy_run = "$lib_dir/xindy.run";
-+ }
-+ # FIXME: what I really want to do is 'undefine' or 'delete'
-+ $xindy_run = "" unless -e $xindy_run;
-+
-+ # FIXME: modify call_xindy() to use "$xindy_run" if it exists
++ # clisp runtime
++ my $xindy_run = ($isW32 || $^O eq "cygwin")
++ ? "$lib_dir/xindy-lisp.exe" : "$lib_dir/xindy.run";
++ $clisp = $xindy_run if -e $xindy_run;
+
+ } else { # !TL2010
+
-+ $cmd_dir = dirname($r0);
-
# library directory
if ( $ENV{XINDY_LIBDIR} ) {
-@@ -316,6 +364,7 @@
+ $lib_dir = $ENV{XINDY_LIBDIR};
+@@ -316,6 +352,8 @@
} else {
die "$cmd: Cannot locate xindy modules directory";
}
++
+ } # !TL2010
}
-@@ -324,6 +373,7 @@
+@@ -324,14 +362,10 @@
use Getopt::Long qw(:config bundling);
use File::Temp qw(tempfile tmpnam);
use File::Spec;
@@ -86,7 +78,15 @@ diff -ur -x Makefile.in -x autom4te.cache xindy.orig/user-commands/xindy.in xind
# Check arguments, store them in proper variables.
-@@ -368,7 +418,17 @@
+-#
+-# Do also something for backward compatibility: Check if this is an
+-# old-style call. If it is, we have two arguments at the end, and the
+-# second-to-last has the extension ".xdy". Then, call the old driver
+-# script with the original arguments...
+
+ sub usage ( ;$ )
+ {
+@@ -368,17 +402,21 @@
$outfile, $logfile, $language, @codepages, @modules, $input_markup,
$interactive, $mem_file);
$input_markup = 'latex';
@@ -100,11 +100,38 @@ diff -ur -x Makefile.in -x autom4te.cache xindy.orig/user-commands/xindy.in xind
+ $mem_file = "$lib_dir/xindy-i386.mem";
+ }
+}
-+die "$cmd: Cannot locate $mem_file" unless -e $mem_file;
++die "$cmd: Cannot locate $mem_file" unless -e $mem_file;
my @orig_argv = @ARGV;
parse_options();
-@@ -711,7 +771,9 @@
+
+-if ( @ARGV == 2 ) {
+- if ( $ARGV[0] =~ /\.xdy$/ ) {
+- exec "$cmd_dir/xindy.v2", @orig_argv;
+- }
+-}
+-
+
+ # This script creates temporary files. Whenever a file is created, its
+ # name is added to @temp_files. In an END handler, the temporary files
+@@ -400,6 +438,7 @@
+
+ our $raw_index = File::Spec->devnull;
+ unless ( $interactive ) {
++ for my $f (@ARGV) { die "$cmd: input file $f does not exist" unless -f $f }
+ $raw_index = create_raw_index(); # processes @ARGV
+ my $filter_cmd = '';
+ if ( $input_markup eq 'latex' ) {
+@@ -674,7 +713,7 @@
+ sub call_xindy ( $$ ) {
+ my ($mem_file, $xindy_exp) = @_;
+
+- my @command = ('clisp', '-M', $mem_file, '-E', 'iso-8859-1');
++ my @command = ($clisp, '-M', $mem_file, '-E', 'iso-8859-1');
+ if ( $interactive ) {
+ print "Proposed xindy expression:\n\n$xindy_exp\n" unless $quiet;
+ } else {
+@@ -711,7 +750,9 @@
sub output_xindy_release () {
my $version = 'unknown';
my $version_file;