summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-08-03 18:33:06 +0000
committerKarl Berry <karl@freefriends.org>2012-08-03 18:33:06 +0000
commitd17e2b92c41d19da876a3ede4bb61ec4f316199d (patch)
tree241b8dc4dd6443148b67d3d989f4c4284ba40e5e /Build
parenta62a786556ccac143ed30c9058d25483c04b6950 (diff)
initial generic -sys wrapper (in Perl)
git-svn-id: svn://tug.org/texlive/trunk@27297 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/tetex/ChangeLog4
-rwxr-xr-xBuild/source/texk/tetex/tl-sys-wrapper.pl34
2 files changed, 38 insertions, 0 deletions
diff --git a/Build/source/texk/tetex/ChangeLog b/Build/source/texk/tetex/ChangeLog
index 5bf9b8f1c2e..b09c6d2cf5d 100644
--- a/Build/source/texk/tetex/ChangeLog
+++ b/Build/source/texk/tetex/ChangeLog
@@ -1,3 +1,7 @@
+2012-08-03 Karl Berry <karl@tug.org>
+
+ * tl-sys-wrapper.pl: initial attempt.
+
2012-07-31 Norbert Preining <preining@logic.at>
* updmap.pl (main): fix quoting and var expansion on Windows.
diff --git a/Build/source/texk/tetex/tl-sys-wrapper.pl b/Build/source/texk/tetex/tl-sys-wrapper.pl
new file mode 100755
index 00000000000..fead6394d3a
--- /dev/null
+++ b/Build/source/texk/tetex/tl-sys-wrapper.pl
@@ -0,0 +1,34 @@
+#!/usr/bin/env perl
+# $Id$
+# Public domain. Perl version originally written by Karl Berry, 2012.
+# Earlier shell version by Thomas Esser.
+#
+# Generic -sys wrapper. Symlink to this script as updmap-sys,
+# fmtutil-sys, etc.
+
+&main (); # never returns.
+
+sub main {
+ chomp (my $v = `kpsewhich -var-value TEXMFSYSVAR`);
+ die "$0: could not retrieve TEXMFSYSVAR value with kpsewhich: $!"
+ if ! $v;
+ $ENV{"TEXMFVAR"} = $v;
+
+ chomp (my $c = `kpsewhich -var-value TEXMFSYSCONFIG`);
+ die "$0: could not retrieve TEXMFSYSCONFIG value with kpsewhich: $!"
+ if ! $c;
+ $ENV{"TEXMFCONFIG"} = $c;
+
+ # updmap-sys -> updmap, etc. Case insensitive needed for Windows,
+ # but doesn't seem bad on Unix either.
+ (my $progname = $0) =~ s/-sys$//i;
+ die "$0: program name does not end in -sys" if $progname eq $0;
+
+ #warn "doing exec $0, $progname, @ARGV";
+
+ # execute the program name we computed, with whatever arguments we have.
+ exec ($progname, @ARGV);
+
+ # should never get here.
+ die "$0: exec($progname, @ARGV) failed: $!";
+}