blob: fead6394d3a84f3801672dc04b7345ccef415f03 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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: $!";
}
|