summaryrefslogtreecommitdiff
path: root/Master/bin
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-01-18 01:21:18 +0000
committerKarl Berry <karl@freefriends.org>2007-01-18 01:21:18 +0000
commit2f1abdd008895e6c9c97f36683962f3d38436f45 (patch)
tree49e705b716aaf18201c2853e2f1fcfa8b91ca876 /Master/bin
parent9eb58a9100bc05f168bb60ba9987e4c842d25c03 (diff)
same fmtutil on all platforms
git-svn-id: svn://tug.org/texlive/trunk@3559 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/bin')
-rwxr-xr-xMaster/bin/alpha-linux/fmtutil1
-rwxr-xr-xMaster/bin/hppa-hpux/fmtutil1
-rwxr-xr-xMaster/bin/i386-darwin/fmtutil81
-rwxr-xr-xMaster/bin/i386-freebsd/fmtutil1
-rwxr-xr-xMaster/bin/i386-linux/fmtutil1
-rwxr-xr-xMaster/bin/i386-openbsd/fmtutil1
-rwxr-xr-xMaster/bin/i386-solaris/fmtutil1
-rwxr-xr-xMaster/bin/mips-irix/fmtutil1
-rwxr-xr-xMaster/bin/powerpc-aix/fmtutil1
-rwxr-xr-xMaster/bin/powerpc-darwin/fmtutil81
-rwxr-xr-xMaster/bin/powerpc-linux/fmtutil1
-rwxr-xr-xMaster/bin/sparc-linux/fmtutil1
-rwxr-xr-xMaster/bin/sparc-solaris/fmtutil1
13 files changed, 95 insertions, 78 deletions
diff --git a/Master/bin/alpha-linux/fmtutil b/Master/bin/alpha-linux/fmtutil
index ae04f067201..47d3af7247a 100755
--- a/Master/bin/alpha-linux/fmtutil
+++ b/Master/bin/alpha-linux/fmtutil
@@ -96,6 +96,7 @@ export PATH
cleanup()
{
rc=$1
+ # for debugging, exit $rc here so $tmpdir with its logs sticks around.
$needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
&& { cd / && rm -rf "$tmpdir"; }
(exit $rc); exit $rc
diff --git a/Master/bin/hppa-hpux/fmtutil b/Master/bin/hppa-hpux/fmtutil
index ae04f067201..47d3af7247a 100755
--- a/Master/bin/hppa-hpux/fmtutil
+++ b/Master/bin/hppa-hpux/fmtutil
@@ -96,6 +96,7 @@ export PATH
cleanup()
{
rc=$1
+ # for debugging, exit $rc here so $tmpdir with its logs sticks around.
$needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
&& { cd / && rm -rf "$tmpdir"; }
(exit $rc); exit $rc
diff --git a/Master/bin/i386-darwin/fmtutil b/Master/bin/i386-darwin/fmtutil
index e061f4f20af..47d3af7247a 100755
--- a/Master/bin/i386-darwin/fmtutil
+++ b/Master/bin/i386-darwin/fmtutil
@@ -24,10 +24,12 @@
# Options:
# --cnffile file set configfile for fmtutil
# --fmtdir directory set destination directory for format files
+# --no-engine-subdir don't use $engine subdirectory of the fmtdir
###############################################################################
###############################################################################
# program history:
+# 2007-01-04 patch by JK to support $engine subdir (enabled by default)
# Fr Apr 8 19:15:05 CEST 2005 cleanup now has an argument for the return code
# Do Mar 02 10:42:31 CET 2006 add tmpdir to TEXFORMATS
# So Mär 27 18:52:06 CEST 2005 honor $TMPDIR, $TEMP and $TMP, not just $TMP
@@ -81,7 +83,7 @@ test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"'
progname=fmtutil
argv0=$0
-version=1112981053 # seconds since `00:00:00 1970-01-01 UTC'
+version=1168729197 # seconds since `00:00:00 1970-01-01 UTC'
# date '+%s' (with GNU date)
cnf=fmtutil.cnf # name of the config file
@@ -94,6 +96,7 @@ export PATH
cleanup()
{
rc=$1
+ # for debugging, exit $rc here so $tmpdir with its logs sticks around.
$needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
&& { cd / && rm -rf "$tmpdir"; }
(exit $rc); exit $rc
@@ -198,6 +201,7 @@ Usage: fmtutil [option] ... cmd [argument]
Valid options:
--cnffile file
--fmtdir directory
+ --no-engine-subdir don't use engine-specific subdir of the fmtdir
--quiet (not implemented, just for compatibility)
--test (not implemented, just for compatibility)
--dolinks (not implemented, just for compatibility)
@@ -359,8 +363,9 @@ main()
tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/$progname.$$
verboseFlag=true
- # mktexfmtMode: if called as mktexfmt, set to true. Will echo the generated
- # filename after successful generation to stdout then (and nothing else).
+ # mktexfmtMode: if called as mktexfmt, set to true. Will echo the
+ # first generated filename after successful generation to stdout then
+ # (and nothing else), since kpathsea can only deal with one.
mktexfmtMode=false
case $argv0 in
mktexfmt|*/mktexfmt)
@@ -383,6 +388,7 @@ main()
;;
esac
+ use_engine_dir=true # whether to use web2c/$engine subdirs
while
case $1 in
--cnffile)
@@ -393,6 +399,8 @@ main()
shift; destdir=$1;;
--fmtdir=*)
destdir=`echo "$1" | sed 's/--fmtdir=//'`; shift ;;
+ --no-engine-subdir)
+ use_engine_dir=false;;
--all|-a)
cmd=all;;
--edit|-e)
@@ -547,31 +555,11 @@ main()
refresh)
recreate_existing;;
byfmt)
- create_one_format "$arg";;
+ recreate_by_fmt "$arg";;
byhyphen)
recreate_by_hyphenfile "$arg";;
esac
- # install the log files and format files:
- for i in *.log; do
- test -f "$i" || continue
- rm -f "$destdir/$i"
-
- # We don't want user-interaction for the following "mv" command:
- mv "$i" "$destdir/$i" </dev/null
- done
- for i in *.fmt *.mem *.base; do
- test -f "$i" || continue
- rm -f "$destdir/$i"
-
- # We don't want user-interaction for the following "mv" command:
- if mv "$i" "$destdir/$i" </dev/null; then
- verboseMsg "$progname: $destdir/$i installed."
- $mktexfmtMode && echo "$destdir/$i"
- fi
- mktexupd "$destdir" "$i"
- done
-
byebye
}
@@ -622,9 +610,9 @@ parse_line()
inifile=`echo $lastarg | sed 's%^\*%%'`
case "$engine" in
- mpost) fmtfile="$format.mem"; kpsefmt=mpost;;
- mf|mfw|mf-nowin) fmtfile="$format.base"; kpsefmt=mf;;
- *) fmtfile="$format.fmt"; kpsefmt=tex;;
+ mpost) fmtfile="$format.mem"; kpsefmt=mpost; texengine=metapost;;
+ mf|mfw|mf-nowin) fmtfile="$format.base"; kpsefmt=mf; texengine=metafont;;
+ *) fmtfile="$format.fmt"; kpsefmt=tex; texengine=$engine;;
esac
# See if we can find $inifile for return code:
@@ -699,16 +687,33 @@ run_initex()
verbose $engine -ini $tcxflag $jobswitch $prgswitch $texargs
) </dev/null
+ if test $use_engine_dir; then
+ fulldestdir="$destdir/$texengine"
+ else
+ fulldestdir="$destdir"
+ fi
+ mkdir -p $fulldestdir
if test -f $fmtfile; then
grep '^! ' $format.log >/dev/null 2>&1 &&
log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' possibly failed."
+ rm -f "$fulldestdir/$format.log"
+ # We don't want user-interaction for the following "mv" commands:
+ mv "$format.log" "$fulldestdir/$format.log" </dev/null
+ if mv "$fmtfile" "$fulldestdir/$fmtfile" </dev/null; then
+ verboseMsg "$progname: $fulldestdir/$fmtfile installed."
+ #
+ $mktexfmtMode && $mktexfmtFirst \
+ && echo "$fulldestdir/$fmtfile" && mktexfmtFirst=false
+ #
+ mktexupd "$fulldestdir" "$fmtfile"
+ fi
else
log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed"
fi
}
###############################################################################
-# recreate_loop(hyphenfile)
+# recreate_loop()
# for each line in config file: check match-condition and recreate format
# if there is a match
###############################################################################
@@ -723,7 +728,6 @@ recreate_loop()
do
parse_line $line || continue
check_match || continue
- echo; echo
run_initex
done
}
@@ -759,15 +763,14 @@ check_match()
}
###############################################################################
-# create_one_format(fmtname)
-# (re)create the format file for the format `fmtname'
+# recreate_by_fmt(fmtname)
+# recreate all versions of fmtname
###############################################################################
-create_one_format()
+recreate_by_fmt()
{
fmtname=$1
-
- find_info_for_name $fmtname || abort "format \`$fmtname' not available"
- run_initex
+ match_cmd="test x\$format = x$fmtname"
+ recreate_loop
}
###############################################################################
@@ -777,7 +780,7 @@ create_one_format()
create_missing()
{
# match_cmd='test ! -f $destdir/$fmtfile'
- match_cmd='test ! -f "`kpsewhich -progname=$format $fmtfile`"'
+ match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"'
recreate_loop
}
@@ -787,7 +790,7 @@ create_missing()
###############################################################################
recreate_existing()
{
- match_cmd='test -f "`kpsewhich -progname=$format $fmtfile`"'
+ match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"'
recreate_loop
}
@@ -862,7 +865,7 @@ disablefmt()
grep "^$1[ ]" $cnf_file >/dev/null || { (exit 0); return 0; }
ed $cnf_file >/dev/null 2>&1 <<-eof
- /^$1[ ]/s/^/#! /
+ g/^$1[ ]/s/^/#! /
w
q
eof
@@ -877,7 +880,7 @@ enablefmt()
{
grep "^#![ ]*$1[ ]" $cnf_file >/dev/null || { (exit 0); return 0; }
ed $cnf_file >/dev/null 2>&1 <<-eof
- /^#![ ]*$1[ ]/s/..[ ]*//
+ g/^#![ ]*$1[ ]/s/..[ ]*//
w
q
eof
diff --git a/Master/bin/i386-freebsd/fmtutil b/Master/bin/i386-freebsd/fmtutil
index ae04f067201..47d3af7247a 100755
--- a/Master/bin/i386-freebsd/fmtutil
+++ b/Master/bin/i386-freebsd/fmtutil
@@ -96,6 +96,7 @@ export PATH
cleanup()
{
rc=$1
+ # for debugging, exit $rc here so $tmpdir with its logs sticks around.
$needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
&& { cd / && rm -rf "$tmpdir"; }
(exit $rc); exit $rc
diff --git a/Master/bin/i386-linux/fmtutil b/Master/bin/i386-linux/fmtutil
index ae04f067201..47d3af7247a 100755
--- a/Master/bin/i386-linux/fmtutil
+++ b/Master/bin/i386-linux/fmtutil
@@ -96,6 +96,7 @@ export PATH
cleanup()
{
rc=$1
+ # for debugging, exit $rc here so $tmpdir with its logs sticks around.
$needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
&& { cd / && rm -rf "$tmpdir"; }
(exit $rc); exit $rc
diff --git a/Master/bin/i386-openbsd/fmtutil b/Master/bin/i386-openbsd/fmtutil
index ae04f067201..47d3af7247a 100755
--- a/Master/bin/i386-openbsd/fmtutil
+++ b/Master/bin/i386-openbsd/fmtutil
@@ -96,6 +96,7 @@ export PATH
cleanup()
{
rc=$1
+ # for debugging, exit $rc here so $tmpdir with its logs sticks around.
$needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
&& { cd / && rm -rf "$tmpdir"; }
(exit $rc); exit $rc
diff --git a/Master/bin/i386-solaris/fmtutil b/Master/bin/i386-solaris/fmtutil
index ae04f067201..47d3af7247a 100755
--- a/Master/bin/i386-solaris/fmtutil
+++ b/Master/bin/i386-solaris/fmtutil
@@ -96,6 +96,7 @@ export PATH
cleanup()
{
rc=$1
+ # for debugging, exit $rc here so $tmpdir with its logs sticks around.
$needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
&& { cd / && rm -rf "$tmpdir"; }
(exit $rc); exit $rc
diff --git a/Master/bin/mips-irix/fmtutil b/Master/bin/mips-irix/fmtutil
index ae04f067201..47d3af7247a 100755
--- a/Master/bin/mips-irix/fmtutil
+++ b/Master/bin/mips-irix/fmtutil
@@ -96,6 +96,7 @@ export PATH
cleanup()
{
rc=$1
+ # for debugging, exit $rc here so $tmpdir with its logs sticks around.
$needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
&& { cd / && rm -rf "$tmpdir"; }
(exit $rc); exit $rc
diff --git a/Master/bin/powerpc-aix/fmtutil b/Master/bin/powerpc-aix/fmtutil
index ae04f067201..47d3af7247a 100755
--- a/Master/bin/powerpc-aix/fmtutil
+++ b/Master/bin/powerpc-aix/fmtutil
@@ -96,6 +96,7 @@ export PATH
cleanup()
{
rc=$1
+ # for debugging, exit $rc here so $tmpdir with its logs sticks around.
$needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
&& { cd / && rm -rf "$tmpdir"; }
(exit $rc); exit $rc
diff --git a/Master/bin/powerpc-darwin/fmtutil b/Master/bin/powerpc-darwin/fmtutil
index e061f4f20af..47d3af7247a 100755
--- a/Master/bin/powerpc-darwin/fmtutil
+++ b/Master/bin/powerpc-darwin/fmtutil
@@ -24,10 +24,12 @@
# Options:
# --cnffile file set configfile for fmtutil
# --fmtdir directory set destination directory for format files
+# --no-engine-subdir don't use $engine subdirectory of the fmtdir
###############################################################################
###############################################################################
# program history:
+# 2007-01-04 patch by JK to support $engine subdir (enabled by default)
# Fr Apr 8 19:15:05 CEST 2005 cleanup now has an argument for the return code
# Do Mar 02 10:42:31 CET 2006 add tmpdir to TEXFORMATS
# So Mär 27 18:52:06 CEST 2005 honor $TMPDIR, $TEMP and $TMP, not just $TMP
@@ -81,7 +83,7 @@ test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"'
progname=fmtutil
argv0=$0
-version=1112981053 # seconds since `00:00:00 1970-01-01 UTC'
+version=1168729197 # seconds since `00:00:00 1970-01-01 UTC'
# date '+%s' (with GNU date)
cnf=fmtutil.cnf # name of the config file
@@ -94,6 +96,7 @@ export PATH
cleanup()
{
rc=$1
+ # for debugging, exit $rc here so $tmpdir with its logs sticks around.
$needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
&& { cd / && rm -rf "$tmpdir"; }
(exit $rc); exit $rc
@@ -198,6 +201,7 @@ Usage: fmtutil [option] ... cmd [argument]
Valid options:
--cnffile file
--fmtdir directory
+ --no-engine-subdir don't use engine-specific subdir of the fmtdir
--quiet (not implemented, just for compatibility)
--test (not implemented, just for compatibility)
--dolinks (not implemented, just for compatibility)
@@ -359,8 +363,9 @@ main()
tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/$progname.$$
verboseFlag=true
- # mktexfmtMode: if called as mktexfmt, set to true. Will echo the generated
- # filename after successful generation to stdout then (and nothing else).
+ # mktexfmtMode: if called as mktexfmt, set to true. Will echo the
+ # first generated filename after successful generation to stdout then
+ # (and nothing else), since kpathsea can only deal with one.
mktexfmtMode=false
case $argv0 in
mktexfmt|*/mktexfmt)
@@ -383,6 +388,7 @@ main()
;;
esac
+ use_engine_dir=true # whether to use web2c/$engine subdirs
while
case $1 in
--cnffile)
@@ -393,6 +399,8 @@ main()
shift; destdir=$1;;
--fmtdir=*)
destdir=`echo "$1" | sed 's/--fmtdir=//'`; shift ;;
+ --no-engine-subdir)
+ use_engine_dir=false;;
--all|-a)
cmd=all;;
--edit|-e)
@@ -547,31 +555,11 @@ main()
refresh)
recreate_existing;;
byfmt)
- create_one_format "$arg";;
+ recreate_by_fmt "$arg";;
byhyphen)
recreate_by_hyphenfile "$arg";;
esac
- # install the log files and format files:
- for i in *.log; do
- test -f "$i" || continue
- rm -f "$destdir/$i"
-
- # We don't want user-interaction for the following "mv" command:
- mv "$i" "$destdir/$i" </dev/null
- done
- for i in *.fmt *.mem *.base; do
- test -f "$i" || continue
- rm -f "$destdir/$i"
-
- # We don't want user-interaction for the following "mv" command:
- if mv "$i" "$destdir/$i" </dev/null; then
- verboseMsg "$progname: $destdir/$i installed."
- $mktexfmtMode && echo "$destdir/$i"
- fi
- mktexupd "$destdir" "$i"
- done
-
byebye
}
@@ -622,9 +610,9 @@ parse_line()
inifile=`echo $lastarg | sed 's%^\*%%'`
case "$engine" in
- mpost) fmtfile="$format.mem"; kpsefmt=mpost;;
- mf|mfw|mf-nowin) fmtfile="$format.base"; kpsefmt=mf;;
- *) fmtfile="$format.fmt"; kpsefmt=tex;;
+ mpost) fmtfile="$format.mem"; kpsefmt=mpost; texengine=metapost;;
+ mf|mfw|mf-nowin) fmtfile="$format.base"; kpsefmt=mf; texengine=metafont;;
+ *) fmtfile="$format.fmt"; kpsefmt=tex; texengine=$engine;;
esac
# See if we can find $inifile for return code:
@@ -699,16 +687,33 @@ run_initex()
verbose $engine -ini $tcxflag $jobswitch $prgswitch $texargs
) </dev/null
+ if test $use_engine_dir; then
+ fulldestdir="$destdir/$texengine"
+ else
+ fulldestdir="$destdir"
+ fi
+ mkdir -p $fulldestdir
if test -f $fmtfile; then
grep '^! ' $format.log >/dev/null 2>&1 &&
log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' possibly failed."
+ rm -f "$fulldestdir/$format.log"
+ # We don't want user-interaction for the following "mv" commands:
+ mv "$format.log" "$fulldestdir/$format.log" </dev/null
+ if mv "$fmtfile" "$fulldestdir/$fmtfile" </dev/null; then
+ verboseMsg "$progname: $fulldestdir/$fmtfile installed."
+ #
+ $mktexfmtMode && $mktexfmtFirst \
+ && echo "$fulldestdir/$fmtfile" && mktexfmtFirst=false
+ #
+ mktexupd "$fulldestdir" "$fmtfile"
+ fi
else
log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed"
fi
}
###############################################################################
-# recreate_loop(hyphenfile)
+# recreate_loop()
# for each line in config file: check match-condition and recreate format
# if there is a match
###############################################################################
@@ -723,7 +728,6 @@ recreate_loop()
do
parse_line $line || continue
check_match || continue
- echo; echo
run_initex
done
}
@@ -759,15 +763,14 @@ check_match()
}
###############################################################################
-# create_one_format(fmtname)
-# (re)create the format file for the format `fmtname'
+# recreate_by_fmt(fmtname)
+# recreate all versions of fmtname
###############################################################################
-create_one_format()
+recreate_by_fmt()
{
fmtname=$1
-
- find_info_for_name $fmtname || abort "format \`$fmtname' not available"
- run_initex
+ match_cmd="test x\$format = x$fmtname"
+ recreate_loop
}
###############################################################################
@@ -777,7 +780,7 @@ create_one_format()
create_missing()
{
# match_cmd='test ! -f $destdir/$fmtfile'
- match_cmd='test ! -f "`kpsewhich -progname=$format $fmtfile`"'
+ match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"'
recreate_loop
}
@@ -787,7 +790,7 @@ create_missing()
###############################################################################
recreate_existing()
{
- match_cmd='test -f "`kpsewhich -progname=$format $fmtfile`"'
+ match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"'
recreate_loop
}
@@ -862,7 +865,7 @@ disablefmt()
grep "^$1[ ]" $cnf_file >/dev/null || { (exit 0); return 0; }
ed $cnf_file >/dev/null 2>&1 <<-eof
- /^$1[ ]/s/^/#! /
+ g/^$1[ ]/s/^/#! /
w
q
eof
@@ -877,7 +880,7 @@ enablefmt()
{
grep "^#![ ]*$1[ ]" $cnf_file >/dev/null || { (exit 0); return 0; }
ed $cnf_file >/dev/null 2>&1 <<-eof
- /^#![ ]*$1[ ]/s/..[ ]*//
+ g/^#![ ]*$1[ ]/s/..[ ]*//
w
q
eof
diff --git a/Master/bin/powerpc-linux/fmtutil b/Master/bin/powerpc-linux/fmtutil
index ae04f067201..47d3af7247a 100755
--- a/Master/bin/powerpc-linux/fmtutil
+++ b/Master/bin/powerpc-linux/fmtutil
@@ -96,6 +96,7 @@ export PATH
cleanup()
{
rc=$1
+ # for debugging, exit $rc here so $tmpdir with its logs sticks around.
$needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
&& { cd / && rm -rf "$tmpdir"; }
(exit $rc); exit $rc
diff --git a/Master/bin/sparc-linux/fmtutil b/Master/bin/sparc-linux/fmtutil
index ae04f067201..47d3af7247a 100755
--- a/Master/bin/sparc-linux/fmtutil
+++ b/Master/bin/sparc-linux/fmtutil
@@ -96,6 +96,7 @@ export PATH
cleanup()
{
rc=$1
+ # for debugging, exit $rc here so $tmpdir with its logs sticks around.
$needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
&& { cd / && rm -rf "$tmpdir"; }
(exit $rc); exit $rc
diff --git a/Master/bin/sparc-solaris/fmtutil b/Master/bin/sparc-solaris/fmtutil
index ae04f067201..47d3af7247a 100755
--- a/Master/bin/sparc-solaris/fmtutil
+++ b/Master/bin/sparc-solaris/fmtutil
@@ -96,6 +96,7 @@ export PATH
cleanup()
{
rc=$1
+ # for debugging, exit $rc here so $tmpdir with its logs sticks around.
$needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \
&& { cd / && rm -rf "$tmpdir"; }
(exit $rc); exit $rc