From ac06cb4a387aeacbf1596238bd69a3bb6852afe9 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 22 Nov 2017 01:53:20 +0000 Subject: make texconfig a bit more usable git-svn-id: svn://tug.org/texlive/trunk@45882 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/texlive/texconfig.sh | 90 +++++++++++++++++--------- 1 file changed, 58 insertions(+), 32 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/scripts/texlive/texconfig.sh b/Master/texmf-dist/scripts/texlive/texconfig.sh index 6abf91a1cd0..7b67e83eb4d 100755 --- a/Master/texmf-dist/scripts/texlive/texconfig.sh +++ b/Master/texmf-dist/scripts/texlive/texconfig.sh @@ -187,6 +187,18 @@ setupTmpDir() || abort "could not create directory \`$tmpdir'" } +############################################################################### +# setupTexmfroot() - get value for MT_TEXMFROOT (with caching) +# +setupTexmfroot() +{ + case $MT_TEXMFROOT in + "") MT_TEXMFROOT=`kpsewhich -var-value=TEXMFROOT`;; + *) return;; + esac +} + + ############################################################################### # setupTexmfmain() - get value for MT_TEXMFMAIN (with caching) # @@ -537,8 +549,9 @@ checkElemInList() showDistVersionInfo() { # TeX Live file. - test -f $MT_TEXMFMAIN/../release-texlive.txt \ - && sed 1q $MT_TEXMFMAIN/../release-texlive.txt + setupTexmfroot + test -f $MT_TEXMFROOT/release-texlive.txt \ + && sed 1q $MT_TEXMFROOT/release-texlive.txt # no harm in continuing to look for the teTeX files. test -f $MT_TEXMFMAIN/release-tetex-src.txt \ @@ -560,7 +573,7 @@ the TeX installation. Usage: $progname conf (show configuration information) $progname dvipdfmx paper PAPER (dvipdfmx paper size) $progname dvips [OPTION...] (dvips options) - $progname faq (show teTeX faq) + $progname faq (show pointer to TeX Live docs) $progname findprog PROG... (show locations of PROGs, a la which) $progname font vardir DIR $progname font ro @@ -633,7 +646,9 @@ Valid PAPER settings: paper) case $3 in letter|legal|ledger|tabloid|a4|a3) - fmgrConfigReplace dvipdfmx.cfg '^p' "p $3";; + tlmgr dvipdfmx paper $3 + ;; + # fmgrConfigReplace dvipdfmx.cfg '^p' "p $3";; "") echo "$help" >&2; rc=1;; *) echo "$progname: unknown PAPER \`$3' given as argument for \`$progname dvipdfmx paper'" >&2 @@ -781,7 +796,8 @@ Valid PAPER settings: ;; *) if grep "@ $tcBatchDvipsPaper " $configPsFile >/dev/null 2>&1; then - setupDvipsPaper "$tcBatchDvipsPaper" + tlmgr dvips paper $tcBatchDvipsPaper + # setupDvipsPaper "$tcBatchDvipsPaper" else echo "$progname: paper \`$tcBatchDvipsPaper' not found in file \`$configPsFile'" >&2; rc=1 fi @@ -857,14 +873,17 @@ Valid MODE settings:" ;; faq) - setupTexmfmain - if test -f $MT_TEXMFMAIN/doc/tetex/teTeX-FAQ; then - <$MT_TEXMFMAIN/doc/tetex/teTeX-FAQ eval ${PAGER-more} - else - echo "$progname: faq not found (usually in \$TEXMFMAIN/doc/tetex/teTeX-FAQ)" >&2 - rc=1 - fi + echo "Please see https://tug.org/texlive/doc/ for the documentation" + echo "available in TeX Live." ;; + # setupTexmfmain + # if test -f $MT_TEXMFMAIN/doc/tetex/teTeX-FAQ; then + # <$MT_TEXMFMAIN/doc/tetex/teTeX-FAQ eval ${PAGER-more} + # else + # echo "$progname: faq not found (usually in \$TEXMFMAIN/doc/tetex/teTeX-FAQ)" >&2 + # rc=1 + # fi + # ;; findprog) shift @@ -873,6 +892,7 @@ Valid MODE settings:" # handle "texconfig font" font) + setupTexmfroot help="Usage: $progname font vardir DIR $progname font ro $progname font rw @@ -899,7 +919,9 @@ For more information about these \`features', consult the teTeX manual ;; *) tcBatchFontVardir=$3 - tfc=`kpsewhich texmf.cnf` + # tfc=`kpsewhich texmf.cnf` + tfc="$MT_TEXMFROOT/texmf.cnf" + touch "$tfc" if test -n "$tfc"; then if test -w "$tfc"; then configReplace "$tfc" '^VARTEXFONTS' "VARTEXFONTS = $tcBatchFontVardir" @@ -1240,25 +1262,28 @@ Valid PAPER settings: paper) case $3 in - letter) - w="8.5 true in"; h="11 true in" - setupTmpDir - fmgrConfigReplace pdftexconfig.tex pdfpagewidth '\pdfpagewidth='"$w" - wChanged=$fmgrConfigReplaceChanged - fmgrConfigReplace pdftexconfig.tex pdfpageheight '\pdfpageheight='"$h" - if $wChanged || $fmgrConfigReplaceChanged; then - fmtutil --refresh - fi - ;; - a4) - w="210 true mm"; h="297 true mm" - fmgrConfigReplace pdftexconfig.tex pdfpagewidth '\pdfpagewidth='"$w" - wChanged=$fmgrConfigReplaceChanged - fmgrConfigReplace pdftexconfig.tex pdfpageheight '\pdfpageheight='"$h" - if $wChanged || $fmgrConfigReplaceChanged; then - fmtutil --refresh - fi + letter|a4) + tlmgr pdftex paper $3 ;; + #letter) + # w="8.5 true in"; h="11 true in" + # setupTmpDir + # fmgrConfigReplace pdftexconfig.tex pdfpagewidth '\pdfpagewidth='"$w" + # wChanged=$fmgrConfigReplaceChanged + # fmgrConfigReplace pdftexconfig.tex pdfpageheight '\pdfpageheight='"$h" + # if $wChanged || $fmgrConfigReplaceChanged; then + # fmtutil --refresh + # fi + # ;; + #a4) + # w="210 true mm"; h="297 true mm" + # fmgrConfigReplace pdftexconfig.tex pdfpagewidth '\pdfpagewidth='"$w" + # wChanged=$fmgrConfigReplaceChanged + # fmgrConfigReplace pdftexconfig.tex pdfpageheight '\pdfpageheight='"$h" + # if $wChanged || $fmgrConfigReplaceChanged; then + # fmtutil --refresh + # fi + # ;; "") echo "$help" >&2; rc=1;; *) echo "$progname: unknown PAPER \`$3' given as argument for \`$progname pdftex paper'" >&2 @@ -1378,7 +1403,8 @@ Valid PAPER settings: paper) case $3 in [abc][0-9]|[abc]10|[abc][0-9]r|[abc]10r|us|letter|ledger|tabloid|usr|legal|legalr|foolscap|foolscapr) - fmgrConfigReplace XDvi paper: "*paper: $3" + tlmgr xdvi paper $3 + # fmgrConfigReplace XDvi paper: "*paper: $3" ;; "") echo "$help" >&2; rc=1;; *) -- cgit v1.2.3