summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2009-12-11 11:11:13 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2009-12-11 11:11:13 +0000
commit44869a4834bf127ee87ce2f61d50efbd52ea6d57 (patch)
tree978139c5df125ddb8491078c694be64ab261be44
parentf101ac96582b8509fc5ad906b2cbdb97bce9e29a (diff)
xindy-new update
git-svn-id: svn://tug.org/texlive/trunk@16361 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/ChangeLog7
-rw-r--r--Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-22-TL-xindy_pl11
-rw-r--r--Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-26-TL-texindy_pl90
-rw-r--r--Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-27-check-exist11
-rw-r--r--Build/source/utils/xindy-new/xindy/user-commands/texindy.in51
-rw-r--r--Build/source/utils/xindy-new/xindy/user-commands/xindy.in9
6 files changed, 159 insertions, 20 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 c1fb3d37dfc..e3410781a8a 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,3 +1,10 @@
+2009-12-11 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-26-TL-texindy_pl (new): Adapt texindy perl script for
+ use in TL.
+ * patch-27-check-exist (new): Check existence of input files
+ (from TL2008).
+
2009-12-10 Peter Breitenlohner <peb@mppmu.mpg.de>
* patch-24-TL-use-xindy_run (new): Invoke either 'xindy.run'
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 73b704df714..5bdf726d340 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
@@ -1,5 +1,8 @@
Determine lib_dir and modules_dir in the xindy perl script.
+ Also implement symlinks, e.g., in /usr/local/bin/ for
+ standalone version.
+
ToDo:
Modify call_xindy() to use "$xindy_run" if it exists.
@@ -29,8 +32,9 @@ diff -ur -x Makefile.in -x autom4te.cache xindy.orig/user-commands/xindy.in xind
+ $cmd = basename($0);
+
+ if ($isW32) {
-+ $cmd_dir = "$rcmd_dir/../../../bin/win32";
++ $cmd_dir = "$rcmd_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
@@ -38,12 +42,11 @@ diff -ur -x Makefile.in -x autom4te.cache xindy.orig/user-commands/xindy.in xind
+ $cmd_dir = $rcmd_dir;
+ $cmd = $rcmd;
+ $r0 = readlink($r0);
-+ $r0 = "$cmd_dir/$r0" unless $r0 =~ m,^[\\/],; # relative link
++ $r0 = "$cmd_dir/$r0" unless $r0 =~ m,^[\\/],; # relative link
+ $rcmd_dir = dirname($r0);
+ $rcmd = basename($r0);
+ }
-+ # Now $r0 = $rcmd_dir/$rcmd is a real file (no symlink) and
-+ # $cmd_dir/$cmd is either = $0 = $r0, or a symlink -> $r0.
++ # Now $cmd_dir/$cmd -> $r0 = $rcmd_dir/$rcmd (not a symlink).
+ }
+
+ $modules_dir = "$rcmd_dir/../../xindy/modules";
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
new file mode 100644
index 00000000000..cccf6f665dd
--- /dev/null
+++ b/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-26-TL-texindy_pl
@@ -0,0 +1,90 @@
+ Determine lib_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
+@@ -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 $xindy;
+ our ($cmd_dir, $cmd);
+ BEGIN {
+- $cmd_dir = dirname($0);
++ $isW32 = ($^O =~ /^MSWin/i) ? 1 : 0;
++ my $r0 = Cwd::realpath($0);
++ $cmd_dir = dirname($r0);
++ $isTL = (basename($r0) =~ /\.pl/) ? 1 : 0;
++
+ $cmd = basename($0);
++
++ if ($isTL) {
++ if ($isW32) {
++ $xindy = "$cmd_dir/../../../bin/win32/xindy.exe";
++ } else {
++ die "$cmd: not a symlink as required for TeX Live" unless -l $0;
++ $r0 = $0;
++ $cmd_dir = dirname($r0);
++ # Follow symlinks, but remember last one
++ my $lcmd_dir;
++ while ( -l $r0 ) {
++ $lcmd_dir = $cmd_dir;
++ $r0 = readlink($r0);
++ $r0 = "$lcmd_dir/$r0" unless $r0 =~ m,^[\\/],; # relative link
++ $cmd_dir = dirname($r0);
++ }
++ $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";
++ } else {
++ $xindy = "$cmd_dir/xindy";
++ }
++ die "$cmd: cannot locate xindy\n" unless -f $xindy && ($isW32 || -x $xindy);
+ }
+
+
+@@ -359,15 +393,6 @@
+ $codepage = 'latin';
+ $input_markup = 'latex';
+
+-our $xindy;
+-if ( -f "$cmd_dir/xindy" && -x _ ) {
+- $xindy = "$cmd_dir/xindy";
+-} elsif ( -f "$cmd_dir/xindy.pl" && -x _ ) {
+- $xindy = "$cmd_dir/xindy.pl";
+-} else {
+- die "$cmd: cannot locate xindy\n";
+-}
+-
+ 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 @@
+ @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);
+
+ 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-2.4-pre2-PATCHES/patch-27-check-exist b/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-27-check-exist
new file mode 100644
index 00000000000..076326feb72
--- /dev/null
+++ b/Build/source/utils/xindy-new/xindy-2.4-pre2-PATCHES/patch-27-check-exist
@@ -0,0 +1,11 @@
+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-10 10:57:20.000000000 +0100
++++ xindy/user-commands/xindy.in 2009-12-11 11:13:31.000000000 +0100
+@@ -453,6 +453,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' ) {
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 4fd94a2c679..1774614638e 100644
--- a/Build/source/utils/xindy-new/xindy/user-commands/texindy.in
+++ b/Build/source/utils/xindy-new/xindy/user-commands/texindy.in
@@ -306,10 +306,44 @@ BEGIN {
# Determine environment. Where is our library directory, and our modules?
use File::Basename;
+use Cwd;
+our ($isW32, $isTL, $lib_dir);
+our $xindy;
our ($cmd_dir, $cmd);
BEGIN {
- $cmd_dir = dirname($0);
+ $isW32 = ($^O =~ /^MSWin/i) ? 1 : 0;
+ my $r0 = Cwd::realpath($0);
+ $cmd_dir = dirname($r0);
+ $isTL = (basename($r0) =~ /\.pl/) ? 1 : 0;
+
$cmd = basename($0);
+
+ if ($isTL) {
+ if ($isW32) {
+ $xindy = "$cmd_dir/../../../bin/win32/xindy.exe";
+ } else {
+ die "$cmd: not a symlink as required for TeX Live" unless -l $0;
+ $r0 = $0;
+ $cmd_dir = dirname($r0);
+ # Follow symlinks, but remember last one
+ my $lcmd_dir;
+ while ( -l $r0 ) {
+ $lcmd_dir = $cmd_dir;
+ $r0 = readlink($r0);
+ $r0 = "$lcmd_dir/$r0" unless $r0 =~ m,^[\\/],; # relative link
+ $cmd_dir = dirname($r0);
+ }
+ $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";
+ } else {
+ $xindy = "$cmd_dir/xindy";
+ }
+ die "$cmd: cannot locate xindy\n" unless -f $xindy && ($isW32 || -x $xindy);
}
@@ -359,15 +393,6 @@ $language = 'general';
$codepage = 'latin';
$input_markup = 'latex';
-our $xindy;
-if ( -f "$cmd_dir/xindy" && -x _ ) {
- $xindy = "$cmd_dir/xindy";
-} elsif ( -f "$cmd_dir/xindy.pl" && -x _ ) {
- $xindy = "$cmd_dir/xindy.pl";
-} else {
- die "$cmd: cannot locate xindy\n";
-}
-
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 @@ push (@opt, map { ('-M', $_) } ($ENV{TEXINDY_AUTO_MODULE} || 'texindy',
@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);
exec $xindy, @opt, @ARGV;
die "$cmd: could not execute xindy: $!\n";
@@ -459,7 +484,9 @@ sub output_version () {
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/xindy.in b/Build/source/utils/xindy-new/xindy/user-commands/xindy.in
index 1d5f31f7f53..5333c212d85 100644
--- a/Build/source/utils/xindy-new/xindy/user-commands/xindy.in
+++ b/Build/source/utils/xindy-new/xindy/user-commands/xindy.in
@@ -309,8 +309,9 @@ BEGIN {
$cmd = basename($0);
if ($isW32) {
- $cmd_dir = "$rcmd_dir/../../../bin/win32";
+ $cmd_dir = "$rcmd_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
@@ -318,12 +319,11 @@ BEGIN {
$cmd_dir = $rcmd_dir;
$cmd = $rcmd;
$r0 = readlink($r0);
- $r0 = "$cmd_dir/$r0" unless $r0 =~ m,^[\\/],; # relative link
+ $r0 = "$cmd_dir/$r0" unless $r0 =~ m,^[\\/],; # relative link
$rcmd_dir = dirname($r0);
$rcmd = basename($r0);
}
- # Now $r0 = $rcmd_dir/$rcmd is a real file (no symlink) and
- # $cmd_dir/$cmd is either = $0 = $r0, or a symlink -> $r0.
+ # Now $cmd_dir/$cmd -> $r0 = $rcmd_dir/$rcmd (not a symlink).
}
$modules_dir = "$rcmd_dir/../../xindy/modules";
@@ -453,6 +453,7 @@ END {
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' ) {