diff -urk.orig teTeX-src-2.0-rc1/texk/tetex.orig/fmtutil teTeX-src-2.0-rc1/texk/tetex/fmtutil --- teTeX-src-2.0-rc1/texk/tetex.orig/fmtutil 2002-12-28 15:37:43 +0300 +++ teTeX-src-2.0-rc1/texk/tetex/fmtutil 2003-10-20 23:28:43 +0400 @@ -251,199 +251,6 @@ } ############################################################################### -# main() -# parse commandline arguments, initialize variables, -# switch into temp. direcrory, execute desired command -############################################################################### -main() -{ - destdir= # global variable: where do we put the format files? - cnf_file= # global variable: full name of the config file - cmd= # desired action from command line - needsCleanup=false - need_find_hyphenfile=false - - # mktexfmtMode: if called as mktexfmt, set to true. Will echo the generated - # filename after successful generation to stdout then (and nothing else). - mktexfmtMode=false - case $0 in - mktexfmt|*/mktexfmt) - mktexfmtMode=true - fullfmt=$1; shift - case $fullfmt in - *.oft|*.fmt|*.efmt|*.mem|*.base) - set x --byfmt `echo $fullfmt | sed 's@\.[a-z]*$@@'` ${1+"$@"}; shift - ;; - *) abort "unknown format type: $fullfmt" - ;; - esac - ;; - esac - - while - case $1 in - --cnffile) - shift; cnf_file=$1;; - --cnffile=*) - cnf_file=`echo "$1" | sed 's/--cnffile=//'`; shift ;; - --fmtdir) - shift; destdir=$1;; - --fmtdir=*) - destdir=`echo "$1" | sed 's/--fmtdir=//'`; shift ;; - --all|-a) - cmd=all;; - --edit|-e) - cmd=edit;; - --missing|-m) - cmd=missing;; - --byfmt|-f) - shift; cmd=byfmt; arg=$1;; - --byfmt=*) - cmd=byfmt; arg=`echo "$1" | sed 's/--byfmt=//'`; shift ;; - --byhyphen|-h) - shift; cmd=byhyphen; arg=$1;; - --byhyphen=*) - cmd=byhyphen; arg=`echo "$1" | sed 's/--byhyphen=//'`; shift ;; - --showhyphen|-s) - shift; cmd=showhyphen; arg=$1;; - --showhyphen=*) - cmd=showhyphen; arg=`echo "$1" | sed 's/--showhyphen=//'`; shift ;; - --help|-help) - cmd=help;; - --enablefmt) - shift; cmd=enablefmt; arg=$1;; - --enablefmt=*) - cmd=enablefmt; arg=`echo "$1" | sed 's/--enablefmt=//'`; shift ;; - --disablefmt) - shift; cmd=disablefmt; arg=$1;; - --disablefmt=*) - cmd=disablefmt; arg=`echo "$1" | sed 's/--disablefmt=//'`; shift ;; - --listcfg) - cmd=listcfg;; - --quiet|--test|--dolinks|--force) - ;; - "") break;; - *) echo "$progname: unknown option \`$1' ignored." >&2;; - esac - do test $# -gt 0 && shift; done - - case "$cmd" in - help|"") help;; - esac - cache_vars - - # if no cnf_file from command-line, look it up with kpsewhich: - test -z "$cnf_file" && cnf_file=`kpsewhich --format='web2c files' $cnf` - test -f "$cnf_file" || abort "config file \`$cnf' not found" - - # showhyphen and edit do not need any temp. directory, so do it here: - case "$cmd" in - showhyphen) - show_hyphen_file "$arg" - cleanup - ;; - edit) - ${VISUAL-${EDITOR-vi}} $cnf_file - cleanup - ;; - enablefmt|disablefmt) - $cmd $arg - cleanup - ;; - listcfg) - listcfg - cleanup - ;; - esac - - # set up destdir: - test -z "$MT_TEXMFMAIN" && abort "could not expand variable \$TEXMFMAIN" - if test -z "$destdir"; then - : ${VARTEXMF=`kpsewhich -expand-var='$VARTEXMF'`} - test -z "$VARTEXMF" && VARTEXMF=$MT_TEXMFMAIN - destdir=$VARTEXMF/web2c - fi - test -d "$destdir" || $MT_MKTEXDIR "$destdir" >/dev/null 2>&1 - test -d "$destdir" || abort "format directory \`$destdir' does not exist" - - # find mktexupd script: - test -n "$MT_MKTEXUPD" || MT_MKTEXUPD="$TEXMFMAIN/web2c/mktexupd" - - thisdir=`pwd` - : ${KPSE_DOT=$thisdir} - export KPSE_DOT - - tmpdir=${TMP-/tmp}/$progname.$$ - setupTmpDir - cd "$tmpdir" || { - false # some systems need this to set nonzero $? - cleanup - } - - # make local paths absolute: - case "$destdir" in - /*) ;; - *) destdir="$thisdir/$destdir";; - esac - case "$cnf_file" in - /*) ;; - *) cnf_file="$thisdir/$cnf_file";; - esac - - init_log_failure - # execute the desired command: - case "$cmd" in - all) - recreate_all;; - missing) - create_missing;; - byfmt) - create_one_format "$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" - mv "$i" "$destdir/$i" - done - for i in *.oft *.fmt *.efmt *.mem *.base; do - test -f "$i" || continue - rm -f "$destdir/$i" - if mv "$i" "$destdir/$i"; then - verbose echo "$progname: $destdir/$i installed." - $mktexfmtMode && echo "$destdir/$i" - fi - $MT_MKTEXUPD "$destdir" "$i" - done - - # symlinks for "plain" (tex/etex/mf/mpost) - if test -f "$destdir/tex.fmt" && test ! -f "$destdir/plain.fmt"; then - ln -s tex.fmt "$destdir/plain.fmt" - $MT_MKTEXUPD "$destdir" plain.fmt - fi - if test -f "$destdir/tex.efmt" && test ! -f "$destdir/plain.efmt"; then - ln -s tex.efmt "$destdir/plain.efmt" - $MT_MKTEXUPD "$destdir" plain.efmt - fi - if test -f "$destdir/mf.base" && test ! -f "$destdir/plain.base"; then - ln -s mf.base "$destdir/plain.base" - $MT_MKTEXUPD "$destdir" mf.base - fi - if test -f "$destdir/mf.base" && test ! -f "$destdir/mf-nowin.base"; then - ln -s mf.base "$destdir/mf-nowin.base" - $MT_MKTEXUPD "$destdir" mf-nowin.base - fi - if test -f "$destdir/mpost.mem" && test ! -f "$destdir/plain.mem"; then - ln -s mpost.mem "$destdir/plain.mem" - $MT_MKTEXUPD "$destdir" plain.mem - fi - byebye -} - -############################################################################### # parse_line(config_line) sets global variables: # format: name of the format, e.g. pdflatex # engine: name of the TeX engine, e.g. tex, etex, pdftex @@ -719,6 +526,199 @@ return 0 } +############################################################################### +# main() +# parse commandline arguments, initialize variables, +# switch into temp. direcrory, execute desired command +############################################################################### +main() +{ + destdir= # global variable: where do we put the format files? + cnf_file= # global variable: full name of the config file + cmd= # desired action from command line + needsCleanup=false + need_find_hyphenfile=false + + # mktexfmtMode: if called as mktexfmt, set to true. Will echo the generated + # filename after successful generation to stdout then (and nothing else). + mktexfmtMode=false + case $0 in + mktexfmt|*/mktexfmt) + mktexfmtMode=true + fullfmt=$1; shift + case $fullfmt in + *.oft|*.fmt|*.efmt|*.mem|*.base) + set x --byfmt `echo $fullfmt | sed 's@\.[a-z]*$@@'` ${1+"$@"}; shift + ;; + *) abort "unknown format type: $fullfmt" + ;; + esac + ;; + esac + + while + case $1 in + --cnffile) + shift; cnf_file=$1;; + --cnffile=*) + cnf_file=`echo "$1" | sed 's/--cnffile=//'`; shift ;; + --fmtdir) + shift; destdir=$1;; + --fmtdir=*) + destdir=`echo "$1" | sed 's/--fmtdir=//'`; shift ;; + --all|-a) + cmd=all;; + --edit|-e) + cmd=edit;; + --missing|-m) + cmd=missing;; + --byfmt|-f) + shift; cmd=byfmt; arg=$1;; + --byfmt=*) + cmd=byfmt; arg=`echo "$1" | sed 's/--byfmt=//'`; shift ;; + --byhyphen|-h) + shift; cmd=byhyphen; arg=$1;; + --byhyphen=*) + cmd=byhyphen; arg=`echo "$1" | sed 's/--byhyphen=//'`; shift ;; + --showhyphen|-s) + shift; cmd=showhyphen; arg=$1;; + --showhyphen=*) + cmd=showhyphen; arg=`echo "$1" | sed 's/--showhyphen=//'`; shift ;; + --help|-help) + cmd=help;; + --enablefmt) + shift; cmd=enablefmt; arg=$1;; + --enablefmt=*) + cmd=enablefmt; arg=`echo "$1" | sed 's/--enablefmt=//'`; shift ;; + --disablefmt) + shift; cmd=disablefmt; arg=$1;; + --disablefmt=*) + cmd=disablefmt; arg=`echo "$1" | sed 's/--disablefmt=//'`; shift ;; + --listcfg) + cmd=listcfg;; + --quiet|--test|--dolinks|--force) + ;; + "") break;; + *) echo "$progname: unknown option \`$1' ignored." >&2;; + esac + do test $# -gt 0 && shift; done + + case "$cmd" in + help|"") help;; + esac + cache_vars + + # if no cnf_file from command-line, look it up with kpsewhich: + test -z "$cnf_file" && cnf_file=`kpsewhich --format='web2c files' $cnf` + test -f "$cnf_file" || abort "config file \`$cnf' not found" + + # showhyphen and edit do not need any temp. directory, so do it here: + case "$cmd" in + showhyphen) + show_hyphen_file "$arg" + cleanup + ;; + edit) + ${VISUAL-${EDITOR-vi}} $cnf_file + cleanup + ;; + enablefmt|disablefmt) + $cmd $arg + cleanup + ;; + listcfg) + listcfg + cleanup + ;; + esac + + # set up destdir: + test -z "$MT_TEXMFMAIN" && abort "could not expand variable \$TEXMFMAIN" + if test -z "$destdir"; then + : ${VARTEXMF=`kpsewhich -expand-var='$VARTEXMF'`} + test -z "$VARTEXMF" && VARTEXMF=$MT_TEXMFMAIN + destdir=$VARTEXMF/web2c + fi + test -d "$destdir" || $MT_MKTEXDIR "$destdir" >/dev/null 2>&1 + test -d "$destdir" || abort "format directory \`$destdir' does not exist" + + # find mktexupd script: + test -n "$MT_MKTEXUPD" || MT_MKTEXUPD="$TEXMFMAIN/web2c/mktexupd" + + thisdir=`pwd` + : ${KPSE_DOT=$thisdir} + export KPSE_DOT + + tmpdir=${TMP-/tmp}/$progname.$$ + setupTmpDir + cd "$tmpdir" || { + false # some systems need this to set nonzero $? + cleanup + } + + # make local paths absolute: + case "$destdir" in + /*) ;; + *) destdir="$thisdir/$destdir";; + esac + case "$cnf_file" in + /*) ;; + *) cnf_file="$thisdir/$cnf_file";; + esac + + init_log_failure + # execute the desired command: + case "$cmd" in + all) + recreate_all;; + missing) + create_missing;; + byfmt) + create_one_format "$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" + mv "$i" "$destdir/$i" + done + for i in *.oft *.fmt *.efmt *.mem *.base; do + test -f "$i" || continue + rm -f "$destdir/$i" + if mv "$i" "$destdir/$i"; then + verbose echo "$progname: $destdir/$i installed." + $mktexfmtMode && echo "$destdir/$i" + fi + $MT_MKTEXUPD "$destdir" "$i" + done + + # symlinks for "plain" (tex/etex/mf/mpost) + if test -f "$destdir/tex.fmt" && test ! -f "$destdir/plain.fmt"; then + ln -s tex.fmt "$destdir/plain.fmt" + $MT_MKTEXUPD "$destdir" plain.fmt + fi + if test -f "$destdir/tex.efmt" && test ! -f "$destdir/plain.efmt"; then + ln -s tex.efmt "$destdir/plain.efmt" + $MT_MKTEXUPD "$destdir" plain.efmt + fi + if test -f "$destdir/mf.base" && test ! -f "$destdir/plain.base"; then + ln -s mf.base "$destdir/plain.base" + $MT_MKTEXUPD "$destdir" mf.base + fi + if test -f "$destdir/mf.base" && test ! -f "$destdir/mf-nowin.base"; then + ln -s mf.base "$destdir/mf-nowin.base" + $MT_MKTEXUPD "$destdir" mf-nowin.base + fi + if test -f "$destdir/mpost.mem" && test ! -f "$destdir/plain.mem"; then + ln -s mpost.mem "$destdir/plain.mem" + $MT_MKTEXUPD "$destdir" plain.mem + fi + byebye +} + main ${1+"$@"} true cleanup diff -urk.orig teTeX-src-2.0-rc1/texk/tetex.orig/texconfig teTeX-src-2.0-rc1/texk/tetex/texconfig --- teTeX-src-2.0-rc1/texk/tetex.orig/texconfig 2003-01-05 16:44:32 +0300 +++ teTeX-src-2.0-rc1/texk/tetex/texconfig 2003-10-20 22:16:21 +0400 @@ -363,6 +363,8 @@ edit_hyphen } +yesno() { run_dialog --yesno ${1+"$@"}; } + choose_mode() { out=$1 @@ -387,15 +389,12 @@ fi } -get_default_mode() +run_config_mf() { - choose_mode "$tmpans" 'Choose a default mode for xdvi, dvips, pdftex and metafont. As a rule\nof thumb, choose the most commonly mode used for printing at your site.' - default_mode=`cat "$tmpans"` - test -z "$default_mode" && return - - cls - do_set_default_mode "$default_mode" 2>&1 | tee -a "$log" - + echo "Running mf to create plain base ..." + fmtutil --byfmt mf + fmtutil --byfmt mfw + echo "Done."; echo } do_set_default_mode() @@ -417,12 +416,15 @@ } -run_config_mf() +get_default_mode() { - echo "Running mf to create plain base ..." - fmtutil --byfmt mf - fmtutil --byfmt mfw - echo "Done."; echo + choose_mode "$tmpans" 'Choose a default mode for xdvi, dvips, pdftex and metafont. As a rule\nof thumb, choose the most commonly mode used for printing at your site.' + default_mode=`cat "$tmpans"` + test -z "$default_mode" && return + + cls + do_set_default_mode "$default_mode" 2>&1 | tee -a "$log" + } run_setup_mf_mode() @@ -502,8 +504,6 @@ } -yesno() { run_dialog --yesno ${1+"$@"}; } - dvips_setup_mode() { choose_mode "$tmpans" "Choose the metafont mode for printer '$printer'" "for printer $printer" @@ -1169,55 +1169,6 @@ config_replace "$config" '^p' "p $paper" } -cmd_mode() -{ - case "$1" in - faq) cls; test -f $FAQ && <$FAQ eval $PAGER; fix_pager_more;; - conf) do_print_setup;; - formats) config_formats;; - hyphen) shift; do_edit_hyphen ${1+"$@"} ;; - mode) shift; cmd_mode_set_default_mode ${1+"$@"} ;; - xdvi) shift; cmd_mode_xdvi ${1+"$@"};; - dvips) shift; cmd_mode_dvips ${1+"$@"};; - dvipdfm) shift; cmd_mode_dvipdfm ${1+"$@"};; - pdftex) shift; cmd_mode_pdftex ${1+"$@"};; - font) shift; cmd_mode_maketex ${1+"$@"};; - confall) do_print_all_setup;; - init) if test -z "$2"; then - init_all; - else - fmtutil --byfmt "$2"; - $DO_TEXLINKS && texlinks --multiplatform - fi;; - *) echo "Usage: texconfig conf" >&2 - echo " texconfig confall" >&2 - echo " texconfig rehash" >&2 - echo " texconfig formats" >&2 - echo " texconfig localsetup" >&2 - echo " texconfig hyphen FORMAT" >&2 - echo " texconfig mode [options]" >&2 - echo " texconfig xdvi [options] ..." >&2 - echo " texconfig dvips [options] ..." >&2 - echo " texconfig dvipdfm [options] ..." >&2 - echo " texconfig pdftex [options] ..." >&2 - echo " texconfig font [options] ..." >&2 - echo " texconfig faq" >&2 - echo " texconfig init [format]" >&2 - echo >&2 - echo "Get help with:" >&2 - echo " texconfig help" >&2 - echo " texconfig hyphen" >&2 - echo " texconfig mode" >&2 - echo " texconfig xdvi" >&2 - echo " texconfig dvips" >&2 - echo " texconfig dvipdfm" >&2 - echo " texconfig pdftex" >&2 - echo " texconfig font" >&2 - exit_return 1;; - esac - exit_return 0 -} - cmd_mode_dvips() { printer= @@ -1693,7 +1644,7 @@ /*) ;; *) helpindex=$doc/$helpindex;; esac - \mv -f $helpindex $helpindex.BAK + mv -f $helpindex $helpindex.BAK # Warn the user it's going to take a while run_dialog --infobox \ "This could take some time, please wait." \ @@ -1727,6 +1678,55 @@ $DO_TEXLINKS && { texlinks --multiplatform 2>&1 | tee -a "$log"; } } +cmd_mode() +{ + case "$1" in + faq) cls; test -f $FAQ && <$FAQ eval $PAGER; fix_pager_more;; + conf) do_print_setup;; + formats) config_formats;; + hyphen) shift; do_edit_hyphen ${1+"$@"} ;; + mode) shift; cmd_mode_set_default_mode ${1+"$@"} ;; + xdvi) shift; cmd_mode_xdvi ${1+"$@"};; + dvips) shift; cmd_mode_dvips ${1+"$@"};; + dvipdfm) shift; cmd_mode_dvipdfm ${1+"$@"};; + pdftex) shift; cmd_mode_pdftex ${1+"$@"};; + font) shift; cmd_mode_maketex ${1+"$@"};; + confall) do_print_all_setup;; + init) if test -z "$2"; then + init_all; + else + fmtutil --byfmt "$2"; + $DO_TEXLINKS && texlinks --multiplatform + fi;; + *) echo "Usage: texconfig conf" >&2 + echo " texconfig confall" >&2 + echo " texconfig rehash" >&2 + echo " texconfig formats" >&2 + echo " texconfig localsetup" >&2 + echo " texconfig hyphen FORMAT" >&2 + echo " texconfig mode [options]" >&2 + echo " texconfig xdvi [options] ..." >&2 + echo " texconfig dvips [options] ..." >&2 + echo " texconfig dvipdfm [options] ..." >&2 + echo " texconfig pdftex [options] ..." >&2 + echo " texconfig font [options] ..." >&2 + echo " texconfig faq" >&2 + echo " texconfig init [format]" >&2 + echo >&2 + echo "Get help with:" >&2 + echo " texconfig help" >&2 + echo " texconfig hyphen" >&2 + echo " texconfig mode" >&2 + echo " texconfig xdvi" >&2 + echo " texconfig dvips" >&2 + echo " texconfig dvipdfm" >&2 + echo " texconfig pdftex" >&2 + echo " texconfig font" >&2 + exit_return 1;; + esac + exit_return 0 +} + #------------------ begin: initialisation ----------------------------------- needsCleanup=false find_echo