From 790238df08a6f34033d7a95cf20a0f39e5a58d3b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 24 Jan 2013 01:12:02 +0000 Subject: first attempt at separating scripts (originally in tetex) now maintained in TL from the linked_scripts mechanism git-svn-id: svn://tug.org/texlive/trunk@28922 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/ChangeLog | 5 + Build/source/texk/am/script_links.am | 14 +- Build/source/texk/texlive/ChangeLog | 8 +- Build/source/texk/texlive/Makefile.am | 6 +- Build/source/texk/texlive/Makefile.in | 2 +- Build/source/texk/texlive/configure | 17 +- Build/source/texk/texlive/configure.ac | 7 +- Build/source/texk/texlive/tl_scripts/ChangeLog | 748 +++++++ Build/source/texk/texlive/tl_scripts/Makefile.am | 114 + Build/source/texk/texlive/tl_scripts/README | 8 + Build/source/texk/texlive/tl_scripts/allcm.1 | 28 + Build/source/texk/texlive/tl_scripts/allcm.sh | 118 + Build/source/texk/texlive/tl_scripts/allec.1 | 28 + Build/source/texk/texlive/tl_scripts/allneeded.1 | 30 + Build/source/texk/texlive/tl_scripts/allneeded.sh | 46 + Build/source/texk/texlive/tl_scripts/dvi2fax.1 | 22 + Build/source/texk/texlive/tl_scripts/dvi2fax.sh | 41 + Build/source/texk/texlive/tl_scripts/dvired.1 | 63 + Build/source/texk/texlive/tl_scripts/dvired.sh | 98 + Build/source/texk/texlive/tl_scripts/e2pall.1 | 55 + Build/source/texk/texlive/tl_scripts/e2pall.pl | 89 + .../source/texk/texlive/tl_scripts/fmtutil-sys.sh | 29 + Build/source/texk/texlive/tl_scripts/fmtutil.1 | 113 + Build/source/texk/texlive/tl_scripts/fmtutil.cnf | 126 ++ Build/source/texk/texlive/tl_scripts/fmtutil.cnf.5 | 77 + Build/source/texk/texlive/tl_scripts/fmtutil.sh | 1017 +++++++++ Build/source/texk/texlive/tl_scripts/fontinst.1 | 45 + Build/source/texk/texlive/tl_scripts/fontinst.sh | 16 + Build/source/texk/texlive/tl_scripts/kpsetool.1 | 106 + Build/source/texk/texlive/tl_scripts/kpsetool.sh | 118 + Build/source/texk/texlive/tl_scripts/kpsewhere.1 | 50 + Build/source/texk/texlive/tl_scripts/kpsewhere.sh | 63 + Build/source/texk/texlive/tl_scripts/ps2frag.1 | 41 + Build/source/texk/texlive/tl_scripts/ps2frag.sh | 11 + Build/source/texk/texlive/tl_scripts/pslatex.1 | 44 + Build/source/texk/texlive/tl_scripts/pslatex.sh | 46 + Build/source/texk/texlive/tl_scripts/rubibtex.1 | 63 + Build/source/texk/texlive/tl_scripts/rubibtex.sh | 110 + Build/source/texk/texlive/tl_scripts/rumakeindex.1 | 63 + .../source/texk/texlive/tl_scripts/rumakeindex.sh | 77 + Build/source/texk/texlive/tl_scripts/tcfmgr | 386 ++++ Build/source/texk/texlive/tl_scripts/tcfmgr.map | 10 + .../texk/texlive/tl_scripts/texconfig-dialog.sh | 486 +++++ .../texk/texlive/tl_scripts/texconfig-sys.sh | 31 + Build/source/texk/texlive/tl_scripts/texconfig.1 | 215 ++ Build/source/texk/texlive/tl_scripts/texconfig.sh | 1432 ++++++++++++ Build/source/texk/texlive/tl_scripts/texlinks.1 | 66 + Build/source/texk/texlive/tl_scripts/texlinks.sh | 335 +++ Build/source/texk/texlive/tl_scripts/updmap-sys.sh | 30 + Build/source/texk/texlive/tl_scripts/updmap.1 | 360 +++ Build/source/texk/texlive/tl_scripts/updmap.cfg.5 | 155 ++ .../source/texk/texlive/tl_scripts/updmap.help2man | 100 + Build/source/texk/texlive/tl_scripts/updmap.pl | 2306 ++++++++++++++++++++ 53 files changed, 9664 insertions(+), 10 deletions(-) create mode 100644 Build/source/texk/texlive/tl_scripts/ChangeLog create mode 100644 Build/source/texk/texlive/tl_scripts/Makefile.am create mode 100644 Build/source/texk/texlive/tl_scripts/README create mode 100644 Build/source/texk/texlive/tl_scripts/allcm.1 create mode 100755 Build/source/texk/texlive/tl_scripts/allcm.sh create mode 100644 Build/source/texk/texlive/tl_scripts/allec.1 create mode 100644 Build/source/texk/texlive/tl_scripts/allneeded.1 create mode 100755 Build/source/texk/texlive/tl_scripts/allneeded.sh create mode 100644 Build/source/texk/texlive/tl_scripts/dvi2fax.1 create mode 100755 Build/source/texk/texlive/tl_scripts/dvi2fax.sh create mode 100644 Build/source/texk/texlive/tl_scripts/dvired.1 create mode 100755 Build/source/texk/texlive/tl_scripts/dvired.sh create mode 100644 Build/source/texk/texlive/tl_scripts/e2pall.1 create mode 100755 Build/source/texk/texlive/tl_scripts/e2pall.pl create mode 100755 Build/source/texk/texlive/tl_scripts/fmtutil-sys.sh create mode 100644 Build/source/texk/texlive/tl_scripts/fmtutil.1 create mode 100644 Build/source/texk/texlive/tl_scripts/fmtutil.cnf create mode 100644 Build/source/texk/texlive/tl_scripts/fmtutil.cnf.5 create mode 100755 Build/source/texk/texlive/tl_scripts/fmtutil.sh create mode 100644 Build/source/texk/texlive/tl_scripts/fontinst.1 create mode 100755 Build/source/texk/texlive/tl_scripts/fontinst.sh create mode 100644 Build/source/texk/texlive/tl_scripts/kpsetool.1 create mode 100755 Build/source/texk/texlive/tl_scripts/kpsetool.sh create mode 100644 Build/source/texk/texlive/tl_scripts/kpsewhere.1 create mode 100755 Build/source/texk/texlive/tl_scripts/kpsewhere.sh create mode 100644 Build/source/texk/texlive/tl_scripts/ps2frag.1 create mode 100755 Build/source/texk/texlive/tl_scripts/ps2frag.sh create mode 100644 Build/source/texk/texlive/tl_scripts/pslatex.1 create mode 100755 Build/source/texk/texlive/tl_scripts/pslatex.sh create mode 100644 Build/source/texk/texlive/tl_scripts/rubibtex.1 create mode 100755 Build/source/texk/texlive/tl_scripts/rubibtex.sh create mode 100644 Build/source/texk/texlive/tl_scripts/rumakeindex.1 create mode 100755 Build/source/texk/texlive/tl_scripts/rumakeindex.sh create mode 100755 Build/source/texk/texlive/tl_scripts/tcfmgr create mode 100644 Build/source/texk/texlive/tl_scripts/tcfmgr.map create mode 100755 Build/source/texk/texlive/tl_scripts/texconfig-dialog.sh create mode 100755 Build/source/texk/texlive/tl_scripts/texconfig-sys.sh create mode 100644 Build/source/texk/texlive/tl_scripts/texconfig.1 create mode 100755 Build/source/texk/texlive/tl_scripts/texconfig.sh create mode 100644 Build/source/texk/texlive/tl_scripts/texlinks.1 create mode 100755 Build/source/texk/texlive/tl_scripts/texlinks.sh create mode 100755 Build/source/texk/texlive/tl_scripts/updmap-sys.sh create mode 100644 Build/source/texk/texlive/tl_scripts/updmap.1 create mode 100644 Build/source/texk/texlive/tl_scripts/updmap.cfg.5 create mode 100644 Build/source/texk/texlive/tl_scripts/updmap.help2man create mode 100755 Build/source/texk/texlive/tl_scripts/updmap.pl (limited to 'Build') diff --git a/Build/source/texk/ChangeLog b/Build/source/texk/ChangeLog index 8e7decaa405..1f76bbce9ce 100644 --- a/Build/source/texk/ChangeLog +++ b/Build/source/texk/ChangeLog @@ -1,3 +1,8 @@ +2013-01-24 Karl Berry + + * am/script_links.am (install-links): look for relpath one more + level up too. (For the new texlive/tl_scripts.) + 2012-12-17 Peter Breitenlohner * configure.ac: Use KPSE_BASIC to enable silent rules. diff --git a/Build/source/texk/am/script_links.am b/Build/source/texk/am/script_links.am index b7228de97ad..a0378fb4b64 100644 --- a/Build/source/texk/am/script_links.am +++ b/Build/source/texk/am/script_links.am @@ -1,6 +1,6 @@ ## texk/am/script_links.am: Makefile fragment for lua/perl/shell script links. ## -## Copyright (C) 2011, 2012 Peter Breitenlohner +## Copyright (C) 2011-2013 Peter Breitenlohner ## You may freely use, modify and/or distribute this file. ## ## Install/uninstall 'linked scripts' or win32 wrappers: @@ -59,9 +59,17 @@ EXTRA_DIST += ../../build-aux/relpath # We support native builds, multiplatform or not, as well as distro builds. install-links: - @REL=`$(SHELL) $(srcdir)/../../build-aux/relpath '$(DESTDIR)' '$(bindir)' '$(datarootdir)'`; \ + @if test -r "$(srcdir)/../../build-aux/relpath"; then \ + relpath="$(srcdir)/../../build-aux/relpath"; \ + elif test -r "$(srcdir)/../../../build-aux/relpath"; then \ + relpath="$(srcdir)/../../../build-aux/relpath"; \ + else \ + echo 'script_links.am:install-links: could not find relpath script';\ + exit 1; \ + fi; \ + REL=`$(SHELL) $$relpath '$(DESTDIR)' '$(bindir)' '$(datarootdir)'`; \ if test -z "$$REL"; then \ - echo 'unable to compute relative path for linked $(TYPE) scripts' >&2; \ + echo 'script_links.am:install_links: unable to compute relative path for linked $(TYPE) scripts' >&2; \ exit 1; \ fi; \ cd $(DESTDIR)$(bindir) && \ diff --git a/Build/source/texk/texlive/ChangeLog b/Build/source/texk/texlive/ChangeLog index e5108a38e0e..819aaba812e 100644 --- a/Build/source/texk/texlive/ChangeLog +++ b/Build/source/texk/texlive/ChangeLog @@ -1,3 +1,10 @@ +2013-01-24 Karl Berry + + * tl_scripts: new subdir. + * Makefile.am (SUBDIRS): add it. + * configure.ac (AC_CONFIG_FILES): output its Makefile. + (WIN32_WRAP): new conditional. + 2012-08-13 Peter Breitenlohner * w32_wrapper/runscript.dll (new): DLL for runscript.exe. @@ -189,4 +196,3 @@ * Makefile.in: Add @configure_input@ line. * aclocal.m4 (new): Generated (aclocal -I ../m4). * configure: Regenerated (autoconf). - diff --git a/Build/source/texk/texlive/Makefile.am b/Build/source/texk/texlive/Makefile.am index a65919fa447..4f6eff165c5 100644 --- a/Build/source/texk/texlive/Makefile.am +++ b/Build/source/texk/texlive/Makefile.am @@ -1,13 +1,13 @@ ## Makefile.am for the TeX Live subdirectory texk/texlive/ ## -## Copyright (C) 2009-2012 Peter Breitenlohner +## Copyright (C) 2009-2013 Peter Breitenlohner ## You may freely use, modify and/or distribute this file. ## ACLOCAL_AMFLAGS = -I ../../m4 -SUBDIRS = context linked_scripts +SUBDIRS = tl_scripts context linked_scripts -## Windows wrapper +## Windows wrapper sources. ## EXTRA_DIST = w32_wrapper diff --git a/Build/source/texk/texlive/Makefile.in b/Build/source/texk/texlive/Makefile.in index 87be13ac7da..d926795c222 100644 --- a/Build/source/texk/texlive/Makefile.in +++ b/Build/source/texk/texlive/Makefile.in @@ -455,7 +455,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I ../../m4 -SUBDIRS = context linked_scripts +SUBDIRS = tl_scripts context linked_scripts EXTRA_DIST = w32_wrapper $(TESTS) TESTS = tests/updmap-cmdline-test.pl all: all-recursive diff --git a/Build/source/texk/texlive/configure b/Build/source/texk/texlive/configure index 34aa5cf4272..3ff62661040 100755 --- a/Build/source/texk/texlive/configure +++ b/Build/source/texk/texlive/configure @@ -589,6 +589,8 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +WIN32_WRAP_FALSE +WIN32_WRAP_TRUE WIN32_FALSE WIN32_TRUE LN_S @@ -3463,8 +3465,16 @@ else WIN32_FALSE= fi + if test -r $srcdir/../../texk/texlive/w32_wrapper/runscript.exe; then + WIN32_WRAP_TRUE= + WIN32_WRAP_FALSE='#' +else + WIN32_WRAP_TRUE='#' + WIN32_WRAP_FALSE= +fi + -ac_config_files="$ac_config_files Makefile context/Makefile linked_scripts/Makefile" +ac_config_files="$ac_config_files Makefile context/Makefile linked_scripts/Makefile tl_scripts/Makefile" cat >confcache <<\_ACEOF @@ -3644,6 +3654,10 @@ if test -z "${WIN32_TRUE}" && test -z "${WIN32_FALSE}"; then as_fn_error $? "conditional \"WIN32\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${WIN32_WRAP_TRUE}" && test -z "${WIN32_WRAP_FALSE}"; then + as_fn_error $? "conditional \"WIN32_WRAP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 @@ -4220,6 +4234,7 @@ do "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "context/Makefile") CONFIG_FILES="$CONFIG_FILES context/Makefile" ;; "linked_scripts/Makefile") CONFIG_FILES="$CONFIG_FILES linked_scripts/Makefile" ;; + "tl_scripts/Makefile") CONFIG_FILES="$CONFIG_FILES tl_scripts/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/Build/source/texk/texlive/configure.ac b/Build/source/texk/texlive/configure.ac index c6d6a5bf93e..2f2954538b2 100644 --- a/Build/source/texk/texlive/configure.ac +++ b/Build/source/texk/texlive/configure.ac @@ -22,7 +22,12 @@ AC_PROG_MAKE_SET KPSE_CHECK_WIN32 AM_CONDITIONAL([WIN32], [test "x$kpse_cv_have_win32" != xno]) +AM_CONDITIONAL([WIN32_WRAP], + [test -r $srcdir/../../texk/texlive/w32_wrapper/runscript.exe]) -AC_CONFIG_FILES([Makefile context/Makefile linked_scripts/Makefile]) +AC_CONFIG_FILES([Makefile + context/Makefile + linked_scripts/Makefile + tl_scripts/Makefile]) AC_OUTPUT diff --git a/Build/source/texk/texlive/tl_scripts/ChangeLog b/Build/source/texk/texlive/tl_scripts/ChangeLog new file mode 100644 index 00000000000..7db3359c839 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/ChangeLog @@ -0,0 +1,748 @@ +2013-01-15 Karl Berry + + * fmtutil.sh (run_initex): save log file first, + even if the .fmt isn't built. Tweak message wordings. + Report from tljack, 12 Jan 2013 14:35:16. + +2012-08-08 Peter Breitenlohner + + * fmtutil*, tcfmgr*, texconfig*, texlinks* (removed): + Moved from here to ../texlive/tetex/. + * Makefile.am: Adapted; run-texlinks rule + +2012-08-07 Peter Breitenlohner + + * tests/, all*, dvi2fax*, dvired*, fontinst*, kpsetool*, + kpsewhere*, ps2frag*, pslatex*, rubibtex*, rumakeindex*, + updmap* (removed): Moved from here to ../texlive/tetex/. + * Makefile.am: Adapted. + +2012-08-06 Peter Breitenlohner + + * e2pall.man, texdoctk.man, texdoctk.man (removed): Moved from + here to ../texlive/tetex/. + * Makefile.am: Adapted. + +2012-08-04 Karl Berry + + * tl-sys-wrapper: not needed. The Windows wrapper, runscript.tlu, + already handles -sys, as does the Windows fmtutil.c. + * Makefile.am (EXTRA_DIST): remove it again. + +2012-08-03 Karl Berry + + * tl-sys-wrapper.pl: initial attempt. + +2012-07-31 Norbert Preining + + * updmap.pl (main): fix quoting and var expansion on Windows. + * updmap.pl (main): and another fix, this time for PATH separator + +2012-07-30 Norbert Preining + + * updmap.pl (main): support for multiple entry TEXMFLOCAL. + Tell the user which config files is used for writing. + +2012-07-23 Karl Berry + + * updmap.pl (help): we have both --showoption and --showoptions. + Ugh. Found by Bruno Voisin, 11 Jun 2012 21:34:44. + +2012-06-10 Norbert Preining + + * updmap.pl: fix ordering of how updmap.cfg files are read + and add documentation. + +2012-06-04 Peter Breitenlohner + + * Makefile.am (EXTRA_DIST): Add the new file updmap.help2man. + +2012-06-01 Karl Berry + + * Makefile.am (xupdmap.man): new (phony) target to run help2man. + * updmap.help2man: new file. + + * updmap.pl: consistently use $prg, and remove .pl suffix. + +2012-05-31 Karl Berry + + * updmap.pl (reset_root_home): accept /var/root. + +2012-05-31 Norbert Preining + + * updmap.pl: reset root $HOME if it is not the real one, since + sudo does not reset it + +2012-05-21 Norbert Preining + + * updmap.pl + . on win32, ensure file names are in lower case + . add --dvipdfmxoutputdir, make --dvipdfmoutputdir synonym + (more or less) + . make sure that the file name database is properly updated + when creating a new config file + . remove --old-mode cmd line option + +2012-05-15 Peter Breitenlohner + + * updmap.pl: Moved from ../texlive/linked_scripts/texlive/ + back to here. + * tests/ (new): Moved from ../texlive/ to here and adapted. + * Makefile.am: Adapted. + +2012-05-14 Peter Breitenlohner + + * tests/ (removed): Moved from here to ../texlive/. + * Makefile.am: Adapted. + + * fmtutil.cnf: Updated from Master. + +2012-05-14 Norbert Preining + + * updmap.pl: rename to updmap-single.pl, we ship updmap.pl now + via ../texlive/linked_scripts/texlive/updmap.pl + +2012-04-10 Karl Berry + + * fmtutil (main): eradicate double slashes in tmpdir. + tex-k mail from Alexey Vikhlinin, 8 Apr 2012 17:32:02. + +2012-03-12 Karl Berry + + * updmap.cfg.5: avoid ... at beginning of line. + Replace Debian-specific text. + +2012-02-21 Karl Berry + + * updmap.pl (help): updates for kanji. + +2012-02-10 Norbert Preining + + * updmap.pl: fix breakage of updmap if a generated file does + not exist (wrong double substitution of @kanji*@ strings) + +2012-02-01 Norbert Preining + + * updmap.pl: + . support -showoption key that shows the current setting + . fix not-acceptance of empty values in key/val -setoption + +2012-01-19 Norbert Preining + + * updmap.pl: + . allow --enable Map foo.map again + . support kanjiVariant options and replacement + +2011-12-12 Karl Berry + + * updmap.pl: untabify, formatting. + +2011-12-06 Peter Breitenlohner + + * Makefile.am: Replace ${prefix}/texmf => $(datarootdir)/texmf. + +2011-11-16 Norbert Preining + + * updmap.pl: make sure that kanjiEmbed is set to a default value + if not found in the config file. + +2011-11-09 Norbert Preining + + * updmap.pl: add support for pxdviUse config option in updmap, + and generate xdvi-ptex.map if it is set in a similar way as kanjix.map, + patch based on work of Hironori Kitagawa + +2011-11-04 Norbert Preining + + * updmap.pl: small fixes to documentation of updmap.pl, and fixes + to --syncwithtrees and --listavail, patch from Hironori Kitagawa + +2011-11-02 Norbert Preining + + * updmap.pl: apply patch from Hironori Kitagawa that fixes + a --syncwithtrees problem in searching for map names. + +2011-10-26 Norbert Preining + + * updmap.pl: apply patch from ptexlive Tsuchimura to support + kanjiEmbed setting, and generate kanjix.map. + +2011-09-09 Peter Breitenlohner + + * Makefile.am: Adapt to script_links.am using relpath. + (run-texlinks): Declare as .PHONY; skip texlinks for WIN32. + +2011-09-09 Karl Berry + + * tests: new subdir, with first updmap test, that doesn't really + work yet but passes anyway. + * Makefile.am (TESTS): add tests/updmap-cmdline-test.pl. + * updmap.pl (read_option_vals): don't call getopt twice (from Norbert). + Don't complain about non-option args, that is how --enable/--disable + are currently (mis)handled. + (writeLines, copyFile, setupOutputDir, SetupCfgFile): do nothing + if $dry_run. + +2011-09-05 Karl Berry + + * texconfig-dialog (runDialog): only clear screen if we actually + run the dialog program. + (findDialog): do not bother setting DIALOG_TERM and + DIALOG_TERMINFO if we don't find a system dialog program, + since we're just going to abort anyway. + * texmf: remove subdir with terminfo definitions. + * Makefile.am (texconfdir, nobase_dist_texconf_DATA): likewise rm. + +2011-09-04 Norbert Preining + + * updmap.pl (BEGIN): older versions are supported again. + (read_for_set_options): new fn. + (processOptions): call it, so we call getopt twice, + so we can avoid using the =s{1,2} specifier (for --setoption) + which needs perl 5.8.8. + Also, complain about non-option arguments. + http://tug.org/pipermail/tex-live/2011-July/029764.html + http://tug.org/pipermail/tex-k/2011-September/002329.html + +2011-08-26 Karl Berry + + * texconfig-dialog: do not invoke tcdialog as fallback, + give up instead. We don't want to install our own (tc)dialog any + more, induces curses dependencies. More importantly, texconfig, + and especially this interactive configuration, has not been the + way we have been moving (or testing) for years now. If there is + anyone left who wants to do it, they can install their own dialog + (or whiptail) program. + +2011-06-27 Karl Berry + + * fmtutil (version): rename to versionfunc, or Solaris sh dies + with "bad substitution". + Report from Nelson, 23 Jun 2011 09:42:09. + +2011-06-18 Karl Berry + + * updmap.pl (locateMap): allow "Map foo" (without the ".map"), + as the sh updmap map. (The actual file still being foo.map.) + Report from Peter Dyballa, 15 Jun 2011 10:04:36. + +2011-06-16 Karl Berry + + * updmap.pl (help): add more info and modify to work with help2man. + * updmap.man: generate with help2man. + + * updmap.pl (progname): eliminate fn in favor of $0 + or hardwired "updmap" as appropriate. + + * old-updmap: rename from updmap, to make it clearer this + (sh version) is not used any more. + * old-fontinst.bat: rename from fontinst.bat. + + * updmap.pl ($pdftexStripEnc): set to zero. + (to_pdftex): return the input, not empty. + (ProcessOptions): accept and ignore dvipdfmoutputdir. + + * updmap.pl (@psADOBE): use the same list as from sh updmap, + including the spaces, to be sure we are getting the same behavior. + + Related: + * Master/texmf/fonts/map/dvips/tetex/pdftex35.map, + * Master/texmf/fonts/map/dvips/tetex/ps2pk35.map (phvbo8rn,phvbo8yn): + ever since at least TL 7, these have had + spurious "-Narrow-BoldOblique" suffixes on the correct + NimbusSanL-BoldCondItal, left over from the Adobe + Helvetica-Narrow-BoldOblique. + (Yet the fonts could still be used.) + * Master/texmf/fonts/map/{dvips,pdftex}/updmap: regenerate. + + * updmap.pl: support --setoption foo bar as well as foo=bar, + for compatibility. + (setOptions): new fn. + (ProcessOptions): use "setoption=s{1,2}" => \@setoptions + instead of "setoption=s" => \%setOption, since we have to parse + the values manually. + (Getopt::Long::Configure): removing bundling, disallows the + =s{1,2} Getopt directive we specify for parsing. + Original report from Herbert Schulz, + mactex mail 13 Jun 2011 07:56:50. + + Unrelated, sorry: + Add $0 to die commands. + (setOption): silently accept dvipdfmDownloadBase14. + ($verbose): remove unused variable. + +2011-06-15 Karl Berry + + * updmap.pl: reformat long lists, reduce ####, other formatting. + (processOptions): do not mkdirhier the output directories + if it is a dry run. + + * updmap.pl (@psADOBE): do BoldItalic (etc.) before Bold (etc.), + other generated pdftex.map has bogus names with spaces. + Original report from Herbert Schulz, + mactex mail 13 Jun 2011 08:27:46. + + Unrelated, sorry: + (Getopt::Long::Configure): set ignore_case_always. + (Case-insensitive option matching is the default?!) + (--force, $opt_force): new option. + (processOptions): sort and indent option list consistently. + +2011-05-31 Peter Breitenlohner + + * Makefile.am: Use ../am/bin_links.am for $(bindir) links. + +2011-05-12 Karl Berry + + * updmap.pl (pdftexNoEnc): rename to pdftexStripEnc. + (to_pdftex): change uses. + (Reinhard K made an equivalent change.) + +2011-04-04 Peter Breitenlohner + + Rename updmap-sys => updmap-sys.sh. + * Makefile.am: Install updmap and updmap-sys as linked scripts + and use the ../am/script_links.am fragment. + +2011-02-08 Peter Breitenlohner + + * Makefile.am: Use ../am/man1_links.am for manpage links. + +2011-01-07 Peter Breitenlohner + + * Makefile.am, configure.ac [WIN32]: Install wrapper binary for + fontinst (handled as alias by runscript.tlu). + + * texconfig, texconfig-sys: Drop texconfig_sys shell variable; + now done via TEXMFVAR and TEXMFCONFIG in the environment. + +2011-01-04 Karl Berry + + * updmap: add many more verbose messages, to help understand what + files are being created from what sources. + +2010-12-27 Peter Breitenlohner + + * Makefile.am (install-exec-hook, install-data-hook): Check + symlink creation. + +2010-12-25 Karl Berry + + * doc, + * pdfetex-pl.pool, + * README.a2ping: remove these seemingly not useful files. + * Makefile.am: update accordingly. + +2010-12-22 Peter Breitenlohner + + * configure.ac: Added KPSE_CHECK_WIN32. + * context/ (removed): Files moved to ../texlive/context/. + * Makefile.am: Adapted. + +2010-12-19 Peter Breitenlohner + + * ps4pdf: Removed, replaced by newer version under ../texlive/. + * Makefile.am: Adapted. + +2010-12-18 Peter Breitenlohner + + * context/texmfstart.man: Fix typo. + +2010-07-05 Peter Breitenlohner + + * fmtutil.man: Adapt to fmtutil. + +2010-07-04 Norbert Preining + + * fmtutil: add --no-error-if-no-format, don't abort in some cases of + missing formats + +2010-06-12 Karl Berry + + * fmtutil (--edit): disable. + (help): document this, other tweaks. + +2010-05-31 Manuel Pégourié-Gonnard + + * fmtutil: allow more than one language file per format. + +2010-05-20 Karl Berry + + * doc/TETEXDOC.dvi, + * doc/TETEXDOC.ps: rm files. + * doc/Makefile: do not bother remaking .dvi + .ps. + * Makefile.am (dist_tetexdoc_DATA): rm. + +2010-04-29 Peter Breitenlohner + + * Makefile.am (run_texlinks, run_texlinks): Respect DESTDIR. + +2010-04-28 Manuel Pégourié-Gonnard + + * texlinks: Append exeext to engine names. + * Makefile.am (run_texlinks): Invoke texlinks with explicit dir. + +2010-03-12 Peter Breitenlohner + + * texlinks (version): Add missing quote in svn id. + +2010-03-11 Karl Berry + + * updmap, + * texlinks, + * texconfig (version): use svn id. + (help): regularize info at end of msg. + + * fmtutil (help): describe mktexfmt operation. + (main): give more error message in mktexfmt mode. + Report from Ludovic Courtes, 08 Mar 2010 21:55:53. + +2010-01-17 Karl Berry + + * updmap, + * fmtutil: tweak help messages. + + * tcfmgr (setupMap), + * fmtutil (main), + * updmap (setupCfgFile): maybe ls-R missing when basic config + files not found. + +2009-12-23 Norbert Preining + + * fmtutil: check for infinite loop only in mktexfmt mode so that + multiple defined format/engine combinations are accepted. + +2009-10-24 Peter Breitenlohner + + * Makefile.am (bin_links, man1_links): + New lists of symlinks within bindir and man1dir. + Moved handling of texhash symlinks to ../kpathsea/man/. + Moved handling of lambda, ctangle, cweave, odvicopy, odvitype, + mf-nowin, and pdflatex symlinks to ../web2c/man/. + (install-data-hook, install-exec-hook, uninstall-hook): + Use `bin_links' and `man1_links'. + + * mkocp.man, mkofm.man, otp2ocp.man, outocp.man: Moved from + here to ../web2c/otps/. + * ofm2opl.man, opl2ofm.man, ovf2ovp.man, ovp2ovf.man, + ttf2afm.man: Moved from here to ../web2c/man/. + * Makefile.am (dist_man1_MANS): Adjusted. + +2009-10-09 Karl Berry + + * fmtutil (run_initex): if it doesn't already exist, create + mplib-luatex.mem when we create mpost.mem. + +2009-08-24 Reinhard Kotucha + + * updmap.pl (mkMaps): replace dir/ls shell commands by Perl code. + +2009-08-22 Tomek Trzeciak + + * updmap.pl (mkmaps): remove unneeded COMSPEC from backticks + +2009-08-19 Karl Berry + + * updmap.pl (mkmaps): quote invocation of COMSPEC. + From Dan Luecking, 19 Aug 2009 15:13:31. + +2009-08-15 Karl Berry + + * fmtutil (--byengine): new option, from Norbert. + (help): mention it; other tweaks. + * fmtutil.man: also update. + +2009-07-23 Karl Berry + + * updmap (help): mention tug.org/fonts/fontinstall.html. + +2009-06-23 Karl Berry + + * Makefile.am (run_texlinks): add -e "$(EXEEXT)". + * texlinks: new option -e to specify executable extension (for + cygwin). + +2009-06-11 Norbert Preining + + * fmtutil (log_warning): new fn, related code, so that + LaTeX's five-year-old warning does not trigger failure. + Debian bug #531595. + +2009-05-28 Karl Berry + + * texconfig.man: update from Frank K, 27 May 2009 23:17:49. + +2009-05-07 Peter Breitenlohner + + Adapt to TL2009 build system. + +2009-04-03 Karl Berry + + * Makefile.am (EXTRA_DIST): remove texdoc.man from list. + * texdoc.man: remove file; maintained separately now + (http://tug.org/texdoc) + +2009-03-17 Karl Berry + + * updmap (main, cleanup): cd back to the original pwd instead of /, + to work around + rm: cannot get current directory: Permission denied + error in (at least) coreutils 5.2.1 in some ill-defined circumstance. + Report from Lars Madsen. + +2008-10-27 Karl Berry + + * updmap.pl: also adjust printed output. + From Aaron Chen, 25 Oct 2008 16:40:59. + +2008-10-24 Karl Berry + + * Makefile.in (run-texlinks): quote the PATH + argument in case there are spaces lurking. + Report from Angelo Graziosi, 23 Oct 2008 16:08:59. + +2008-10-22 Karl Berry + + * updmap.pl (cfgval): only consider falsish strings to be 0, else + leave the value as-is, for the sake of LW35, which does not take a + boolean. Report and patch from Aaron Chen, 17 Oct 2008 01:22:24. + +2008-09-22 Karl Berry + + * fmtutil (parse_line): pass --format=mp to kpsewhich when + engine=mpost, instead of --format=mpost. + +2008-07-08 Karl Berry + + * texconfig (hyphen, formats): disable these functions, + fmtutil.cnf and language.dat/def must not be manually edited, + since they are now automatically regenerated, as tlmgr regenerates. + +2008-07-05 Karl Berry + + * Makefile.in (run_texlinks): use -f $(web2cdir)/fmtutil.cnf. + (run_mktexlsr): no longer needed. + From Francois Charette, tldistro 04 Jul 2008 09:22:42. + +2008-06-18 Karl Berry + + * texlinks: metafun is not created specially by ConTeXt, so we'll + create it here. + +2008-06-17 Norbert Preining + + * fmtutil: add the engine setting to the infinite-loop-detection + variable. + +2008-06-15 Karl Berry + + * Makefile.in (run_mktexlsr): no need to set TEXMFDBS, cmdline + dir is respected again. + (CONTEXTSCRIPTS): remove texexec, the version here was old. + +2008-05-28 Karl Berry + + * fmtutil.cnf: new file, a slave of Master/texmf/web2c/fmtutil.cnf, + which we keep in sync via TL infrastructure scripts. + * Makefile.in (install-data): install fmtutil.cnf. + (run-texlinks): new target, invoked by top-level make. + * texlinks: doc fixes. + +2008-05-19 Karl Berry + + * texdoc: remove, master is now the lua version in texmf/scripts. + +2008-05-11 Norbert Preining + + * Makefile.in: do not install texdoc(.man) since we will use the + texlua version from Frank (to be found in ../texlive) + +2008-05-08 Norbert Preining + + * updmap, tcfmgr: quote various calls containing env variables + taken from texmf.cnf which could contain spaces + +2008-05-05 Karl Berry + + * texconfig (generate): remove this, now done in tlmgr. + +2008-05-04 Karl Berry + + * Makefile.in (LINKED_SCRIPTS): add ps4pdf. + +2008-04-25 Karl Berry + + * Makefile.in (LINKED_SCRIPTS): now tlmgr.tlu. + +2008-04-16 Norbert Preining + + * fmtutil: fix creation of dirs with spaces + +2008-04-14 Karl Berry + + * Makefile.in (LINKED_SCRIPTS): no more *xindy, the xindy Makefile + itself takes care of those. + +2008-04-12 Karl Berry + + * Makefile.in (LINKED_SCRIPTS): pdfcrop now in texmf-dist. + Add xindy.pl, texindy.pl. + +2008-03-18 Karl Berry + + * Makefile.in (install-linked-scripts): use $(LINKSUFFIX). + (LINKSUFFIX): new variable, for passing -sys. + (install-linked-sys-scripts): make install-linked-scripts + instead of repeating code. + +2008-03-15 Reinhard Kotucha + + * Makefile.in (LINKEDSCRIPTS): add pdfthumb. + +2008-03-14 Reinhard Kotucha + + * Makefile.in (LINKED_SYS_SCRIPTS): new list for -sys progs. + Add getnonfreefonts.pl. + +2008-03-14 Karl Berry + + * Makefile.in (LINKEDSCRIPTS): add ppower4, no longer in tetex. + + * fmtutil: check for infinite loops. + From Stepan Kasal, http://bugzilla.redhat.com/show_bug.cgi?id=437008. + +2008-03-07 Karl Berry + + * Makefile.in (LINKEDPLSCRIPTS): rename from LINKEDPERLSCRIPTS. + (LINKEDNOEXTSCRIPTS): new variable for makeglossaries. + (install-linkedscripts): install them. + +2008-03-03 Karl Berry + + * latex.info, latex2e.texi: remove; this will become a separate + package. + * Makefile.in: remove info-related stuff. + (LINKEDPERLSCRIPTS): add e2pall, pkfix, ps2eps. + +2008-03-02 Karl Berry + + * Makefile.in: more doc + +2008-02-16 Karl Berry + + * texconfig (doGenerate): new fn to call generate-* scripts. + (help): document it. + +2008-01-30 Peter Breitenlohner + + Convert from autoconf-2.13 to autoconf-2.59+: + * Makefile.in: Add @configure_input@ line. + * aclocal.m4 (new): Generated (aclocal -I ../m4). + * configure: Regenerated (autoconf). + +2008-01-14 Karl Berry + + * pdfcrop: update to 1.8 from CTAN. + +2007-11-03 Karl Berry + + * texlinks.man: --unlink, sort. From Edd. + +2007-10-25 Karl Berry + + * updmap: make last bit of log nicer, since we may have copies + instead of symlinks now. + +2007-10-24 Karl Berry + + * texconfig: update and augment help message; + accept version and --version; + show TeX Live version info from release-texlive.txt. + +2007-10-19 Karl Berry + + * updmap (processOptions): add --copy and -n options. + (setupSymlinks): with --copy, cp instead of ln -s. + We want this for TL. + (mkMaps): with -n, exit before actually doing anything. + (setupLog): with -n, do not log. + (help): update and augment. + +2007-10-12 Karl Berry + + * texlinks: new option -u[nlink] for uninstall. + From Edd Barrett, 10 Oct 2007 11:05:55. + +2007-09-30 Karl Berry + + * texconfig-sys: export texconfig_sys. + * texconfig : use it to figure out which fmtutil/updmap. + Report from Frank K, 11 Jun 2007 17:05:43. + +2007-09-10 Karl Berry + + * updmap.pl: TEXMFVAR rather than VARTEXMF. + +2007-09-04 Karl Berry + + * updmap.pl: ! to clearly check against both empty string and + undef, rather than eq undef (Jjgod 3 Sep 2007 16:16:50). + +2007-07-16 Karl Berry + + * texconfig (findDialogProg, runDialog): these fns not used here, + remove. + (findprog): new mode of operation, like which(1). + * texconfig-dialog (findDialog): check for whiptail/dialog on any + system, not just FreeBSD, Linux, cygwin. + +2007-05-31 Karl Berry + + * fmtutil (run_initex): do not remove the log file. + +2007-01-16 Karl Berry + + * texconfig (init): only run texlinks and updmap if fmtutil succeeds. + +2007-01-14 Karl Berry + + * texconfig: check for pdftex rather than pdfetex. + Reported by Artemio, 13 Jan 2007 14:54:40. + +2006-12-29 Karl Berry + + * texconfig: replace sort +1 with sort -k 2. I hate POSIX. + Reported by gnwiii, 28 Dec 2006 14:53:54. + +2006-12-27 Karl Berry + + * Makefile.in (install-exec): now the binary is named pdftex again. + +2006-12-25 Karl Berry + + * updmap: update version. + +2006-12-13 Karl Berry + + * latex2e.texi: FSF never held copyright (checked with authors). + Starting latexrefman project at gna.org, with hopes. + +2006-11-20 Karl Berry + + * Makefile.in (CONTEXTSCRIPTS): new variable. + (context): new subdir of stubs, updated from Hans' releases. + +2006-11-14 Karl Berry + + * updmap (normalizeLines): remove CR characters (for skaknew), so + that the generted map files have consistent line endings for svn. + +2006-07-13 Karl Berry + + * ps4pdf (tmpdir): don't lose check for TMPDIR and TEMP which te + had. + +Sat Dec 18 14:19:43 CET 1999 te + + * added manpages for epstopdf and dvi2fax (contributed by "James + R. Van Zandt" ) diff --git a/Build/source/texk/texlive/tl_scripts/Makefile.am b/Build/source/texk/texlive/tl_scripts/Makefile.am new file mode 100644 index 00000000000..8188cef99a9 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/Makefile.am @@ -0,0 +1,114 @@ +## Makefile.am for the TeX Live subdirectory texk/texlive/tl_scripts/ +## +## Copyright (C) 2013 Karl Berry +## You may freely use, modify and/or distribute this file. + +EXTRA_DIST = README +EXTRA_DIST += ../../../build-aux/relpath + +# These first variable definitions are what scripts_links.am requires. +sh_scripts = \ + allcm \ + allneeded \ + dvi2fax \ + dvired \ + fmtutil-sys \ + fmtutil \ + fontinst \ + kpsetool \ + kpsewhere \ + ps2frag \ + pslatex \ + rubibtex \ + rumakeindex \ + texconfig-dialog \ + texconfig-sys \ + texconfig \ + texlinks \ + updmap-sys +perl_scripts = updmap e2pall +nodist_bin_SCRIPTS = +scriptsdir = texmf-dist/scripts/texlive +# +include $(srcdir)/../../../texk/am/script_links.am +# +texmfdir = $(datarootdir)/$(scriptsdir) +dist_texmf_SCRIPTS = $(perl_scripts:=.pl) $(shell_scripts:=.sh) + +install-data-hook: install-perl-links install-sh-links +uninstall-hook: uninstall-links + +dist_man_MANS = \ + allcm.1 \ + allec.1 \ + allneeded.1 \ + dvi2fax.1 \ + dvired.1 \ + e2pall.1 \ + fmtutil.1 \ + fmtutil.cnf.5 \ + fontinst.1 \ + kpsetool.1 \ + kpsewhere.1 \ + ps2frag.1 \ + pslatex.1 \ + rubibtex.1 \ + rumakeindex.1 \ + texconfig.1 \ + texlinks.1 \ + updmap.1 \ + updmap.cfg.5 + +#if !WIN32 +#bin_links += \ +# allcm:allec \ +# fmtutil:mktexfmt \ +# kpsetool:kpsexpand \ +# kpsetool:kpsepath \ +#endif !WIN32 + +man1_links = \ + fmtutil:fmtutil-sys \ + kpsetool:kpsexpand \ + kpsetool:kpsepath \ + fmtutil:mktexfmt \ + texconfig:texconfig-sys \ + updmap:updmap-sys + +include $(top_srcdir)/../am/man1_links.am + +## Support files +texconfigdir = $(datarootdir)/texmf/texconfig +dist_texconfig_SCRIPTS = tcfmgr +dist_texconfig_DATA = tcfmgr.map + +web2cdir = $(datarootdir)/texmf/web2c +dist_web2c_DATA = fmtutil.cnf + +## Generate the updmap man page using help2man plus a bit of +## handwritten material. But don't actually update updmap.1, +## we don't want to require help2man for an install. Leave that to be +## done by hand. +.PHONY: xupdmap.1 +xupdmap.1: updmap.help2man updmap.pl + help2man --include=$< --source="TeX Live" --no-info \ + $(srcdir)/updmap.pl >/tmp/$@ +EXTRA_DIST += updmap.help2man + + +## +## This target is invoked by the top-level make, +.PHONY: run-texlinks +## to create the per-format engine symlinks in $(bindir), +## after everything else is installed. We explicitly specify the +## fmtutil.cnf file to use for the sake of distro builds. +## We pass along the executable extension for the sake of cygwin, so we +## don't create dangling symlinks there (even though they work). +run_texlinks = $(DESTDIR)$(bindir)/texlinks -v \ + -f $(DESTDIR)$(web2cdir)/fmtutil.cnf \ + -e "$(EXEEXT)" $(DESTDIR)$(bindir) +run-texlinks: +if !WIN32 + PATH="$(DESTDIR)$(bindir):$(PATH)"; export PATH; $(run_texlinks) +endif !WIN32 + diff --git a/Build/source/texk/texlive/tl_scripts/README b/Build/source/texk/texlive/tl_scripts/README new file mode 100644 index 00000000000..26f62ee66d4 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/README @@ -0,0 +1,8 @@ +$Id$ +Copyright 2013 TeX Users Group. +You may freely use, modify and/or distribute this file. + +This directory contains scripts which originated in teTeX, but with +teTeX's demise, are now maintained as part of TeX Live. Some have been +significantly or completely rewritten from the teTeX versions; most +notably, updmap is now implemented in Perl. diff --git a/Build/source/texk/texlive/tl_scripts/allcm.1 b/Build/source/texk/texlive/tl_scripts/allcm.1 new file mode 100644 index 00000000000..fe75f4ef6d3 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/allcm.1 @@ -0,0 +1,28 @@ +.TH allcm 1 "11/94" "teTeX" "teTeX" +.SH NAME +allcm \- force the most important Computer\-Modern\-fonts to be calculated +.SH SYNOPSIS +.B allcm [-r] +.SH DESCRIPTION +.I allcm +forces a large number of Computer Modern Fonts to be calculated as pixel files. +This is done through running +.IR dvips (1) +over a certain test-file. Therefore, the fonts are created in the resolution +needed by dvips. + +If the \-r flag is specified, the command +.IR dvired (1) +will be used instead of dvips. + +.I allcm +does not recalculate existing fonts (as long as the Metafont mode does not change). + +.SH "SEE ALSO" +allec(1), +allneeded(1), +dvips(1), +dvired(1). + +.SH AUTHOR +Thomas Esser diff --git a/Build/source/texk/texlive/tl_scripts/allcm.sh b/Build/source/texk/texlive/tl_scripts/allcm.sh new file mode 100755 index 00000000000..945c7c88457 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/allcm.sh @@ -0,0 +1,118 @@ +#!/bin/sh + +test -f /bin/sh5 && test -z "$RUNNING_SH5" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \ + && { RUNNING_SH5=true; export RUNNING_SH5; exec /bin/sh5 $0 ${1+"$@"}; } +unset RUNNING_SH5 + +test -f /bin/bsh && test -z "$RUNNING_BSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \ + && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; } +unset RUNNING_BSH + +# hack around a bug in zsh: +test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"' + +progname=`basename $0` +tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/$progname.$$ + +case "$progname" in + allec) + encoding=T1;; + *) + encoding=OT1;; +esac + +case "$1" in + -r) + DVIPS=dvired + shift + ;; + *) + DVIPS=dvips + ;; +esac + +body() +{ + cat <<-'eof' + \pagestyle{empty} + \parindent0in + \hfuzz=\maxdimen + \hbadness=10000 + \textheight9.5in + \textwidth6.5in + \newcommand{\myformula}{\sum a_{b_{c_d}} = c} + \newcommand{\mytext}{text $\mathcal{\myformula}\mathrm{\myformula} + \mathbf{\myformula}\mathsf{\myformula}\mathtt{\myformula} + \mathnormal{\myformula}\mathit{\myformula}$} + + \newcommand{\TestSizes}{{% + \tiny \mytext\scriptsize \mytext\footnotesize \mytext\small \mytext + \normalsize \mytext + \large \mytext\Large \mytext\LARGE \mytext\huge \mytext\Huge \mytext}} + \newcommand{\TestRM}{rm-family: {\rmfamily\TestSizes}\newline} + \newcommand{\TestSF}{sf-family: {\sffamily\TestSizes}\newline} + \newcommand{\TestTT}{tt-family: {\ttfamily\TestSizes}\newline} + \newcommand{\TestFamilies}{\TestRM\TestSF\TestTT\newline} + \newcommand{\TestMD}{md-series: {\mdseries\TestFamilies}} + \newcommand{\TestBF}{bf-series: {\bfseries\TestFamilies}} + \newcommand{\TestSeries}{\TestBF\TestMD\par} + \newcommand{\TestUP}{up-shape: {\upshape\TestSeries}\par} + \newcommand{\TestIT}{it-shape: {\itshape\TestSeries}\par} + \newcommand{\TestSL}{sl-shape: {\slshape\TestSeries}\par} + \newcommand{\TestSC}{sc-shape: {\scshape\TestSeries}\par} + \newcommand{\TestShapes}{\TestUP\TestIT\TestSL\TestSC} + \begin{document} + \TestShapes + \end{document} +eof +} + +head() +{ + echo '\documentclass['$1'pt]{article}' + echo '\usepackage['$encoding']{fontenc}' +} + +# before we create the tmpdir, set trap for cleanup +trap ' + rm -rf $tmpdir + exit 1 +' 1 2 3 7 13 15 + +(umask 077; mkdir "$tmpdir") || { + echo "$progname: failed to create temp directory." >&2 + exit 1 +} + +cd $tmpdir || exit 1 +echo >&2 +echo "---------------------------------------------------------------------" >&2 +echo ">>>>>>>>>>> Generating testfiles for 10pt, 11pt and 12pt. <<<<<<<<<<" >&2 +echo "---------------------------------------------------------------------" >&2 +head 10 > allcm10.tex +head 11 > allcm11.tex +head 12 > allcm12.tex +body >> allcm10.tex +body >> allcm11.tex +body >> allcm12.tex + +echo >&2 +echo "---------------------------------------------------------------------" >&2 +echo ">>>>>>>>>>> Calling latex... <<<<<<<<<<" >&2 +echo "---------------------------------------------------------------------" >&2 +latex allcm10 >/dev/null +latex allcm11 >/dev/null +latex allcm12 >/dev/null + +echo >&2 +echo "---------------------------------------------------------------------" >&2 +echo ">>>>>>>>>>> Now, calling $DVIPS to make missing fonts... <<<<<<<<<<" >&2 +echo "---------------------------------------------------------------------" >&2 +$DVIPS ${1+"$@"} -V -f allcm10 > /dev/null +$DVIPS ${1+"$@"} -V -f allcm11 > /dev/null +$DVIPS ${1+"$@"} -V -f allcm12 > /dev/null + +cd / +rm -rf $tmpdir diff --git a/Build/source/texk/texlive/tl_scripts/allec.1 b/Build/source/texk/texlive/tl_scripts/allec.1 new file mode 100644 index 00000000000..56bf87a60c5 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/allec.1 @@ -0,0 +1,28 @@ +.TH alldc 1 "11/94" "teTeX" "teTeX" +.SH NAME +allec \- force the most important ec\-fonts to be calculated +.SH SYNOPSIS +.B allec [\-r] +.SH DESCRIPTION +.I allec +forces a large number of ec-style Fonts to be calculated as pixel files. +This is done through running +.IR dvips (1) +over a certain test-file. Therefore, the fonts are created in the resolution +needed by dvips. + +If the \-r flag is specified, the command +.IR dvired (1) +will be used instead of dvips. + +.I alldc +does not recalculate existing fonts (as long as the Metafont mode does not change). + +.SH "SEE ALSO" +allcm(1), +allneeded(1), +dvips(1), +dvired(1). + +.SH AUTHOR +Thomas Esser diff --git a/Build/source/texk/texlive/tl_scripts/allneeded.1 b/Build/source/texk/texlive/tl_scripts/allneeded.1 new file mode 100644 index 00000000000..7d9a67548b7 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/allneeded.1 @@ -0,0 +1,30 @@ +.TH allneeded 1 "11/94" "teTeX" "teTeX" +.SH NAME +allneeded \- force the calculation of all fonts now needed +.SH SYNOPSIS +.B allneeded [\-r] files ... +.SH DESCRIPTION +.I allneeded +forces the calculation of all fonts that are needed to preview a set of +dvi files. Just specify where the program should search for files on the +commandline. +The fonts generation is triggered by running +.IR dvips (1) +over all accessible dvi\-files. Therefore, the fonts are created in the resolution +needed by dvips. + +If the \-r flag is specified, the command +.IR dvired (1) +will be used instead of dvips. + +.I allneeded +does not recalculate existing fonts (as long as the Metafont mode does not change). + +.SH "SEE ALSO" +allec(1), +allcm(1), +dvips(1), +dvired(1). + +.SH AUTHOR +Thomas Esser diff --git a/Build/source/texk/texlive/tl_scripts/allneeded.sh b/Build/source/texk/texlive/tl_scripts/allneeded.sh new file mode 100755 index 00000000000..15c62c84adb --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/allneeded.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +test -f /bin/sh5 && test -z "$RUNNING_SH5" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \ + && { RUNNING_SH5=true; export RUNNING_SH5; exec /bin/sh5 $0 ${1+"$@"}; } +unset RUNNING_SH5 + +test -f /bin/bsh && test -z "$RUNNING_BSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \ + && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; } +unset RUNNING_BSH + +progname=`basename $0` +dvired=false + +case $1 in +-r) DVIPS="dvips -x707" + shift;; +*) DVIPS=dvips;; +esac + +case $# in +0) echo "Usage: $progname [-r] files ..." >&2 + exit ;; +esac + +findopt= +dvipsopt= + +for i +do + if [ -f $i ] || [ -d $i ]; then + findopt="$findopt $i" + else + dvipsopt="$dvipsopt $i" + fi +done + +find $findopt -name \*.dvi -type f -print | + while true; do + read i + test -z "$i" && exit + echo "processing file '$i' ..." + $DVIPS $dvipsopt -f "$i" >/dev/null + echo + done diff --git a/Build/source/texk/texlive/tl_scripts/dvi2fax.1 b/Build/source/texk/texlive/tl_scripts/dvi2fax.1 new file mode 100644 index 00000000000..f7c436d6e33 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/dvi2fax.1 @@ -0,0 +1,22 @@ +.TH DVI2FAX 1 "October 30, 1999" +.\" man page by Jim Van Zandt -*- nroff -*- +.SH NAME +dvi2fax \- convert a TeX DVI file to G3 fax format +.SH SYNOPSIS +\fBdvi2fax\fP [\fB-hi\fP|\fB-lo\fP] \fIfile\fP[.dvi] [\fIoptions for dvips\fP] +.SH DESCRIPTION +\fBdvi2fax\fP uses \fBdvips\fP(1) to convert a TeX DVI file to PostScript, +then \fBgs\fP(1) to convert the PostScript to G3 fax file format. +.SH OPTIONS +.LP +.B -hi +use high fax resolution (204x196 dpi) (default). +.LP +.B -lo +use low fax resolution (204x98). +.PP +\fBdvips\fP options can follow the file name. +.SH EXAMPLE +Example: dvi2fax foo -l 2 +.SH SEE ALSO +\fBdvips\fP(1), \fBgs\fP(1). diff --git a/Build/source/texk/texlive/tl_scripts/dvi2fax.sh b/Build/source/texk/texlive/tl_scripts/dvi2fax.sh new file mode 100755 index 00000000000..fdfa83211eb --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/dvi2fax.sh @@ -0,0 +1,41 @@ +#!/bin/sh +# options for dvips are passwd down + +test -f /bin/sh5 && test -z "$RUNNING_SH5" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \ + && { RUNNING_SH5=true; export RUNNING_SH5; exec /bin/sh5 $0 ${1+"$@"}; } +unset RUNNING_SH5 + +test -f /bin/bsh && test -z "$RUNNING_BSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \ + && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; } +unset RUNNING_BSH + +# hack around a bug in zsh: +test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"' + +progname=`basename "$0"` +help() +{ + echo "Usage: $progname [-hi|-lo] file[.dvi] [options for dvips]" + echo " -hi: use high fax resolution (204x196) (default)" + echo " -lo: use low fax resolution (204x98)" + echo + echo "Example: $progname foo -l 2" +} + +dvipsconf=dfaxhigh; gsdev=dfaxhigh +case $1 in + -hi) gsdev=dfaxhigh; shift;; + -lo) gsdev=dfaxlow; shift;; +esac + +case $# in + 0) help >&2 + exit 1 + ;; +esac + +NAME=`basename "$1" .dvi` +dvips "$@" -P$dvipsconf -f | + gs -q -dSAFER -sDEVICE=$gsdev -sOutputFile="$NAME-%03d.fax" -sNOPAUSE - diff --git a/Build/source/texk/texlive/tl_scripts/dvired.1 b/Build/source/texk/texlive/tl_scripts/dvired.1 new file mode 100644 index 00000000000..f76e58087a3 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/dvired.1 @@ -0,0 +1,63 @@ +.TH dvired 1 "09/94" "teTeX" "teTeX" +.SH NAME +dvired \- print dvi-files +.SH SYNOPSIS +.B dvired +[ +.B options +] +.B file +.SH DESCRIPTION +.I dvired +behaves like +.IR dvips , +except for the fact that two logical pages are put onto each physical +sheet of paper. + +For +.IR options , +see +.IR dvips (1). +This program only interprets the following options: + +.I \-o file +\- redirect output into +.I file. + +.I \-P printer +\- direct output to +.I printer. + +.I \-f +\- direct output to stdout. + +Any other option is passed directly to +.IR dvips . + +.SH EXAMPLES +It is assumed that the PRINTER-variable is set. + +.B dvired \-Plw foo +\- send output to printer +.IR lw . +.br +.B dvired \-o foo.ps foo +\- send output to file +.IR foo.ps . +.br +.B dvired \-pp4-7 foo +\- send 4 pages (reduced onto 2 sheets) of +.I foo +to the printer. +.br +.B dvired foo \-f | ghostview \- +\- preview output with ghostview. + +.SH "SEE ALSO" +.IR dvips (1) +.SH BUGS +.I dvired +is fixed on A4 paper size. If you want to use it with other paper, you have +to change the settings within the source. +.SH AUTHOR +Thomas Esser diff --git a/Build/source/texk/texlive/tl_scripts/dvired.sh b/Build/source/texk/texlive/tl_scripts/dvired.sh new file mode 100755 index 00000000000..4eb3586119d --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/dvired.sh @@ -0,0 +1,98 @@ +#!/bin/sh +#============================================================================== +# Version: 0.3 +# Module: dvired +# Purpose: Translate dvi-file into postscript with reduced output size. +# Two logical pages will be put on onto each physical sheet of +# paper. +# System: Linux. UNIX(tm) systems may work as well :-) +# Requires: pstops (http://www.dcs.ed.ac.uk/home/ajcd/psutils/), dvips +# Created: 19.11.1992 +# Last Change: 13.08.1999 +# Language: sh +# Author: Thomas Esser +# Address: te@dbs.uni-hannover.de +# Copyright: (c) 1994, 1999 by Thomas Esser +# Copying: GNU GENERAL PUBLIC LICENSE +#============================================================================== + +test -f /bin/sh5 && test -z "$RUNNING_SH5" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \ + && { RUNNING_SH5=true; export RUNNING_SH5; exec /bin/sh5 $0 ${1+"$@"}; } +unset RUNNING_SH5 + +test -f /bin/bsh && test -z "$RUNNING_BSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \ + && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; } +unset RUNNING_BSH + +help() +{ + cat < "$of" + ;; +esac diff --git a/Build/source/texk/texlive/tl_scripts/e2pall.1 b/Build/source/texk/texlive/tl_scripts/e2pall.1 new file mode 100644 index 00000000000..b102568b53a --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/e2pall.1 @@ -0,0 +1,55 @@ +.TH "e2pall" "1" "August 2000" "teTeX" "teTeX" +.PP +.SH "NAME" +e2pall \- convert all EPS files in a LaTeX document to PDF +.PP +.SH "SYNOPSIS" +.PP +\fBe2pall\fP \fITEXFILE\fP +.PP +.SH "DESCRIPTION" +.PP +\fBe2pall\fP searches through \fITEXFILE\fP for \eincludegraphics +commands to find the base names of image files\&. When it finds one, +\fBe2pall\fP runs \fBepstopdf\fP(1) to create a PDF file from the EPS +file\&. +.PP +\fBe2pall\fP will check to be sure that an existing PDF file is +up-to-date with the EPS file, and will not run \fBepstopdf\fP(1) if +the PDF file is newer than the EPS file\&. +.PP +.SH "BUGS" +.PP +.IP "" +Seems to be broken +.IP "" +Cannot handle \einput{\fIfilename\fP} or +\eincludegraphics{\fIfilename\fP} split over more than one +line +.IP "" +Must be run from same directory as the LaTeX file +.IP "" +Does not look down $TEXINPUTS +.IP "" +Cannot handle documents that use \einclude commands +.IP "" +Assumes \fIall\fP files included with \eincludegraphics are EPS +files +.IP +.PP +.SH "SEE ALSO" +.PP +\fBepstopdf\fP(1) +.PP +.SH "AUTHOR" +.PP +\fBe2pall\fP was written by Jody Klymak and published in a posting to +the (mailing list)\&. +.PP +This manual page was written by C\&.M\&. Connelly +, for +the Debian GNU/Linux system\&. It may be used by other distributions +without contacting the author\&. Any mistakes or omissions in the +manual page are my fault; inquiries about or corrections to this +manual page should be directed to me (and not to the primary author)\&. +.PP diff --git a/Build/source/texk/texlive/tl_scripts/e2pall.pl b/Build/source/texk/texlive/tl_scripts/e2pall.pl new file mode 100755 index 00000000000..2997f8b1102 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/e2pall.pl @@ -0,0 +1,89 @@ +#!/usr/bin/env perl + +# Author: Jody Klymak , publisted by a posting +# to the pdftex mailinglist. + +# recursively finds all your eps files. Looks down \input{fname}. +# CAVEATS: +# 1) cannot handle \input{fname} split over more than one line. +# 1.5) cannot handle multiple \input{} or \includegraphics{} on one line. +# 2) Must be run from same directory as the Latex file. +# 3) Does not look down $TEXINPUTS or anything fancy like that... +# 4) Handling of \include is untested (though I guess its trivial) +# 5) Assumes *all* your graphics inclusions are [e]ps. But don't +# fret, because if they are not epstopdf dies anyhow.... +# 6) Does not distinguish between percent (\%) and comment (%). + +# Changelog: +# 20030103 -- Lachlan Andrew +# * Only append '.tex' if $fname doesn't exist. +# * Correctly handle lines with '}' after the \includegraphics{} +# * Allow multiple extensions for graphics files. .eps -> .ps -> none +# (Should try them in the same order as \includegraphics does +# -- given by \DeclareGraphicsExtensions{}?) +# * Allow \include the same way as \input +# * Allow \includegraphics{} to be split over multiple lines +# * Check that commands begin with '\', and allow spaces before arguments + +# EDIT these two lines for your system.... + +$Eps2PdfCom = "epstopdf"; +$ThisFunCom = "e2pall"; + +$fname=$ARGV[0]; + +# check for a *.tex at the end... +if ((-f "$fname")=="" && $fname !~ /.tex$/){ + $fname = "$fname.tex"; +} + +open(TEXFILE,$fname) or die "Cannot open file $fname"; +# print "Finding *.eps files in $fname\n"; + +$seekingArg = 0; +while($line=){ + # truncate $line after % sign.... + $line=~s/%.*//; + # check for /input.... + if ($line=~/\\input *{([^}]*)}/){ + print `$ThisFunCom $1`; + } + # check for /include.... + if ($line=~/\\include *{([^}]*)}/){ + print `$ThisFunCom $1`; + } + + $base = ""; + if ($line=~/\\includegraphics.*{([^}]*)}/){ + $base = $1; + } + elsif ($seekingArg==1 && ($line=~/{([^}]*)}/)){ + $base = $1; + } + elsif ($line=~/\\includegraphics/){ + $seekingArg = 1; + } + + if ($base ne "") { + $seekingArg = 0; + if ((-f "$base.eps")!="") { + $srcfile = "$base.eps"; + } + elsif ((-f "$base.ps")!=""){ + $srcfile = "$base.ps"; + } + else { + $srcfile = $base; + } + # check that the [e]ps version is newer than the pdf version.... + if ((-M "$base.pdf")=="" || (-M "$base.pdf") >= (-M "$srcfile")){ + print "Constructing \t $base.pdf from $srcfile\n"; + print `$Eps2PdfCom $srcfile`; + } + else{ + print "$base.pdf \t is up to date with $srcfile\n"; + } + + }; +} +close(TEXFILE); diff --git a/Build/source/texk/texlive/tl_scripts/fmtutil-sys.sh b/Build/source/texk/texlive/tl_scripts/fmtutil-sys.sh new file mode 100755 index 00000000000..bfb52f94e1f --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/fmtutil-sys.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# fmtutil-sys: Thomas Esser, public domain. + +# wrapper script for fmtutil with TEXMFVAR and TEXMFCONFIG set to +# TEXMFSYSVAR / TEXMFSYSCONFIG + +test -f /bin/ksh && test -z "$RUNNING_KSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \ + && { RUNNING_KSH=true; export RUNNING_KSH; exec /bin/ksh $0 ${1+"$@"}; } +unset RUNNING_KSH + +test -f /bin/bsh && test -z "$RUNNING_BSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \ + && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; } +unset RUNNING_BSH + +# hack around a bug in zsh: +test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"' +export PATH + +v=`kpsewhich -var-value TEXMFSYSVAR` +c=`kpsewhich -var-value TEXMFSYSCONFIG` + +TEXMFVAR="$v" +TEXMFCONFIG="$c" +export TEXMFVAR TEXMFCONFIG + +exec fmtutil ${1+"$@"} diff --git a/Build/source/texk/texlive/tl_scripts/fmtutil.1 b/Build/source/texk/texlive/tl_scripts/fmtutil.1 new file mode 100644 index 00000000000..39ed57bf8b5 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/fmtutil.1 @@ -0,0 +1,113 @@ +.TH FMTUTIL 1 "June 2011" "TeX Live" "TeX Live" +.SH "NAME" +fmtutil \- utility for maintaining TeX format files +.PP +fmtutil-sys \- utility for maintaining TeX format files system\-wide +.SH "SYNOPSIS" +.B fmtutil\fP +.RI [ OPTION .\|.\|.] +.I COMMAND +.PP +.B fmtutil-sys +.RI [ OPTION .\|.\|.] +.I COMMAND +.SH "DESCRIPTION" +\fBfmtutil\fP is used to create or recreate format and hyphenation +files or show information about format files\&. +.PP +\fICOMMAND\fP is one of: +.PP +.TP +.B --all +recreate all format files +.TP +.BI --byengine \ enginename +(re)create formats that depend on the +engine \fIenginename\fP +.TP +.BI --byfmt \ formatname +(re)create the format for +format \fIformatname\fP +.TP +.BI --byhyphen \ hyphenfile +(re)create formats that depend on the +hyphenation file \fIhyphenfile\fP +.TP +.B --catcfg +output the content of the config file +.TP +.BI --disablefmt \ formatname +disable +.I formatname +in config file +.TP +.B --edit +no-op in TeX Live +.TP +.BI --enablefmt \ formatname +ensable +.I formatname +in config file +.TP +.B --help +print a summary of commands and options +.TP +.B --listcfg +list (enabled and disabled) configurations, filtered to available formats +.TP +.B --missing +create all missing format files +.TP +.B --refresh +recreate only existing format files +.TP +.BI --showhyphen \ formatname +print the name of the +hyphenation file for the format +\fIformatname\fP +.TP +.B --version +show version info +.SH "OPTIONS" +.TP +.BI --cnffile \ file +specify the configuration +\fIfile\fP \fBfmtutil\fP should use +.TP +.B --dolinks +(not implemented, just for compatibility) +.TP +.BI --fmtdir \ directory +set the destination +directory for format files generated by +\fBfmtutil\fP to \fIdirectory\fP +.TP +.B --force +(not implemented, just for compatibility) +.TP +.B --no-engine-subdir +don't use engine-specific subdir of the fmtdir +.TP +.B --no-error-if-no-format +exit successfully if no format is selected +.TP +.B --quiet +be silent +.TP +.B --test +(not implemented, just for compatibility) +.SH "FILES" +.TP +.I fmtutil\&.cnf +default configuration file +.SH "SEE ALSO" +.BR kpsewhich (1) +.SH "BUGS" +None known, but report any bugs found to (mailing list). +.SH "AUTHOR" +\fBfmtutil\fP was written by Thomas Esser + and is in the public domain. +.PP +This manual page was written by C\&.M\&. Connelly +, for +the Debian GNU/Linux system and later slightly adapted for the teTeX 3 release\&. diff --git a/Build/source/texk/texlive/tl_scripts/fmtutil.cnf b/Build/source/texk/texlive/tl_scripts/fmtutil.cnf new file mode 100644 index 00000000000..8e1ab82149f --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/fmtutil.cnf @@ -0,0 +1,126 @@ +# Generated by /home/texlive/karl/Master/bin/i386-linux/tlmgr on Mon May 14 04:46:13 2012 +# $Id: fmtutil-hdr.cnf 13067 2009-05-12 22:04:17Z preining $ +# Originally written by Thomas Esser, 1998. Public domain. +# +# As of TeX Live 2008, the final fmtutil.cnf is generated by +# tlmgr generate fmtutil. You can use +# tlmgr generate fmtutil -localcfg /some/file to make local additions. +# See tlmgr --help for more info. +# +# The format of the table is: +# +# format engine pattern-file arguments +# +# The last "argument" must be the name of the file on which to run +# the ini-engine (such as initex). If the ini-engine is e-TeX, and the +# e-TeX extensions should be enabled, the filename must be prefixed with +# a * character. +# +# fmtutil always passes the -ini option to the engine. +# If no pattern-file is desired, use -. +# Either spaces or tabs can be used as separators. +# +# Other notes: +# 1) tex and amstex just load hyphen.tex. No customization. +# You can have your own customized (via babel's hyphen.cfg) +# formats on top of plain by using "bplain.tex" instead of +# plain.tex (see e.g. bplain.ini file for bplain format). +# +# 2) etex-based formats load language.def, not language.dat. +# +# 3) The symbolic link to the right engines (e.g. bplain -> tex) +# is generated by the "texlinks" script. +# +# 4) usual comments start with "# ", whereas disabled configurations +# start with "#! " in this file. + +# +# from aleph: +aleph aleph - *aleph.ini +lamed aleph language.dat *lambda.ini +# +# from amstex: +amstex pdftex - -translate-file=cp227.tcx *amstex.ini +# +# from context: +cont-en pdftex cont-usr.tex -8bit *cont-en.ini +cont-en xetex cont-usr.tex -8bit *cont-en.ini +#! cont-de pdftex cont-usr.tex -8bit *cont-de.ini +#! cont-fr pdftex cont-usr.tex -8bit *cont-fr.ini +#! cont-it pdftex cont-usr.tex -8bit *cont-it.ini +#! cont-nl pdftex cont-usr.tex -8bit *cont-nl.ini +#! cont-ro pdftex cont-usr.tex -8bit *cont-ro.ini +# +# from cslatex: +cslatex pdftex - -etex -translate-file=cp227.tcx cslatex.ini +pdfcslatex pdftex - -etex -translate-file=cp227.tcx cslatex.ini +# +# from csplain: +csplain pdftex - -etex -translate-file=cp227.tcx csplain.ini +pdfcsplain pdftex - -etex -translate-file=cp227.tcx csplain.ini +# +# from eplain: +eplain pdftex language.dat -translate-file=cp227.tcx *eplain.ini +# +# from jadetex: +jadetex pdftex language.dat *jadetex.ini +pdfjadetex pdftex language.dat *pdfjadetex.ini +# +# from latex-bin: +latex pdftex language.dat -translate-file=cp227.tcx *latex.ini +pdflatex pdftex language.dat -translate-file=cp227.tcx *pdflatex.ini +dvilualatex luatex language.dat,language.dat.lua dvilualatex.ini +lualatex luatex language.dat,language.dat.lua lualatex.ini +# +# from luatex: +luatex luatex language.def,language.dat.lua luatex.ini +dviluatex luatex language.def,language.dat.lua dviluatex.ini +# +# from metafont: +mf mf-nowin - -translate-file=cp227.tcx mf.ini +# +# from mex: +mex pdftex mexconf.tex -translate-file=cp227.tcx *mex.ini +pdfmex pdftex mexconf.tex -translate-file=cp227.tcx *pdfmex.ini +utf8mex pdftex mexconf.tex -enc *utf8mex.ini +# +# from mltex: +mllatex pdftex language.dat -translate-file=cp227.tcx -mltex mllatex.ini +mltex pdftex - -translate-file=cp227.tcx -mltex mltex.ini +# +# from mptopdf: +mptopdf pdftex - -translate-file=cp227.tcx mptopdf.tex +# +# from pdftex: +pdftex pdftex language.def -translate-file=cp227.tcx *pdfetex.ini +etex pdftex language.def -translate-file=cp227.tcx *etex.ini +pdfetex pdftex language.def -translate-file=cp227.tcx *pdfetex.ini +# +# from ptex: +ptex ptex - ptex.ini +eptex eptex language.def *eptex.ini +platex eptex language.dat *platex.ini +# +# from t2: +#! cyramstex pdftex language.dat -translate-file=cp227.tcx *cyramstx.ini +#! cyrtex pdftex language.dat -translate-file=cp227.tcx *cyrtex.ini +#! cyrtexinfo pdftex language.dat -translate-file=cp227.tcx *cyrtxinf.ini +# +# from tex: +tex tex - tex.ini +# +# from texsis: +texsis pdftex - -translate-file=cp227.tcx texsis.ini +# +# from uptex: +uptex uptex - uptex.ini +euptex euptex language.def *euptex.ini +uplatex euptex language.dat *uplatex.ini +# +# from xetex: +xetex xetex language.def -etex xetex.ini +xelatex xetex language.dat -etex xelatex.ini +# +# from xmltex: +xmltex pdftex language.dat *xmltex.ini +pdfxmltex pdftex language.dat *pdfxmltex.ini diff --git a/Build/source/texk/texlive/tl_scripts/fmtutil.cnf.5 b/Build/source/texk/texlive/tl_scripts/fmtutil.cnf.5 new file mode 100644 index 00000000000..4efedcf590c --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/fmtutil.cnf.5 @@ -0,0 +1,77 @@ +.TH "fmtutil\&.cnf" "5" "October 2000" "teTeX" "teTeX" +.PP +.SH "NAME" +fmtutil\&.cnf \- configuration file for fmtutil +.PP +.SH "DESCRIPTION" +.PP +The \fIfmtutil\&.cnf\fP file contains the configuration information +for \fBfmtutil\fP(8)\&. Each line contains the name of the format +(e\&.g\&., ``tex\'\', ``latex\'\', ``omega\'\'), the name of the engine that +is used by that format (e\&.g\&., ``tex\'\', ``etex\'\', ``omega\'\'), the pattern +file (e\&.g\&., \fIlanguage\&.dat\fP, \fIlanguage\&.def\fP), and any +arguments (name of an \fI\&.ini\fP file)\&. +.PP +Fields are separated by whitespace\& and complete lines can be commented +out with ``#\'\'\&. The ``pattern file\'\' field cannot be used to +define a file that is used while building the format\&. +It tells \fBfmtutil\fP which files (separated by commas) the +format creation procedure reads\& and it has an effect to the options +\fI--showhyphen\fP and \fI--byhyphen\fP\&. +If the format has no way to +customize hyphenation, a ``-\'\' can be used to indicate this\&. +.PP +.SH "NOTES" +.PP +The \fBtex\fP(1) and \fBamstex\fP(1) formats always load +\fIhyphen\&.tex\fP\&. No customization by a pattern file is available +for these formats\&. Therefore, the pattern-file field for the +\fBtex\fP and \fBamstex\fP is usually indicated to be empty (``-\'\')\&. +.PP +You can, however, build customized formats on top of plain +\fBtex\fP(1) or \fBamstex\fP(1) by using \fIbplain\&.tex\fP instead of +\fIplain\&.tex\fP (b for the \fIBabel\fP system). See, for example, +the \fIbplain\&.ini\fP file for the bplain format)\&. +.PP +\fBetex\fP(1) loads \fIlanguage\&.def\fP, not +\fIlanguage\&.dat\fP\&. +.PP +Symbolic links to the correct engines (e\&.g\&., bplain -> tex) +are generated by the \fBtexlinks\fP(8) script\&. Remember to run +\fBtexlinks\fP(8) if you run \fBfmtutil\fP(8) yourself, rather +than using the FORMATS option in \fBtexconfig\fP(8)\&. +.PP +.SH "FILES" +.PP +.IP "\fIfmtutil\&.cnf\fP" +default configuration file +.IP "\fIlanguage\&.dat\fP" +hyphenation pattern file +.IP "\fIlanguage\&.def\fP" +hyphenation pattern file +.IP "\fIlanguage\&.dat.lua\fP" +hyphenation pattern file +.PP +.SH "SEE ALSO" +.PP +\fBamstex\fP(1), \fBetex\fP(1), \fBfmtutil\fP(8), +\fBtex\fP(1), \fBtexconfig\fP(8), \fBtexlinks\fP(8)\&. +.PP +Web page: +.PP +.SH "BUGS" +.PP +None known, but report any bugs found to (mailing list)\&. +.PP +.SH "AUTHOR" +.PP +\fIfmtutil\&.cnf\fP was written by Thomas Esser +, and is Copyright 1998, +1999 but released into the public domain\&. +.PP +This manual page was written by C\&.M\&. Connelly +, for +the Debian GNU/Linux system\&. It may be used by other distributions +without contacting the author\&. Any mistakes or omissions in the +manual page are my fault; inquiries about or corrections to this +manual page should be directed to me (and not to the primary author)\&. diff --git a/Build/source/texk/texlive/tl_scripts/fmtutil.sh b/Build/source/texk/texlive/tl_scripts/fmtutil.sh new file mode 100755 index 00000000000..b9f97aa8998 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/fmtutil.sh @@ -0,0 +1,1017 @@ +#!/bin/sh +# fmtutil - utility to maintain format files. +# Public domain. Originally written by Thomas Esser. +# Run with --help for usage. + +# program history: +# further changes in texk/tetex/ChangeLog. +# 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 Ma 27 18:52:06 CEST 2005 honor $TMPDIR, $TEMP and $TMP, not just $TMP +# Sa Jan 15 18:13:46 CET 2005 avoid multiple variable assignments in one statement +# Di Jan 11 11:42:36 CET 2005 fix --byhyphen with relative hyphenfile +# Fr Dez 31 16:51:29 CET 2004 option catcfg added (for being called by texconfig) +# Do Dez 30 21:53:27 CET 2004 rename variable verbose to verboseFlag +# Sa Dez 25 12:44:23 CET 2004 implementation adopted for teTeX-3.0 (tcfmgr) +# Do Okt 28 11:09:36 CEST 2004 added --refresh +# Fr Sep 17 19:25:28 CEST 2004 save $0 in a variable before calling a function +# Sun May 9 23:24:06 CEST 2004 changes for new web2c: format names +# are now *.fmt, nothing else, disable +# "plain" symlinks +# Thu May 6 14:16:19 CEST 2004: "mv .../dev/null \ + && { RUNNING_KSH=true; export RUNNING_KSH; exec /bin/ksh $0 ${1+"$@"}; } +unset RUNNING_KSH + +test -f /bin/bsh && test -z "$RUNNING_BSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \ + && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; } +unset RUNNING_BSH + +# hack around a bug in zsh: +test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"' + +progname=fmtutil +argv0=$0 +version='$Id$' + +cnf=fmtutil.cnf # name of the config file +export PATH + +############################################################################### +# cleanup() +# clean up the temp area and exit with proper exit status +############################################################################### +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 +} + +############################################################################### +# help() and version() +# display help (or version) message and exit +############################################################################### +help() +{ + cat < +eof + cleanup 0 +} + +versionfunc() +{ + cat </dev/null; then + ed "$file" >/dev/null 2>&1 <<-eof + /$pat/ + c + $line + . + w + q +eof + else + echo "$line" >> $file + fi +} + +############################################################################### +# setmatch(match) +# setting the "match state" to true or false. Used to see if there was at +# least one match. +############################################################################### +setmatch() +{ + match=$1 +} + +############################################################################### +# getmatch() +# return success if there was at least one match. +############################################################################### +getmatch() +{ + test "x$match" = xtrue +} + +############################################################################### +# initTexmfMain() +# get $MT_TEXMFMAIN from $TEXMFMAIN +############################################################################### +initTexmfMain() +{ + case $MT_TEXMFMAIN in + "") MT_TEXMFMAIN=`kpsewhich --var-value=TEXMFMAIN`;; + esac + export MT_TEXMFMAIN +} + +############################################################################### +# cache_vars() +# locate files / kpathsea variables and export variables to environment +# this speeds up future calls to e.g. mktexupd +############################################################################### +cache_vars() +{ + : ${MT_VARTEXFONTS=`kpsewhich --expand-var='$VARTEXFONTS' | sed 's%^!!%%'`} + : ${MT_MKTEXNAM=`kpsewhich --format='web2c files' mktexnam`} + : ${MT_MKTEXNAM_OPT=`kpsewhich --format='web2c files' mktexnam.opt`} + : ${MT_MKTEXDIR=`kpsewhich --format='web2c files' mktexdir`} + : ${MT_MKTEXDIR_OPT=`kpsewhich --format='web2c files' mktexdir.opt`} + : ${MT_MKTEXUPD=`kpsewhich --format='web2c files' mktexupd`} + : ${MT_MKTEX_CNF=`kpsewhich --format='web2c files' mktex.cnf`} + : ${MT_MKTEX_OPT=`kpsewhich --format='web2c files' mktex.opt`} + export MT_VARTEXFONTS MT_MKTEXNAM MT_MKTEXNAM_OPT MT_MKTEXDIR + export MT_MKTEXDIR_OPT MT_MKTEXUPD MT_MKTEX_CNF MT_MKTEX_OPT +} + +############################################################################### +# abort(errmsg) +# print `errmsg' to stderr and exit with error code 1 +############################################################################### +abort() +{ + echo "$progname: $1." >&2 + cleanup 1 +} + +############################################################################### +# maybe_abort(errmsg) +# print `errmsg' to stderr and +# unless noAbortFlag is set exit with error code 1 +############################################################################### +maybe_abort() +{ + echo "$progname: $1." >&2 + $noAbortFlag || cleanup 1 +} + +############################################################################### +# verboseMsg(msg) +# print `msg' to stderr is $verbose is true +############################################################################### +verboseMsg() { + $verboseFlag && verbose echo ${1+"$@"} +} + +############################################################################### +# byebye() +# report any failures and exit the program +############################################################################### +byebye() +{ + if $has_warnings; then + { + cat <&2 + fi + + if $has_errors; then + { + cat <&2 + cleanup 1 + else + cleanup 0 + fi +} + +############################################################################### +# init_log_warning() +# reset the list of warning messages +############################################################################### +init_log_warning() +{ + log_warning_msg= + has_warnings=false +} + +############################################################################### +# init_log_failure() +# reset the list of failure messages +############################################################################### +init_log_failure() +{ + log_failure_msg= + has_errors=false +} + +############################################################################### +# log_warning(errmsg) +# report and save warning message `errmsg' +############################################################################### +log_warning() +{ + echo "Warning: $@" >&2 + if test -z "$log_warning_msg"; then + log_warning_msg="$@" + else + OLDIFS=$IFS; IFS= + log_warning_msg="$log_warning_msg +$@" + IFS=$OLDIFS + fi + has_warnings=true +} + +############################################################################### +# log_failure(errmsg) +# report and save failure message `errmsg' +############################################################################### +log_failure() +{ + echo "Error: $@" >&2 + if test -z "$log_failure_msg"; then + log_failure_msg="$@" + else + OLDIFS=$IFS; IFS= + log_failure_msg="$log_failure_msg +$@" + IFS=$OLDIFS + fi + has_errors=true +} + +############################################################################### +# verbose (cmd) +# execute cmd. Redirect output depending on $mktexfmtMode. +############################################################################### +verbose() +{ + $mktexfmtMode && ${1+"$@"} >&2 || ${1+"$@"} +} + +############################################################################### +# mktexdir(args) +# call mktexdir script, disable all features (to prevent sticky directories) +############################################################################### +mktexdir() +{ + initTexmfMain + MT_FEATURES=none "$MT_TEXMFMAIN/web2c/mktexdir" "$@" >&2 +} + +############################################################################### +# tcfmgr(args) +# call tcfmgr script +############################################################################### +tcfmgr() +{ + initTexmfMain + "$MT_TEXMFMAIN/texconfig/tcfmgr" "$@" +} + +############################################################################### +# mktexupd(args) +# call mktexupd script +############################################################################### +mktexupd() +{ + initTexmfMain + "$MT_TEXMFMAIN/web2c/mktexupd" "$@" +} + +############################################################################### +# 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 + cfgparam= + cfgmaint= + verboseFlag=true + noAbortFlag=false + # eradicate double slashes to avoid kpathsea expansion. + tmpdir=`echo ${TMPDIR-${TEMP-${TMP-/tmp}}}/$progname.$$ | sed s,//,/,g` + + # 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) + mktexfmtMode=true + fullfmt=$1; shift + case $fullfmt in + ""|--help) help ;; + --version) versionfunc ;; + --*) abort "unknown option $fullfmt, try --help" ;; + *.fmt|*.mem|*.base) + set x --byfmt `echo $fullfmt | sed 's@\.[a-z]*$@@'` ${1+"$@"} + shift + ;; + *.*) abort "unknown format type: $fullfmt" ;; + *) set x --byfmt $fullfmt; shift ;; + esac + ;; + esac + + use_engine_dir=true # whether to use web2c/$engine subdirs + while + case $1 in + --cnffile) + shift; cnf_file=$1; cfgparam=1;; + --cnffile=*) + cnf_file=`echo "$1" | sed 's/--cnffile=//'`; cfgparam=1; shift ;; + --fmtdir) + shift; destdir=$1;; + --fmtdir=*) + destdir=`echo "$1" | sed 's/--fmtdir=//'`; shift ;; + --no-engine-subdir) + use_engine_dir=false;; + --all|-a) + cmd=all;; + --edit|-e) + cmd=edit; cfgmaint=1;; + --missing|-m) + cmd=missing;; + --refresh|-r) + cmd=refresh;; + --byengine) + shift; cmd=byengine; arg=$1;; + --byengine=*) + cmd=byengine; arg=`echo "$1" | sed 's/--byengine=//'`; shift ;; + --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;; + --version) + cmd=version;; + --enablefmt) + shift; cmd=enablefmt; arg=$1; cfgmaint=1;; + --enablefmt=*) + cmd=enablefmt; arg=`echo "$1" | sed 's/--enablefmt=//'`; cfgmaint=1; shift;; + --disablefmt) + shift; cmd=disablefmt; arg=$1; cfgmaint=1;; + --disablefmt=*) + cmd=disablefmt; arg=`echo "$1" | sed 's/--disablefmt=//'`; cfgmaint=1; shift;; + --catcfg) + cmd=catcfg;; + --listcfg) + cmd=listcfg;; + --no-error-if-no-format) + noAbortFlag=true;; + --quiet|-q|--silent) + verboseFlag=false;; + --test|--dolinks|--force) + ;; + "") break;; + *) abort "unknown option \`$1'; try $progname --help if you need it";; + esac + do test $# -gt 0 && shift; done + + case "$cmd" in + "") abort "missing command; try $progname --help if you need it";; + help) help;; + version) versionfunc;; + esac + + if test -n "$cfgparam"; then + test -f "$cnf_file" || abort "config file \`$cnf_file' not found (ls-R missing?)" + fi + + if test -n "$cfgmaint"; then + if test -z "$cfgparam"; then + setupTmpDir + co=`tcfmgr --tmp $tmpdir --cmd co --file $cnf` + test $? = 0 || cleanup 1 + set x $co; shift + id=$1; cnf_file=$3; orig=$4 + verboseMsg "$progname: initial config file is \`$orig'" + fi + else + if test -z "$cfgparam"; then + cnf_file=`tcfmgr --cmd find --file $cnf` + test -f "$cnf_file" || abort "config file \`$cnf' not found" + fi + fi + + # these commands need no temp directory, so do them here: + case "$cmd" in + catcfg) + grep -v '^ *#' "$cnf_file" | sed 's@^ *@@; s@ *$@@' | grep . | sort + cleanup $? ;; + edit) + echo "$0: fmtutil --edit is disabled in TeX Live;" >&2 + echo "$0: use a file fmtutil-local.cnf instead." >&2 + echo "$0: See tlmgr --help or http://tug.org/texlive/doc/tlmgr.html." >&2 + cleanup 0 ;; + enablefmt|disablefmt) + $cmd $arg ;; # does not return + listcfg) + listcfg_loop + cleanup $? ;; + showhyphen) + show_hyphen_file "$arg" + cleanup $? ;; + esac + + if test -n "$cfgmaint"; then + if test -z "$cfgparam"; then + ci=`tcfmgr --tmp $tmpdir --cmd ci --id $id` + if test $? = 0; then + if test -n "$ci"; then + verboseMsg "$progname: configuration file updated: \`$ci'" + else + verboseMsg "$progname: configuration file unchanged." + fi + else + abort "failed to update configuration file." + fi + fi + cleanup $? + fi + + # set up destdir: + if test -z "$destdir"; then + : ${MT_TEXMFVAR=`kpsewhich -var-value=TEXMFVAR`} + destdir=$MT_TEXMFVAR/web2c + fi + test -d "$destdir" || mktexdir "$destdir" >/dev/null 2>&1 + test -d "$destdir" || abort "format directory \`$destdir' does not exist" + test -w "$destdir" || abort "format directory \`$destdir' is not writable" + + thisdir=`pwd` + + : ${KPSE_DOT=$thisdir} + export KPSE_DOT + + # due to KPSE_DOT, we don't search the current directory, so include + # it explicitly for formats that \write and later on \read + TEXINPUTS="$tmpdir:$TEXINPUTS"; export TEXINPUTS + # for formats that load other formats (e.g., jadetex loads latex.fmt), + # add the current directory to TEXFORMATS, too. Currently unnecessary + # for MFBASES and MPMEMS. + TEXFORMATS="$tmpdir:$TEXFORMATS"; export TEXFORMATS + + setupTmpDir + cd "$tmpdir" || cleanup 1 + + # make local paths absolute: + case "$destdir" in + /*) ;; + *) destdir="$thisdir/$destdir";; + esac + case "$cnf_file" in + /*) ;; + *) cnf_file="$thisdir/$cnf_file";; + esac + + cache_vars + init_log_failure + init_log_warning + # execute the desired command: + case "$cmd" in + all) + recreate_all;; + missing) + create_missing;; + refresh) + recreate_existing;; + byengine) + recreate_by_engine "$arg";; + byfmt) + recreate_by_fmt "$arg";; + byhyphen) + recreate_by_hyphenfile "$arg";; + esac + + 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 +# texargs: flags for initex and name of the ini file (e.g. -mltex frlatex.ini) +# fmtfile: name of the format file (without directory, but with extension) +# +# Support for building internationalized formats sets: +# pool: base name of pool file (to support translated pool files) +# tcx: translation file used when creating the format +# +# Example (for fmtutil.cnf): +# mex-pl tex mexconf.tex nls=tex-pl,il2-pl mex.ini +# +# The nls parameter (pool,tcx) can only be specified as the first argument +# inside the 4th field in fmtutil.cnf. +# +# exit code: returns error code if the ini file is not installed +############################################################################### +parse_line() +{ + case $1 in + '#!') disabled=true; shift;; + *) disabled=false;; + esac + format=$1 + engine=$2 + hyphenation=$3 + shift; shift; shift + + # handle nls support: pool + tcx + pool=; tcx= + case $1 in + nls=*) + pool=`echo $1 | sed 's@nls=@@; s@,.*@@'` + tcx=`echo $1 | sed 's@nls=[^,]*@@; s@^,@@'` + shift # nls stuff is not handled by the engine directly, + # so we shift this away + ;; + esac + + texargs="$@" + + case "$engine" in + mpost) fmtfile="$format.mem"; kpsefmt=mp; texengine=metapost;; + mf|mfw|mf-nowin) fmtfile="$format.base"; kpsefmt=mf; texengine=metafont;; + *) fmtfile="$format.fmt"; kpsefmt=tex; texengine=$engine;; + esac + + # remove any * for the sake of the kpsewhich lookup. + eval lastarg=\$$# + inifile=`echo $lastarg | sed 's%^\*%%'` + + # See if we can find $inifile for return code: + kpsewhich -progname=$format -format=$kpsefmt $inifile >/dev/null 2>&1 +} + +############################################################################### +# find_hyphenfile(format, hyphenation) searches for hyphenation along +# searchpath of format +# exit code: returns error is file is not found +############################################################################### +find_hyphenfile() +{ + format="$1"; hyphenation="`echo $2 | sed 's/,/ /g'`" + case $hyphenation in + -) ;; + *) kpsewhich -progname="$format" -format=tex $hyphenation;; + esac +} + +############################################################################### +# find_info_for_name(format) +# Look up the config line for format `format' and call parse_line to set +# global variables. +############################################################################### +find_info_for_name() +{ + format="$1" + + # set x `awk '$1 == format {print; exit}' format="$format" "$cnf_file"`; shift + set x `egrep "^$format( | )" "$cnf_file" | sed q`; shift + test $# = 0 && abort "no info for format \`$format'" + parse_line "$@" +} + +############################################################################### +# run_initex() +# Calls initex. Assumes that global variables are set by parse_line. +############################################################################### +run_initex() +{ + + # install a pool file and set tcx flag if requested in lang= option: + rm -f *.pool + poolfile= + tcxflag= + test -n "$pool" \ + && poolfile=`(kpsewhich -progname=$engine $pool.pool) 2>/dev/null` + if test -n "$poolfile" && test -f "$poolfile"; then + verboseMsg "$progname: attempting to create localized format using pool=$pool and tcx=$tcx." + cp "$poolfile" $engine.pool + test -n "$tcx" && tcxflag=-translate-file=$tcx + localpool=true + else + localpool=false + fi + + jobswitch="-jobname=$format" + case "$format" in + metafun) prgswitch=-progname=mpost;; + mptopdf|cont-??) prgswitch=-progname=context;; + *) prgswitch=-progname=$format;; + esac + + rm -f $fmtfile + + # Check for infinite recursion before running the iniTeX: + # We do this check only if we are running in mktexfmt mode + # otherwise double format definitions will create an infinite loop, too + $mktexfmtMode || mktexfmt_loop= + case :$mktexfmt_loop: in + *:"$format/$engine":*) + abort "Infinite recursion detected, giving up!" ;; + esac + mktexfmt_loop=$mktexfmt_loop:$format/$engine + export mktexfmt_loop + + verboseMsg "$progname: running \`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' ..." + + # run in a subshell to get a local effect of TEXPOOL manipulation: + ( + # If necessary, set TEXPOOL. Use absolute path, because of KPSE_DOT. + $localpool && { TEXPOOL="`pwd`:$TEXPOOL"; export TEXPOOL; } + verbose $engine -ini $tcxflag $jobswitch $prgswitch $texargs + ) /dev/null 2>&1 && + log_warning "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' possibly failed." + + # We don't want user-interaction for the following "mv" commands: + mv "$format.log" "$fulldestdir/$format.log" /dev/null" + + # No match before the loop: + setmatch false + + recreate_loop + + # Now check if there was at least one match: + getmatch || maybe_abort "no format depends on hyphen file \`$hyphenfile'" +} + +############################################################################### +# recreate_by_engine(enginename) +# recreate all formats that are based on enginename +############################################################################### +recreate_by_engine() +{ + enginename=$1 + + match_cmd="test x\$engine = x$enginename" + + # No match before the loop: + setmatch false + + recreate_loop + + # Now check if there was at least one match: + getmatch || maybe_abort "no format depends on engine \`$enginename'" +} + + + +############################################################################### +# show_hyphen_file(format) +# prints full name of the hyphenfile for format +# +# exit code: returns error code if the ini file is not installed or if +# the hyphen file cannot be found +############################################################################### +show_hyphen_file() +{ + fmtname=$1 + + find_info_for_name "$fmtname" || abort "no info for format \`$fmtname'" + if test "x$hyphenation" = x-; then + echo - + cleanup 0 + fi + find_hyphenfile "$format" "$hyphenation" \ + || abort "hyphenfile \`$hyphenation' not found" +} + +############################################################################### +# disablefmt(format) +# disables format in configuration file +############################################################################### +disablefmt() +{ + grep "^$1[ ]" $cnf_file >/dev/null || { (exit 0); return 0; } + + ed $cnf_file >/dev/null 2>&1 <<-eof + g/^$1[ ]/s/^/#! / + w + q +eof + (exit 0); return 0 +} + +############################################################################### +# enablefmt(format) +# enables format in configuration file +############################################################################### +enablefmt() +{ + grep "^#![ ]*$1[ ]" $cnf_file >/dev/null || { (exit 0); return 0; } + ed $cnf_file >/dev/null 2>&1 <<-eof + g/^#![ ]*$1[ ]/s/..[ ]*// + w + q +eof + (exit 0); return 0 +} + +main ${1+"$@"} +cleanup 0 diff --git a/Build/source/texk/texlive/tl_scripts/fontinst.1 b/Build/source/texk/texlive/tl_scripts/fontinst.1 new file mode 100644 index 00000000000..b907280d90d --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/fontinst.1 @@ -0,0 +1,45 @@ +.TH "fontinst" "1" "May 2000" "teTeX" "teTeX" +.PP +.SH "NAME" +fontinst \- utility to run TeX as fontinst +.PP +.SH "SYNOPSIS" +.PP +\fBfontinst\fP \fIpackage\fP +.PP +.SH "DESCRIPTION" +.PP +\fBfontinst\fP runs \fBtex\fP(1) with the \fB--progname\fP flag set to +pretend to be the program fontinst (affecting Karl Berry paths)\&. +.PP +Typing +.PP +\f(CWfontinst fontinst\&.sty\fP +.PP +will start \fBtex\fP(1) and give the user an interactive prompt +(\f(CW*\fP) where fontinst commands can be typed (such as +\f(CW\elatinfamily{ptm}{}\ebye\fP)\&. +.PP +.SH "SEE ALSO" +.PP +\fBtex\fP(1) +.PP +The fontinst manual, \fIfontinst\&.tex\fP\&. +.PP +Web page: +.PP +.SH "BUGS" +.PP +None known, but report any bugs found to tex-fonts@tug\&.org (mailing list)\&. +.PP +.SH "AUTHOR" +.PP +Thomas Esser + +.PP +This manual page was written by C\&.M\&. Connelly +, for +the Debian GNU/Linux system\&. It may be used by other distributions +without contacting the author\&. Any mistakes or omissions in the +manual page are my fault; inquiries about or corrections to this +manual page should be directed to me (and not to the primary author)\&. diff --git a/Build/source/texk/texlive/tl_scripts/fontinst.sh b/Build/source/texk/texlive/tl_scripts/fontinst.sh new file mode 100755 index 00000000000..7d1271517ad --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/fontinst.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +test -f /bin/sh5 && test -z "$RUNNING_SH5" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \ + && { RUNNING_SH5=true; export RUNNING_SH5; exec /bin/sh5 $0 ${1+"$@"}; } +unset RUNNING_SH5 + +test -f /bin/bsh && test -z "$RUNNING_BSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \ + && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; } +unset RUNNING_BSH + +# hack around a bug in zsh: +test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"' + +tex -progname=fontinst \&tex ${1+"$@"} diff --git a/Build/source/texk/texlive/tl_scripts/kpsetool.1 b/Build/source/texk/texlive/tl_scripts/kpsetool.1 new file mode 100644 index 00000000000..addd9b08344 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/kpsetool.1 @@ -0,0 +1,106 @@ +.TH "kpsetool" "1" "September 2000" "teTeX" "teTeX" +.PP +.SH "NAME" +kpsetool \- script to make teTeX-style \fBkpsetool\fP, +\fBkpsexpand\fP, and \fBkpsepath\fP available +.PP +.SH "SYNOPSIS" +.PP +\fBkpsetool \fP [ \fIOPTIONS\fP\&.\&.\&. ] \fICOMMAND\fP +.PP +\fBkpsexpand\fP [ \fIOPTIONS\fP\&.\&.\&. ] \fISTRING\fP +.PP +\fBkpsepath\fP [ \fIOPTIONS\fP\&.\&.\&. ] \fIPATHTYPE\fP +.PP +.SH "DESCRIPTION" +.PP +\fBkpsetool\fP is a Bourne shell script that makes a teTeX-style +\fBkpsetool\fP, \fBkpsexpand\fP, and \fBkpsepath\fP available\&. +\fBkpsetool\fP uses \fBweb2c\fP\'s (new) \fBkpsexpand\fP binary, so the +syntax for \fBkpsexpand\fP is incompatible with teTeX\'s as of version +0\&.4\&. +.PP +.SH "OPTIONS" +.PP +.IP "\fB-m\fP \fImode\fP" +set Metafont mode +.IP "\fB-n\fP \fIprogname\fP" +pretend to be \fIprogname\fP to kpathsea +.IP "\fB-p\fP" +act like \fBkpsepath\fP(1) +.IP "\fB-v\fP" +act like \fBkpsexpand\fP(1) +.IP "\fB-w\fP" +act like \fBkpsewhich\fP(1) +.PP +.SH "USAGE" +.PP +\fIPATHTYPE\fP can be +.PP +.IP "\fBbase\fP" +Metafont memory dump +.IP "\fBbib\fP" +BibTeX bibliography source +.IP "\fBbst\fP" +BibTeX style files +.IP "\fBcnf\fP" +Kpathsea runtime configuration files +.IP "\fBdvips_config\fP" +dvips config files +.IP "\fBdvips_header\fP" +dvips header files +.IP "\fBfmt\fP" +TeX memory dump +.IP "\fBgf\fP" +generic font bitmap +.IP "\fBmem\fP" +MetaPost memory dump +.IP "\fBmf\fP" +Metafont source +.IP "\fBmfpool\fP" +Metafont program strings +.IP "\fBmp\fP" +MetaPost source +.IP "\fBmppool\fP" +MetaPost program strings +.IP "\fBmpsupport\fP" +MetaPost support files +.IP "\fBpict\fP" +Other kinds of figures +.IP "\fBpk\fP" +packed bitmap font +.IP "\fBtex\fP" +TeX source +.IP "\fBtexpool\fP" +TeX program strings +.IP "\fBtfm\fP" +TeX font metrics +.IP "\fBtroff_font\fP" +troff fonts +.IP "\fBvf\fP" +virtual font +.PP +.SH "SEE ALSO" +.PP +\fBkpsewhich\fP(1) +.PP +\fIKpathsea: A library for path searching\fP (info or DVI file) +.PP +Web page: +.PP +.SH "BUGS" +.PP +None known, but report any bugs found to (mailing list)\&. +.PP +.SH "AUTHOR" +.PP +\fBkpsetool\fP was written by Thomas Esser + in March, 1997\&. \fBkpsetool\fP +is in the public domain\&. +.PP +This manual page was written by C\&.M\&. Connelly +, for +the Debian GNU/Linux system\&. It may be used by other distributions +without contacting the author\&. Any mistakes or omissions in the +manual page are my fault; inquiries about or corrections to this +manual page should be directed to me (and not to the primary author)\&. diff --git a/Build/source/texk/texlive/tl_scripts/kpsetool.sh b/Build/source/texk/texlive/tl_scripts/kpsetool.sh new file mode 100755 index 00000000000..463097fd4a9 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/kpsetool.sh @@ -0,0 +1,118 @@ +#!/bin/sh + +# kpsetool. Script to make teTeX-style kpsetool, kpsexpand and kpsepath +# available. Web2C's kpsewhich offers a superset of the functionality. +# For compatibilty with old versions of teTeX, this script provides the +# old command line interface of kpsetool, kpsexpand and kpsepath. All the +# real work is done inside Web2C's kpsewhich. +# Thomas Esser , Mar 1997, public domain. + +export PATH + +usage=" +Usage: kpsexpand [options] string +Usage: kpsetool -w [options] pathtype filename +Usage: kpsepath [options] pathtype + +Valid options are the following: + -n progname : pretend to be progname to kpathsea + -m mode : set Metafont mode + -w : locate files (similar to kpsewhich) + -p : act like kpsepath + -v : act like kpsexpand + +Valid pathtypes are: + gf : generic font bitmap + pk : packed bitmap font + base : Metafont memory dump + bib : BibTeX bibliography source + bst : BibTeX style files + cnf : Kpathsea runtime configuration files + fmt : TeX memory dump + mem : MetaPost memory dump + mf : Metafont source + mfpool : Metafont program strings + mp : MetaPost source + mppool : MetaPost program strings + mpsupport : MetaPost support files + pict : Other kinds of figures + tex : TeX source + texpool : TeX program strings + tfm : TeX font metrics + vf : virtual font + dvips_config : dvips config files + dvips_header : dvips header files + troff_font : troff fonts +" + +action=kpsexpand +case $0 in + */kpsewhich) action=kpsewhich;; + */kpsepath) action=kpsepath;; +esac + +progname=`echo $0 | sed 's@.*/@@'` +flags='' + +while true; do + case x"$1" in + x-n) + if test $# = 1; then + echo "$progname: missing argument for -n." + echo "$usage"; exit 1 + else + flags="$flags -progname=$2"; shift; shift + fi;; + x-m) + if test $# = 1; then + echo "$progname: missing argument for -m." + echo "$usage"; exit 1 + else + flags="$flags -mode=$2"; shift; shift + fi;; + x-w) action=kpsewhich; shift;; + x-p) action=kpsepath; shift;; + x-v) action=kpsexpand; shift;; + *) break;; + esac +done + +case "$action" in + kpsewhich|kpsepath) + case "$1" in + gf) format='gf';; + pk) format='pk';; + base) format='.base';; + bib) format='.bib';; + bst) format='.bst';; + cnf) format='.cnf';; + fmt) format='.fmt';; + mem) format='.mem';; + mf) format='.mf';; + mfpool) format='.pool';; + mp) format='.mp';; + mppool) format='.pool';; + mpsupport) format='MetaPost support';; + pict) format='.eps';; + tex) format='.tex';; + texpool) format='.pool';; + tfm) format='.tfm';; + vf) format='.vf';; + dvips_config) format='dvips config';; + dvips_header) format='.pro';; + troff_font) format='Troff fonts';; + *) echo "$progname: $1: unknown format"; echo "$usage"; exit 1;; + esac + shift;; +esac + +case "$action" in + kpsewhich) + test $# = 1 || { echo "$progname: missing filename"; echo "$usage"; exit 1; } + kpsewhich $flags -format="$format" "$1";; + kpsepath) + kpsewhich $flags -show-path="$format";; + kpsexpand) + test $# = 1 || { echo "$progname: missing string"; echo "$usage"; exit 1; } + kpsewhich $flags -expand-var="$1";; +esac diff --git a/Build/source/texk/texlive/tl_scripts/kpsewhere.1 b/Build/source/texk/texlive/tl_scripts/kpsewhere.1 new file mode 100644 index 00000000000..76700ed33fe --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/kpsewhere.1 @@ -0,0 +1,50 @@ +.TH "kpsewhere" "1" "March 2004" "teTeX" "teTeX" +.PP +.SH "NAME" +kpsewhere \- Expanding \fBkpsewhich\fP to separately iterate over each +texmf tree listed in $TEXMF. +.PP +.SH "SYNOPSIS" +.PP +\fBkpsewhere \fP [ \fIkpsewhich-OPTIONS\fP\&.\&.\&. ] \fICOMMAND\fP +.PP +.SH "DESCRIPTION" +.PP +\fBkpsewhere\fP is an extension to \fBkpsewhich\fP (as \fBwhere\fP is +for \fBwhich\fP in tcsh). The intention is to provide a way to check +for conflicts/shadowed files. It will, however, only find \fBone\fP +file per TEXMF tree. +.PP +.SH "OPTIONS" +.PP +.IP "\fB-h|--help\fP" +show a short help message +.IP "\fB\&*\fP" +all other options are directly handed to kpsewhich +.PP +.SH "SEE ALSO" +.PP +\fBkpsewhich\fP(1) +.PP +\fIKpathsea: A library for path searching\fP (info or DVI file) +.PP +Web page: +.PP +.SH "BUGS" +.PP +None known, but report any bugs found to (mailing list)\&. +.PP +.SH "AUTHOR" +.PP +\fBkpsewhere\fP was written by Hans Fredrik Nordhaug +, additions by +Thomas Esser +, in 2003 and 2004\&. \fBkpsewhere\fP +is in the public domain\&. +.PP +This manual page was written by Frank Küster , +for the Debian GNU/Linux system\&. It is also in the public domain +and may be used and changed by others without contacting the author\&. +Any mistakes or omissions in the manual page are my fault; inquiries +about or corrections to this manual page should be directed to me (and +not to the primary author)\&. diff --git a/Build/source/texk/texlive/tl_scripts/kpsewhere.sh b/Build/source/texk/texlive/tl_scripts/kpsewhere.sh new file mode 100755 index 00000000000..51088ee80d6 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/kpsewhere.sh @@ -0,0 +1,63 @@ +#!/bin/sh +# +# Thomas Esser, Hans Fredrik Nordhaug, 2003, 2004. +# Public domain. +# +# kpsewhere is an extension to kpsewhich (as where is for which in tcsh). +# The intention is to provide a way to check for conflicts/shadowed +# files. +# +# Original version by Hans Fredrik Nordhaug +# +# Bugs / limitations: +# conflicts/shadowed files whithin each texmf tree are not found. +# + + +test -f /bin/sh5 && test -z "$RUNNING_SH5" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \ + && { RUNNING_SH5=true; export RUNNING_SH5; exec /bin/sh5 $0 ${1+"$@"}; } +unset RUNNING_SH5 + +test -f /bin/bsh && test -z "$RUNNING_BSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \ + && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; } +unset RUNNING_BSH + +export PATH + +help='Usage: kpsewhere [OPTION]... [FILENAME]... + Expanding kpsewhich to iterate over each texmf tree listed in $TEXMF + separately. + + See kpsewhich for help on options. + + --help show this help' + +options= +while + case $1 in + -h|-help|--help) + echo "$help" >&2 + exit 0;; + -*) options="${options} '${1}'";; + *) break;; + esac +do shift; done + +case $# in + 0) + echo "$help" >&2 + exit 1 + ;; +esac + +IFS=':' +for file +do + for path in `kpsewhich --expand-path='$TEXMF'` + do + eval TEXMF=\$path kpsewhich $options \"\$file\" + done +done +exit 0 diff --git a/Build/source/texk/texlive/tl_scripts/ps2frag.1 b/Build/source/texk/texlive/tl_scripts/ps2frag.1 new file mode 100644 index 00000000000..b572c5733c1 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/ps2frag.1 @@ -0,0 +1,41 @@ +.TH ps2frag 1 "Feb 95" TeXware +.SH NAME +ps2frag - obsolete shell script for the PSfrag system. +.SH IMPORTANT NOTICE +The new PSfrag system no longer requires the ps2frag script; instead, it +handles the processing entirely within TeX/LaTeX and DVIPS. I'm sure you +will agree that never needing to run ps2frag again is a nice convenience! +.P +However, there are two significant differences in the way this new version +of PSfrag works. Please make yourself aware of them: +.P +1) XDvi is no longer able to determine where your PSfrag replacements +should +go, so instead it lines them up in a vertical list to the left of the +figure. This allows you to confirm that they have been typeset properly, at +least. However, to confirm that PSfrag +.B positions +your replacements properly, you will have to view the PostScript +version of your file with a viewer like GhostView, or print it out. +This seems to be the +only disadvantage to the elimination of the pre-processing step. +.P +2) If you embed '\\tex' commands inside your figures, you now need to +explicitly _tell_ PSfrag to process these commands. To do so, use +\\usepackage[scanall]{psfrag} +instead of +\\usepackage{psfrag} +at the beginning of your LaTeX file. +.P +If you only use '\\tex' commands in a small number of figures, then a +more efficient might be to turn on '\\tex'-scanning only for those +figures. To do that, add the command '\\psfragscanon' immediately before +each relevant \\includegraphics or \\epsfbox command. +.P +.SH NOTES +See the PSfrag documentation for further information. +.SH "SEE ALSO" +dvips(1), gs(1), ghostview(1), latex(1) +.SH AUTHORS +.IP psfrag@rascals.stanford.edu +The PSfrag maintainer's mailing list. diff --git a/Build/source/texk/texlive/tl_scripts/ps2frag.sh b/Build/source/texk/texlive/tl_scripts/ps2frag.sh new file mode 100755 index 00000000000..b8e673be087 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/ps2frag.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +tty -s && { + echo + echo "Warning: the ps2frag script is not needed with this version of psfrag." + echo "Please read the manpage ps2frag(1) and the documentation of the" + echo "psfrag package." + echo +} >&2 + +exit 0 diff --git a/Build/source/texk/texlive/tl_scripts/pslatex.1 b/Build/source/texk/texlive/tl_scripts/pslatex.1 new file mode 100644 index 00000000000..c206596a6a0 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/pslatex.1 @@ -0,0 +1,44 @@ +.TH "pslatex" "1" "September 2000" "teTeX" "teTeX" +.PP +.SH "NAME" +pslatex \- utility to typeset LaTeX files using PostScript fonts +.PP +.SH "SYNOPSIS" +.PP +\fBpslatex\fP [\fILATEXARGS\fP] \fILATEXFILE\fP[\&.tex] +.PP +.SH "DESCRIPTION" +.PP +\fBpslatex\fP allows you to typeset a LaTeX source file using basic +Adobe Type 1 PostScript fonts (Times, Helvetica, and Courier) +\fIwithout\fP editing the file to load the necessary packages\&. +.PP +It takes any arguments that \fBlatex\fP(1) can take\&. +.PP +.SH "OPTIONS" +.PP +None\&. +.PP +.SH "FILES" +.PP +Many\&. See the readme file for \fIpslatex\&.sty\fP\&. +.PP +.SH "SEE ALSO" +.PP +\fBlatex\fP(1), \fI\fITEXMF\fP/latex/pslatex/00readme\&.txt\fP +.PP +.SH "BUGS" +.PP +None known\&. Report any found to the author\&. +.PP +.SH "AUTHOR" +.PP +\fBpslatex\fP was written by David Carlisle +\&. +.PP +This manual page was written by C\&.M\&. Connelly +, for +the Debian GNU/Linux system\&. It may be used by other distributions +without contacting the author\&. Any mistakes or omissions in the +manual page are my fault; inquiries about or corrections to this +manual page should be directed to me (and not to the primary author)\&. diff --git a/Build/source/texk/texlive/tl_scripts/pslatex.sh b/Build/source/texk/texlive/tl_scripts/pslatex.sh new file mode 100755 index 00000000000..4badef0ec12 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/pslatex.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# Copyright 1994 David Carlisle +# This file may be redistributed and/or modified under the terms of the +# LaTeX Project Public License distributed from CTAN archives in directory +# macros/latex/base/lppl.txt; either version 1 of the License, or (at +# your option) any later version. + +test -f /bin/sh5 && test -z "$RUNNING_SH5" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \ + && { RUNNING_SH5=true; export RUNNING_SH5; exec /bin/sh5 $0 ${1+"$@"}; } +unset RUNNING_SH5 + +test -f /bin/bsh && test -z "$RUNNING_BSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \ + && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; } +unset RUNNING_BSH + +# hack around a bug in zsh: +test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"' + +# we want to be able to use options to latex: +while :; do + case $1 in + -*) + latexoptions="$latexoptions \"$1\"" + shift;; + *) + break;; + esac +done + +echo +echo "*************************************" +echo "* Using LaTeX, with pslatex package *" +echo "*************************************" +echo + +# messing around with \PSLATEXTMP is for AUCTeX which calls +# documents via latex \nonstopmode \input{file} + +latex $latexoptions \ + "\AtBeginDocument{\RequirePackage{pslatex}}"\ + "\def\PSLATEXTMP{\futurelet\PSLATEXTMP\PSLATEXTMPB}"\ + "\def\PSLATEXTMPB{\ifx\PSLATEXTMP\nonstopmode\else\input\fi}"\ + "\PSLATEXTMP" ${1+"$@"} diff --git a/Build/source/texk/texlive/tl_scripts/rubibtex.1 b/Build/source/texk/texlive/tl_scripts/rubibtex.1 new file mode 100644 index 00000000000..0142072a769 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/rubibtex.1 @@ -0,0 +1,63 @@ +.TH "rubibtex" "1" "October 2000" "teTeX" "teTeX" +.PP +.SH "NAME" +rubibtex \- make a bibliography for (La)TeX using Russian +letters as item names +.PP +.SH "SYNOPSIS" +.PP +\fBrubibtex\fP \fIBASENAME\fP +.PP +.SH "DESCRIPTION" +.PP +\fBrubibtex\fP is used to run \fBbibtex\fP(1) on auxiliary files with +Russian characters in item names (citation keys)\&. It is part of the +T2 package\&. +.PP +\fBrubibtex\fP copies the auxiliary file to \fI/tmp\fP, uses +\fBsed\fP(1) to convert Cyrillic character commands to their 8-bit +ASCII equivalents; runs \fBbibtex\fP(1) on the modified file; and +finally moves the original auxiliary file back (overwriting the +modified file)\&. +.PP +\fBrubibtex\fP assumes that the \fBbibtex\fP(1) database (\f(CWbib\fP) +files are encoded with the KOI8-R encoding\&. +.PP +.SH "FILES" +.PP +.IP +.IP "\fIbasename\&.aux\fP" +LaTeX auxiliary file +.IP +.PP +.SH "BUGS" +.PP +None known, but report any bugs found to the authors\&. +.PP +.SH "COPYRIGHT" +.PP +The T2 package is Copyright 1997-1999 Werner Lemberg, Vladimir +Volovich and any individual authors listed elsewhere in package files\&. +.PP +It may be distributed under the conditions of the LaTeX Project Public +License, either version 1\&.1 of this license or (at your option) any +later version\&. +.PP +.SH "SEE ALSO" +.PP +\fBbibtex\fP(1), \fBsed\fP(1), +\&. +.PP +.SH "AUTHOR" +.PP +Werner Lemberg +, Vladimir Volovich +\&. +.PP +This manual page was written by C\&.M\&. Connelly +, for +the Debian GNU/Linux system\&. It may be used by other distributions +without contacting the author\&. Any mistakes or omissions in the +manual page are my fault; inquiries about or corrections to this +manual page should be directed to me (and not to the primary author)\&. +.PP diff --git a/Build/source/texk/texlive/tl_scripts/rubibtex.sh b/Build/source/texk/texlive/tl_scripts/rubibtex.sh new file mode 100755 index 00000000000..373e6e1194d --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/rubibtex.sh @@ -0,0 +1,110 @@ +#!/bin/sh + +# rubibtex, based on the original version contained in the t2 bundle. +# Thomas Esser, Public Domain. + +progname=rubibtex +tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/$progname.$$ +job=$1 +backup="$tmpdir/orig.aux" + +case $job in + "") + echo "usage: $progname file" >&2 + exit 1 +esac + +if test ! -f "$job.aux"; then + echo "$progname: file \`$job.aux' does not exist." >&2 + exit 1 +fi + +trap ' + rm -rf "$tmpdir" + exit 1 +' 1 2 3 7 13 15 +(umask 077; mkdir "$tmpdir") \ + || { echo "$progname: could not create directory \`$tmpdir'" >&2; exit 1; } + +cat <"$job.aux" >"$backup" || { + echo "$progname: could not create backup of file \`$job.aux' as \`$backup'." >&2 + rm -rf "$tmpdir" + exit 1 +} + +sed ' + /^\\citation/ { + s/\\IeC {\\CYRA }/á/g + s/\\IeC {\\CYRB }/â/g + s/\\IeC {\\CYRV }/÷/g + s/\\IeC {\\CYRG }/ç/g + s/\\IeC {\\CYRD }/ä/g + s/\\IeC {\\CYRE }/å/g + s/\\IeC {\\CYRYO }/³/g + s/\\IeC {\\CYRZH }/ö/g + s/\\IeC {\\CYRZ }/ú/g + s/\\IeC {\\CYRI }/é/g + s/\\IeC {\\CYRISHRT }/ê/g + s/\\IeC {\\CYRK }/ë/g + s/\\IeC {\\CYRL }/ì/g + s/\\IeC {\\CYRM }/í/g + s/\\IeC {\\CYRN }/î/g + s/\\IeC {\\CYRO }/ï/g + s/\\IeC {\\CYRP }/ð/g + s/\\IeC {\\CYRR }/ò/g + s/\\IeC {\\CYRS }/ó/g + s/\\IeC {\\CYRT }/ô/g + s/\\IeC {\\CYRU }/õ/g + s/\\IeC {\\CYRF }/æ/g + s/\\IeC {\\CYRH }/è/g + s/\\IeC {\\CYRC }/ã/g + s/\\IeC {\\CYRCH }/þ/g + s/\\IeC {\\CYRSH }/û/g + s/\\IeC {\\CYRSHCH }/ý/g + s/\\IeC {\\CYRHRDSN }/ÿ/g + s/\\IeC {\\CYRERY }/ù/g + s/\\IeC {\\CYRSFTSN }/ø/g + s/\\IeC {\\CYREREV }/ü/g + s/\\IeC {\\CYRYU }/à/g + s/\\IeC {\\CYRYA }/ñ/g + s/\\IeC {\\cyra }/Á/g + s/\\IeC {\\cyrb }/Â/g + s/\\IeC {\\cyrv }/×/g + s/\\IeC {\\cyrg }/Ç/g + s/\\IeC {\\cyrd }/Ä/g + s/\\IeC {\\cyre }/Å/g + s/\\IeC {\\cyryo }/£/g + s/\\IeC {\\cyrzh }/Ö/g + s/\\IeC {\\cyrz }/Ú/g + s/\\IeC {\\cyri }/É/g + s/\\IeC {\\cyrishrt }/Ê/g + s/\\IeC {\\cyrk }/Ë/g + s/\\IeC {\\cyrl }/Ì/g + s/\\IeC {\\cyrm }/Í/g + s/\\IeC {\\cyrn }/Î/g + s/\\IeC {\\cyro }/Ï/g + s/\\IeC {\\cyrp }/Ð/g + s/\\IeC {\\cyrr }/Ò/g + s/\\IeC {\\cyrs }/Ó/g + s/\\IeC {\\cyrt }/Ô/g + s/\\IeC {\\cyru }/Õ/g + s/\\IeC {\\cyrf }/Æ/g + s/\\IeC {\\cyrh }/È/g + s/\\IeC {\\cyrc }/Ã/g + s/\\IeC {\\cyrch }/Þ/g + s/\\IeC {\\cyrsh }/Û/g + s/\\IeC {\\cyrshch }/Ý/g + s/\\IeC {\\cyrhrdsn }/ß/g + s/\\IeC {\\cyrery }/Ù/g + s/\\IeC {\\cyrsftsn }/Ø/g + s/\\IeC {\\cyrerev }/Ü/g + s/\\IeC {\\cyryu }/À/g + s/\\IeC {\\cyrya }/Ñ/g + } +' <"$backup" >"$job.aux" + +bibtex "$job" + +cat "$backup" > "$job.aux" +rm -rf "$tmpdir" +exit 0 diff --git a/Build/source/texk/texlive/tl_scripts/rumakeindex.1 b/Build/source/texk/texlive/tl_scripts/rumakeindex.1 new file mode 100644 index 00000000000..0fb271841d0 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/rumakeindex.1 @@ -0,0 +1,63 @@ +.TH "rumakeindex" "1" "September 2000" "teTeX" "teTeX" +.PP +.SH "NAME" +rumakeindex \- process a LaTeX index using Russian Cyrillic +characters +.PP +.SH "SYNOPSIS" +.PP +\fBrumakeindex\fP \fIbasename\fP +.PP +.SH "DESCRIPTION" +.PP +\fBrumakeindex\fP is used to run \fBmakeindex\fP(1) on \f(CWidx\fP files +that use Russian characters\&. It is part of the T2 package\&. +.PP +\fBrumakeindex\fP runs \fBsed\fP(1) on the \f(CWidx\fP file to convert +Cyrillic character commands to 8-bit ASCII characters; pipes the +results through \fBmakeindex\fP(1); and then through \fBtr\fP(1) +to do some final conversions\&. The results are placed in a KOI8-R +encoded \f(CWind\fP file\&. +.PP +.SH "FILES" +.PP +.IP +.IP "\fIbasename\&.idx\fP" +LaTeX index entry file +.IP "\fIbasename\&.ilg\fP" +LaTeX index log file +.IP "\fIbasename\&.ind\fP" +LaTeX processed index file +.IP +.PP +.SH "BUGS" +.PP +None known, but report any bugs found to the authors\&. +.PP +.SH "COPYRIGHT" +.PP +The T2 package is Copyright 1997-1999 Werner Lemberg, Vladimir +Volovich and any individual authors listed elsewhere in package files\&. +.PP +It may be distributed under the conditions of the LaTeX Project Public +License, either version 1\&.1 of this license or (at your option) any +later version\&. +.PP +.SH "SEE ALSO" +.PP +\fBmakeindex\fP(1), \fBsed\fP(1), \fBtr\fP(1), +\&. +.PP +.SH "AUTHOR" +.PP +Werner Lemberg +, Vladimir Volovich +\&. +.PP +This manual page was written by C\&.M\&. Connelly +, for +the Debian GNU/Linux system\&. It may be used by other distributions +without contacting the author\&. Any mistakes or omissions in the +manual page are my fault; inquiries about or corrections to this +manual page should be directed to me (and not to the primary author)\&. +.PP diff --git a/Build/source/texk/texlive/tl_scripts/rumakeindex.sh b/Build/source/texk/texlive/tl_scripts/rumakeindex.sh new file mode 100755 index 00000000000..b7b0c072729 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/rumakeindex.sh @@ -0,0 +1,77 @@ +#!/bin/sh + +BASE=`basename "$1" .idx` +IDX=$BASE.idx +IND=$BASE.ind +ILG=$BASE.ilg + +sed ' +/^\\indexentry{/ { +s/\\IeC {\\CYRA }/¾/g +s/\\IeC {\\cyra }/¿/g +s/\\IeC {\\CYRB }/À/g +s/\\IeC {\\cyrb }/Á/g +s/\\IeC {\\CYRV }/Â/g +s/\\IeC {\\cyrv }/Ã/g +s/\\IeC {\\CYRG }/Ä/g +s/\\IeC {\\cyrg }/Å/g +s/\\IeC {\\CYRD }/Æ/g +s/\\IeC {\\cyrd }/Ç/g +s/\\IeC {\\CYRE }/È/g +s/\\IeC {\\cyre }/É/g +s/\\IeC {\\CYRYO }/Ê/g +s/\\IeC {\\cyryo }/Ë/g +s/\\IeC {\\CYRZH }/Ì/g +s/\\IeC {\\cyrzh }/Í/g +s/\\IeC {\\CYRZ }/Î/g +s/\\IeC {\\cyrz }/Ï/g +s/\\IeC {\\CYRI }/Ð/g +s/\\IeC {\\cyri }/Ñ/g +s/\\IeC {\\CYRISHRT }/Ò/g +s/\\IeC {\\cyrishrt }/Ó/g +s/\\IeC {\\CYRK }/Ô/g +s/\\IeC {\\cyrk }/Õ/g +s/\\IeC {\\CYRL }/Ö/g +s/\\IeC {\\cyrl }/×/g +s/\\IeC {\\CYRM }/Ø/g +s/\\IeC {\\cyrm }/Ù/g +s/\\IeC {\\CYRN }/Ú/g +s/\\IeC {\\cyrn }/Û/g +s/\\IeC {\\CYRO }/Ü/g +s/\\IeC {\\cyro }/Ý/g +s/\\IeC {\\CYRP }/Þ/g +s/\\IeC {\\cyrp }/ß/g +s/\\IeC {\\CYRR }/à/g +s/\\IeC {\\cyrr }/á/g +s/\\IeC {\\CYRS }/â/g +s/\\IeC {\\cyrs }/ã/g +s/\\IeC {\\CYRT }/ä/g +s/\\IeC {\\cyrt }/å/g +s/\\IeC {\\CYRU }/æ/g +s/\\IeC {\\cyru }/ç/g +s/\\IeC {\\CYRF }/è/g +s/\\IeC {\\cyrf }/é/g +s/\\IeC {\\CYRH }/ê/g +s/\\IeC {\\cyrh }/ë/g +s/\\IeC {\\CYRC }/ì/g +s/\\IeC {\\cyrc }/í/g +s/\\IeC {\\CYRCH }/î/g +s/\\IeC {\\cyrch }/ï/g +s/\\IeC {\\CYRSH }/ð/g +s/\\IeC {\\cyrsh }/ñ/g +s/\\IeC {\\CYRSHCH }/ò/g +s/\\IeC {\\cyrshch }/ó/g +s/\\IeC {\\CYRHRDSN }/ô/g +s/\\IeC {\\cyrhrdsn }/õ/g +s/\\IeC {\\CYRERY }/ö/g +s/\\IeC {\\cyrery }/÷/g +s/\\IeC {\\CYRSFTSN }/ø/g +s/\\IeC {\\cyrsftsn }/ù/g +s/\\IeC {\\CYREREV }/ú/g +s/\\IeC {\\cyrerev }/û/g +s/\\IeC {\\CYRYU }/ü/g +s/\\IeC {\\cyryu }/ý/g +s/\\IeC {\\CYRYA }/þ/g +s/\\IeC {\\cyrya }/ÿ/g +}' $IDX | makeindex -t $ILG | tr '¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' \ + 'áÁâÂ÷×çÇäÄåų£öÖúÚéÉêÊëËìÌíÍîÎïÏðÐòÒóÓôÔõÕæÆèÈãÃþÞûÛýÝÿßùÙøØüÜàÀñÑ' > $IND diff --git a/Build/source/texk/texlive/tl_scripts/tcfmgr b/Build/source/texk/texlive/tl_scripts/tcfmgr new file mode 100755 index 00000000000..e79be96f873 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/tcfmgr @@ -0,0 +1,386 @@ +#!/bin/sh +# $Id$ + +# invoke the right shell: + +test -f /bin/ksh && test -z "$RUNNING_KSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \ + && { RUNNING_KSH=true; export RUNNING_KSH; exec /bin/ksh $0 ${1+"$@"}; } +unset RUNNING_KSH + +test -f /bin/bsh && test -z "$RUNNING_BSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \ + && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; } +unset RUNNING_BSH + +export PATH + +# hack around a bug in zsh: +test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"' + +progname=tcfmgr + +abort() +{ + echo "$progname: $@." >&2 + (exit 1); exit 1 +} + +mktexupd() +{ + setupMktexupd + "$TFC_MKTEXUPD" "$@" >&2 +} + +# call mktexdir script, disable all features (to prevent sticky directories) +mktexdir() +{ + setupMktexDir + MT_FEATURES=none "$TFC_MKTEXDIR" "$@" >&2 +} + +setupMap() +{ + case $setupMapOK in + "") : ;; + *) (exit 0); return 0;; + esac + + case $TFC_MAP in + "") TFC_MAP=`(kpsewhich -progname=texconfig -format='other text files' tcfmgr.map) 2>/dev/null`;; + esac + + case $TFC_MAP in + "") abort "config file \`tcfmgr.map' (usually in \$TEXMFMAIN/texconfig) not found (ls-R missing?)";; + esac + + if test ! -f "$TFC_MAP"; then + abort "config file \`TFC_MAP' does not exist" + fi + setupMapOK=true +} + +setupTemp() +{ + case $setupTempOK in + "") : ;; + *) (exit 0); return 0;; + esac + + case $TFC_TEMP in + "") TFC_TEMP=${TEMPDIR-/tmp};; + esac + + if test ! -d "$TFC_TEMP"; then + abort "temp directory \`$TFC_TEMP' does not exist" + fi + + if test ! -w "$TFC_TEMP"; then + abort "temp directory \`$TFC_TEMP' is not writable" + fi + setupTempOK=true +} + +setupTexmfConfig() +{ + case $TFC_TEXMFCONFIG in + "") TFC_TEXMFCONFIG=`(kpsewhich -var-value=TEXMFCONFIG) 2>/dev/null`;; + *) (exit 0); return 0;; + esac + case $TFC_TEXMFCONFIG in + "") abort "variable \$TEXMFCONFIG is not defined in texmf.cnf";; + esac +} + +setupMktexDir() +{ + case $TFC_MKTEXDIR in + "") TFC_MKTEXDIR=`(kpsewhich --format='web2c files' mktexdir) 2>/dev/null`;; + esac + + case $TFC_MKTEXDIR in + "") abort "program mktexdir (usually in \$TEXMFMAIN/web2c) not found";; + esac +} + +setupMktexupd() +{ + case $TFC_MKTEXUPD in + "") TFC_MKTEXUPD=`(kpsewhich --format='web2c files' mktexupd) 2>/dev/null`;; + esac + + case $TFC_MKTEXUPD in + "") abort "program mktexupd (usually in \$TEXMFMAIN/web2c) not found";; + esac +} + +writableCheck() +{ + setupTexmfConfig + if test ! -d "$TFC_TEXMFCONFIG"; then + mktexdir "$TFC_TEXMFCONFIG" >/dev/null 2>&1 + if test ! -d "$TFC_TEXMFCONFIG"; then + msg="Directory TEXMFCONFIG=\`$TFC_TEXMFCONFIG' does not exist" + (exit 1); return 1 + fi + fi + + case "$relDir" in + "") get_info;; + esac + if test -f "$TFC_TEXMFCONFIG/$relDir/$TFC_FILE" \ + && test -w "$TFC_TEXMFCONFIG/$relDir/$TFC_FILE" + then + (exit 0); return 0 + fi + + if test -d "$TFC_TEXMFCONFIG/$relDir"; then + if test -w "$TFC_TEXMFCONFIG/$relDir"; then + (exit 0); return 0 + else + msg="Directory \`$TFC_TEXMFCONFIG/$relDir' is not writable" + (exit 1); return 1 + fi + else + # we assume that a "mkdir -p" would work if the top-level + # $TFC_TEXMFCONFIG is writable + if test -w "$TFC_TEXMFCONFIG"; then + (exit 0); return 0 + else + msg="Directory \`$TFC_TEXMFCONFIG' is not writable" + (exit 1); return 1 + fi + fi +} + +get_info() +{ + case "$TFC_FILE" in + "") abort "missing --file option or empty argument";; + esac + setupMap + # prepare + get info + IFS=$TAB + # set -- x `(awk '$1 == file' file=$TFC_FILE <$TFC_MAP) 2>/dev/null`; shift + set -- x `(grep "^$TFC_FILE[ ]" $TFC_MAP) 2>/dev/null`; shift + IFS=$STD_IFS + + # assign results + file="$1" + relDir="$2" + kpseFormat="$3" + kpseProgArg="$4" + + # sanity checks + case $file in + "") abort "no info for file \`$TFC_FILE' in map \`$TFC_MAP'";; + esac + + case $relDir in + -) abort "no known standard location for file \`$TFC_FILE' in map \`$TFC_MAP'";; + esac + + case $kpseProgArg in + -) kpseProgArg=kpsewhich;; + esac +} + +check_out() +{ + if $createEmptyFile; then + : + else + case "$orig" in + "") + get_info + orig=`(kpsewhich -format="$kpseFormat" -progname="$kpseProgArg" "$TFC_FILE") 2>/dev/null` + ;; + *) + test -f "$orig" || orig= + esac + + case $orig in + "") abort "file \`$TFC_FILE' not found";; + esac + fi + + # writableCheck needs to get a valid relDir, so it calls get_info if necessary + if writableCheck; then + : ok + else + cat >&2 < "$TFC_TEMP/$TFC_ID/in/$TFC_FILE" + > "$TFC_TEMP/$TFC_ID/out/$TFC_FILE") + else + cp "$orig" "$TFC_TEMP/$TFC_ID/in/$TFC_FILE" \ + || abort "copy \`$orig' -> \`$TFC_TEMP/$TFC_ID/in/$TFC_FILE' failed" + + cp "$orig" "$TFC_TEMP/$TFC_ID/out/$TFC_FILE" \ + || abort "copy \`$orig' -> \`$TFC_TEMP/$TFC_ID/out/$TFC_FILE' failed" + + chmod u+w "$TFC_TEMP/$TFC_ID/out/$TFC_FILE" + fi + + cat >"$TFC_TEMP/$TFC_ID/relDir" < "$TFC_TEMP/$TFC_ID/file" </dev/null`;; + esac + + for f in "$TFC_TEMP/$TFC_ID/relDir" "$TFC_TEMP/$TFC_ID/file" "$TFC_TEMP/$TFC_ID/in/$TFC_FILE" "$TFC_TEMP/$TFC_ID/out/$TFC_FILE"; do + if test ! -f "$f"; then + abort "Oops! file \`$f' does not exist" + fi + done + + if (cmp "$TFC_TEMP/$TFC_ID/in/$TFC_FILE" "$TFC_TEMP/$TFC_ID/out/$TFC_FILE") >/dev/null 2>&1; then + (exit 0); return 0 + fi + + setupTexmfConfig + relDir=`cat "$TFC_TEMP/$TFC_ID/relDir"` + if test ! -d "$TFC_TEXMFCONFIG/$relDir"; then + setupMktexDir + mktexdir "$TFC_TEXMFCONFIG/$relDir" || abort "could not create directory \`$TFC_TEXMFCONFIG/$relDir'" + fi + + if test -f "$TFC_TEXMFCONFIG/$relDir/$TFC_FILE"; then + needsLSRUpdate=false + test -w "$TFC_TEXMFCONFIG/$relDir/$TFC_FILE" || rm -f "$TFC_TEXMFCONFIG/$relDir/$TFC_FILE" + else + needsLSRUpdate=true + fi + + if test -f "$TFC_TEXMFCONFIG/$relDir/$TFC_FILE"; then + cat <"$TFC_TEMP/$TFC_ID/out/$TFC_FILE" >"$TFC_TEXMFCONFIG/$relDir/$TFC_FILE" || + abort "failed to write new file \`$TFC_TEXMFCONFIG/$relDir/$TFC_FILE'" + else + cp "$TFC_TEMP/$TFC_ID/out/$TFC_FILE" "$TFC_TEXMFCONFIG/$relDir/$TFC_FILE" || + abort "failed to copy \`$TFC_TEMP/$TFC_ID/out/$TFC_FILE' to \`$TFC_TEXMFCONFIG/$relDir/$TFC_FILE'" + chmod 644 "$TFC_TEXMFCONFIG/$relDir/$TFC_FILE" 2>/dev/null + fi + if $needsLSRUpdate; then + mktexupd "$TFC_TEXMFCONFIG/$relDir" "$TFC_FILE" + fi + echo "$TFC_TEXMFCONFIG/$relDir/$TFC_FILE" + (exit 0); return 0 +} + +find_file() +{ + get_info + kpsewhich -format="$kpseFormat" -progname="$kpseProgArg" "$TFC_FILE" +} + +help() +{ + cat </dev/null \ + && { RUNNING_KSH=true; export RUNNING_KSH; exec /bin/ksh $0 ${1+"$@"}; } +unset RUNNING_KSH + +test -f /bin/bsh && test -z "$RUNNING_BSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \ + && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; } +unset RUNNING_BSH + +export PATH + +# hack around a bug in zsh: +test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"' + +# the version string +version='$Id$' + +: ${PAGER=more} +progname=texconfig-dialog +tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/tcdtmp.$$ +log=$tmpdir/log +tmpmenu=$tmpdir/tmpmenu +needsCleanup=false + +############################################################################### +# cleanup() +# clean up the temp area and exit with proper exit status +############################################################################### +cleanup() +{ + rc=$1 + $needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \ + && { cd / && rm -rf "$tmpdir"; } + termCtl reset + (exit $rc); exit $rc +} + +############################################################################### +# setupTmpDir() +# set up a temp directory and a trap to remove it +############################################################################### +setupTmpDir() +{ + case $needsCleanup in + true) return;; + esac + + trap 'cleanup 1' 1 2 3 7 13 15 + needsCleanup=true + (umask 077; mkdir "$tmpdir") \ + || abort "could not create directory \`$tmpdir'" +} + +############################################################################### +# abort(errmsg) +# print `errmsg' to stderr and exit with error code 1 +############################################################################### +abort() +{ + echo "$progname: $1." >&2 + cleanup 1 +} + +logexec() +{ + (echo; echo ">>> Executing \`$@' <<<") >> $log + "$@" 2>&1 | tee -a $log +} + +############################################################################### +# runDialog(args, ...) +# execute the right dialog program with the right default parameters +############################################################################### +runDialog() +{ + if test -n "$DIALOG_PROG"; then + termCtl clear + $DIALOG_PROG --title "TeX setup utility" ${1+"$@"} + runDialogRc=$? + termCtl clear + else + abort "could not find dialog or whiptail program to run" + fi + (exit $runDialogRc) + return $runDialogRc +} + +############################################################################### +# findDialog(void) +# set DIALOG_PROG to the system dialog program, or the empty string. +############################################################################### +findDialog() +{ + for bin in whiptail dialog + do + binLoc=`texconfig findprog $bin` + case $binLoc in + "") DIALOG_PROG="";; + *) DIALOG_PROG=$binLoc; break;; + esac + done +} + +############################################################################### +# mktexdir(args) +# call mktexdir script, disable all features (to prevent sticky directories) +############################################################################### +mktexdir() +{ + MT_FEATURES=none "$TEXMFMAIN/web2c/mktexdir" "$@" >&2 +} + +############################################################################### +# termCtl(arg) +# some convenience utilities for terminal control +############################################################################### +termCtl() +{ + case $1 in + clear) + test -n "$NO_CLEAR" && return + tty >/dev/null 2>&1 && clear + ;; + reset) + test -n "$NO_CLEAR" && return + reset 2>/dev/null + stty sane 2>/dev/null + reset 2>/dev/null + termCtl clear + ;; + readln) + echo + echo "press return to continue..." + read a + ;; + esac +} + +############################################################################### +# menuMain(void) +# the main menu +############################################################################### +menuMain() +{ + cat <<-'eof' + The interactive texconfig utility will be started now. Make sure + your screen has at least 24 rows and 80 columns. If texconfig + crashes now, you can still set up your teTeX system using the + batch mode of texconfig. Try 'texconfig help' to get a list + of options. + + The interactive mode works best with a real vt100 terminal or + inside an xterm window. +eof + termCtl readln + + while :; do + logMessage='view logfile' + + runDialog \ + --menu " +Hint: all output of external commands (e.g. tex) is logged into +a file. You can look at this file using "LOG". If cursor keys make +trouble, you may have more luck with +/- and TAB. +" \ + 23 80 14 \ + EXIT 'exit' \ + PAPER 'default paper: A4 or letter (us)' \ + MODE 'default metafont mode and resolution' \ + REHASH 'rebuild filename databases' \ + FORMATS 'edit format definitions' \ + HYPHENATION 'customize hyphenation' \ + DVIPS 'dvips configuration' \ + FAQ 'view frequently asked questions + answers' \ + CONF 'show configuration' \ + LOG "$logMessage" \ + 2>"$tmpmenu" || break + + case `cat "$tmpmenu"` in + EXIT) + break + ;; + PAPER) + menuPaper + ;; + MODE) + menuMode + ;; + REHASH) + logexec texconfig rehash + termCtl readln + ;; + FORMATS) + texconfig formats + termCtl readln + ;; + HYPHENATION) + menuHyphenation + ;; + DVIPS) + menuDvips + ;; + FAQ) + texconfig faq + termCtl readln + ;; + CONF) + logexec texconfig conf + termCtl readln + ;; + LOG) + <"$log" eval $PAGER + termCtl readln + ;; + esac + done +} + +menuGetMode() +{ + # we need eval to get the command line right... :-( + eval \ + runDialog \ + --menu \"" +Chosse a mode to be used when metafont generates font bitmaps. The resolution is the most important point, but there might +be differences between modes of the same resolution. See the comments in the file modes.mf for more details. +\"" \ + 23 80 14 \ + `texconfig mode-list` 2>"$tmpmenu" +} + +menuMode() +{ + menuGetMode + mode=`cat "$tmpmenu"` + + if test -n "$mode"; then + logexec texconfig mode "$mode" + termCtl readln + fi +} + +menuDvips() +{ + menuDvipsDest=ps + + while :; do + case $menuDvipsDest in + ps) + menuDvipsPrinterOpt= + menuDvipsMsg=" +dvips GLOBAL section. Define the most common default settings (config.ps). +To define settings for a specific printer, first ADD a printer definition, +then CHANGE it. +" + ;; + *) + menuDvipsPrinterOpt="-P $menuDvipsDest" + menuDvipsMsg=" +dvips settings for printer $menuDvipsDest (config.$menuDvipsDest). Define +local settings for this printer. To switch back to global settings mode, +select GLOBAL. +" + ;; + esac + + runDialog \ + --menu "$menuDvipsMsg +You can use dvips for non PostScript printers, if you can setup your +printing system to convert PostScript to a format that your printer can +handle. Maybe, you can use GhostScript to do the conversion (if your +printer is supported)." \ + 23 80 9 \ + RETURN 'back to the main menu' \ + DEST 'define default destination of the generated Postscript' \ + MODE 'change metafont mode/resolution' \ + OFFSET 'shift output by some offset' \ + PAPER 'define the default paper' \ + GLOBAL 'change global settings (config.ps)' \ + CHANGE 'change printer settings (config.$PRINTER)' \ + ADD 'add a printer configuration' \ + DEL 'remove a printer configuration' \ + 2>"$tmpmenu" || break + + menuDvipsAns=`cat "$tmpmenu"` + case $menuDvipsAns in + RETURN) + break + ;; + DEST) + runDialog --inputbox "Enter the command to print. + +In general, you need a command like 'lpr' or 'lpr -Pfoo'. + +NOTE: If you just press return, printing will be disabled and the output saved to a file by default. +" 23 80 2>"$tmpmenu" + if test $? = 0; then + menuDvipsAns=`cat "$tmpmenu"` + case $menuDvipsAns in + "") + menuDvipsPrintOpt=- + ;; + *) + menuDvipsPrintOpt=$menuDvipsAns + ;; + esac + logexec texconfig dvips $menuDvipsPrinterOpt printcmd "$menuDvipsPrintOpt" + termCtl readln + fi + ;; + MODE) + menuGetMode + mode=`cat "$tmpmenu"` + + if test -n "$mode"; then + logexec texconfig dvips $menuDvipsPrinterOpt mode "$mode" + termCtl readln + fi + ;; + OFFSET) + runDialog --inputbox "Enter a dimension pair (a rightwards offset and a downwards +offset), e.g. 2mm,-0.5in (right 2mm and up .5in):" 23 80 2>"$tmpmenu"; menuDvipsAns=`cat "$tmpmenu"` + case $menuDvipsAns in + "") : ;; + *) + logexec texconfig dvips $menuDvipsPrinterOpt offset "$menuDvipsAns" + termCtl readln + ;; + esac + ;; + PAPER) + eval runDialog \ + --menu \'\\n\\nChoose the default papersize definition for dvips.\\n\\n\' \ + 23 80 8 `texconfig dvips paper-list` \ + 2>"$tmpmenu" + paper=`cat "$tmpmenu"` + if test -n "$paper"; then + logexec texconfig dvips paper "$paper" + termCtl readln + fi + ;; + GLOBAL) + menuDvipsDest=ps + ;; + CHANGE) + runDialog --inputbox "Printer name (for future settings of DEST / MODE / OFFSET)" 23 80 2>"$tmpmenu" + menuDvipsAns=`cat $tmpmenu` + case $menuDvipsAns in + "") : ;; + *) menuDvipsDest=$menuDvipsAns;; + esac + ;; + ADD) + runDialog --inputbox "Printer name (for printer to add)" 23 80 2>"$tmpmenu" + menuDvipsAns=`cat $tmpmenu` + case $menuDvipsAns in + "") : ;; + *) + logexec texconfig dvips add $menuDvipsAns + termCtl readln + ;; + esac + ;; + DEL) + runDialog --inputbox "Printer name (for printer to delete)" 23 80 2>"$tmpmenu" + menuDvipsAns=`cat $tmpmenu` + case $menuDvipsAns in + "") : ;; + *) + logexec texconfig dvips del $menuDvipsAns + termCtl readln + ;; + esac + ;; + esac + done +} + +menuPaper() +{ + runDialog \ + --menu " +Select your default paper format. +" \ + 23 80 14 \ + RETURN 'return to the main menu' \ + A4 'ISO A4 (210x297mm)' \ + LETTER 'US (8.5x11in)' 2>"$tmpmenu" + + p=`cat "$tmpmenu"` + case $p in + A4) + logexec texconfig paper a4 + termCtl readln + ;; + LETTER) + logexec texconfig paper letter + termCtl readln + ;; + esac +} + +menuHyphenation() +{ + runDialog \ + --menu " +Choose format to set up hyphenation for. +" \ + 23 80 14 \ + `texconfig hyphen-list | sed 's@\(.*\)@\1 \1@'` 2>"$tmpmenu" + p=`cat "$tmpmenu"` + case $p in + "") + return + ;; + *) + texconfig hyphen "$p" + termCtl readln + esac +} + +# main() + +case $1 in + help|--help) + cat <<-eof + Usage: $progname [--help|--version] +eof + exit 0 + ;; + --version) + cat <<-eof + $progname version $version. +eof + exit 0 + ;; +esac + + +: ${TEXMFCONFIG=`kpsewhich -var-value=TEXMFCONFIG`} +: ${TEXMFVAR=`kpsewhich -var-value=TEXMFVAR`} +: ${TEXMFMAIN=`kpsewhich -var-value=TEXMFMAIN`} +export TEXMFCONFIG TEXMFVAR TEXMFMAIN + +setupTmpDir +echo "$progname: started `date`" > $log +findDialog + +test -d "$TEXMFCONFIG" \ + || mktexdir "$TEXMFCONFIG" >/dev/null 2>&1 \ + || echo "$progname: directory \`$TEXMFCONFIG' (from TEXMFCONFIG variable) does not exist and cannot be created" >&2 + +canWriteConfig=false +if test -d "$TEXMFCONFIG"; then + if test -w "$TEXMFCONFIG"; then + canWriteConfig=true + else + echo "$progname: directory \`$TEXMFCONFIG' (from TEXMFCONFIG variable) is not writable." + echo "$progname: configuration data cannot be changed." >&2 + fi +fi + +test -d "$TEXMFVAR" \ + || mktexdir "$TEXMFVAR" >/dev/null 2>&1 \ + || echo "$progname: directory \`$TEXMFVAR' (from TEXMFVAR variable) does not exist and cannot be created" >&2 + +canWriteVardata=false +if test -d "$TEXMFVAR"; then + if test -w "$TEXMFVAR"; then + canWriteVardata=true + else + echo "$progname: directory \`$TEXMFVAR' (from TEXMFVAR variable) is not writable." + echo "$progname: cached variable runtime data files cannot be written." >&2 + fi +fi + +menuMain +cleanup 0 diff --git a/Build/source/texk/texlive/tl_scripts/texconfig-sys.sh b/Build/source/texk/texlive/tl_scripts/texconfig-sys.sh new file mode 100755 index 00000000000..dd58513a6ea --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/texconfig-sys.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# $Id$ + +# texconfig-sys: Thomas Esser, public domain. + +# wrapper script for texconfig with TEXMFVAR and TEXMFCONFIG set to +# TEXMFSYSVAR / TEXMFSYSCONFIG + +test -f /bin/ksh && test -z "$RUNNING_KSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \ + && { RUNNING_KSH=true; export RUNNING_KSH; exec /bin/ksh $0 ${1+"$@"}; } +unset RUNNING_KSH + +test -f /bin/bsh && test -z "$RUNNING_BSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \ + && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; } +unset RUNNING_BSH + +export PATH + +# hack around a bug in zsh: +test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"' + +v=`kpsewhich -var-value TEXMFSYSVAR` +c=`kpsewhich -var-value TEXMFSYSCONFIG` + +TEXMFVAR="$v" +TEXMFCONFIG="$c" +export TEXMFVAR TEXMFCONFIG + +exec texconfig ${1+"$@"} diff --git a/Build/source/texk/texlive/tl_scripts/texconfig.1 b/Build/source/texk/texlive/tl_scripts/texconfig.1 new file mode 100644 index 00000000000..8087f1e6dd1 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/texconfig.1 @@ -0,0 +1,215 @@ +.TH texconfig 1 "August 2011" "TeX Live" "TeX Live" +.SH NAME +texconfig \- configures teTeX or TeX Live +.LP +texconfig-sys \- configures teTeX or TeX Live system\-wide +.SH SYNOPSIS +.B texconfig +.LP +.B texconfig +[\fB commands\fR ...] +.LP +.B texconfig-sys +.SH DESCRIPTION +.I texconfig +allows one to configure and maintain TeX +in an easy and convenient manner, offering a series of dialog boxes to +the user. +.PP +The +.I tlmgr +program has subsumed this function for TeX Live. This program +is still supported, but the tlmgr interface is much more actively +developed and tested. +.PP +After choosing settings or options, the appropriate files +are changed automatically and the new settings are applied for the +user. If needed, copies of files in +.I TEXMFDIST +or +.I TEXMFMAIN +will be made in the user's +.I TEXMFCONFIG +tree. +.PP +.I texconfig +uses either the +.IR whiptail (1) +or +.IR dialog (1) +program to communicate with the user, so must be run in a terminal. +.PP +For making system-wide changes, which will apply to all users of TeX +(for example, default paper size and so on), run +.I texconfig-sys +instead. Changed or generated files will be placed in +.IR TEXMFSYSCONFIG . +(You may need to be root to do this.) +.PP +.I texconfig +also offers a non-interactive batch mode which can be accessed with +the following commands +.SH COMMANDS +Commands that accept further options usually display available options +if called without them. For example, +.B texconfig dvipdfm paper +will inform about valid paper settings. +.PP +.B +.IP conf +Display the system configuration. +.PP +.TP +.B dvipdfm paper [letter|legal|ledger|tabloid|a4|a3] +Set up dvipdfm to use papersize PAPER by default. +.TP +.B dvips add PRINTERNAME +Create a new (empty) configuration file +.I TEXMFCONFIG/dvips/config/config.PRINTERNAME. +This file can later be filled with the +.B mode, offset +or +.B printcmd +options +.TP +.B dvips del PRINTERNAME +Remove +.I config.PRINTERNAME +.TP +.B dvips mode +List available MetaFont modes. +.TP +.B dvips [-P PRINTER] mode MODE +Change the MetaFont mode to +.I MODE +for +.I PRINTER +or for all output files +.I (config.ps), +if no +.B -P +option is given. +.TP +.B dvips [-P PRINTER] offset x-OFFSET,y-OFFSET +Set printer offset for +.I PRINTER +or for all output files +.I (config.ps), +if no +.B -P +option is given. Offsets must be given with units, e.g. +.I 0pt,10pt +You can use testpage.tex from the LaTeX distribution to find these +numbers. +.TP +.B dvips [-P PRINTER] printcmd CMD +Set the printing command for +.I PRINTER +or for all output files +.I (config.ps), +if no +.B -P +option is given. Commands might be +.B lp +or +.B lpr. +See the description of the +.I o +option in +.B info dvips +or the +.I -O +option in +.B dvips(1). +.TP +.B faq +Display the list of Frequently Asked Questions about +.B teTeX +(and their answers). +.TP +.B font vardir DIR, font ro, font rw +.TP +.B formats +This command allows to edit +.B fmtutil.cnf(5) +and (re)creates any new or changed formats afterwards. +.TP +.B hyphen FORMAT +This command allows to edit the hyphenation configuration file for +formats that support this, and recreates the formats afterwards to +enable the new languages. Available formats are shown when no +.I FORMAT +is given. +.IP +Note that for formats that use LaTeX's +.I language.dat, + e.g. +.I (pdf)jadetex +and +.I latex +itself, this change is not persistent, since this file is a generated +file. You should not use this command in these cases, read +.B update-language(1) +for alternatives. +.TP +.B init [format] +Recreate +.I format +or all formats if none is given, and the font information. This is +the same as calling +.B fmtutil --byfmt format +or +.B fmtutil --all, +respectively, followed by +.B updmap. +.TP +.B mode-list +List available printer modes, together with the printers they were +developed for, and their DPI resolution +.TP +.B mode MODE +Set the default printer mode in +.I /etc/texmf/web2c/mktex.cnf +or the respective user file in +.I $TEXMFCONFIG/web2c +to +.B MODE. +.TP +.B paper [a4|letter] +Set the default papersize for +.B dvips, dvipdfm, pdftex +and +.B xdvi. +The set is restricted because not all programs understand all sizes. +.TP +.B pdftex paper [a4|letter] +Set the default paper size for +.B pdftex. +.TP +.B rehash +Call +.B mktexlsr. +.TP +.B xdvi paper PAPER +Set the default paper size for +.B xdvi. +The (long) list is available with +.B texconfig xdvi paper. + +.SH ENVIRONMENT +To let you change files, +.B texconfig +will open the editor specified in the VISUAL or EDITOR variables, or +.B sensible-editor +if both are unset. +.SH "SEE ALSO" +.IR whiptail (1), +.IR dialog (1), +.IR tlmgr (1), +.IR tex (1), +.IR mf (1), +.IR vi (1), +.IR EDITOR +environment variable. +.SH AUTHOR +Thomas Esser diff --git a/Build/source/texk/texlive/tl_scripts/texconfig.sh b/Build/source/texk/texlive/tl_scripts/texconfig.sh new file mode 100755 index 00000000000..c9cc73c8305 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/texconfig.sh @@ -0,0 +1,1432 @@ +#!/bin/sh + +# TeXConfig version 3.0 +# Originally written by Thomas Esser. Public domain. +# Now maintained as part of TeX Live; correspondence to tex-live@tug.org. + +# invoke the right shell: + +test -f /bin/ksh && test -z "$RUNNING_KSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \ + && { RUNNING_KSH=true; export RUNNING_KSH; exec /bin/ksh $0 ${1+"$@"}; } +unset RUNNING_KSH + +test -f /bin/bsh && test -z "$RUNNING_BSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \ + && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; } +unset RUNNING_BSH + +export PATH + +# hack around a bug in zsh: +test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"' + +# initializations... +progname=texconfig + +# the version string +version='$Id$' + +envVars=" + AFMFONTS BIBINPUTS BSTINPUTS CMAPFONTS CWEBINPUTS ENCFONTS GFFONTS + GLYPHFONTS INDEXSTYLE LIGFONTS MFBASES MFINPUTS MFPOOL MFTINPUTS + MISCFONTS MPINPUTS MPMEMS MPPOOL MPSUPPORT OCPINPUTS OFMFONTS + OPENTYPEFONTS OPLFONTS OTPINPUTS OVFFONTS OVPFONTS PDFTEXCONFIG PKFONTS + PSHEADERS SFDFONTS T1FONTS T1INPUTS T42FONTS TEXBIB TEXCONFIG TEXDOCS + TEXFONTMAPS TEXFONTS TEXFORMATS TEXINDEXSTYLE TEXINPUTS TEXMFCNF + TEXMFDBS TEXMFINI TEXMFSCRIPTS TEXPICTS TEXPKS TEXPOOL TEXPSHEADERS + TEXSOURCES TFMFONTS TRFONTS TTFONTS VFFONTS WEB2C WEBINPUTS +" +tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/tctmp.$$ +needsCleanup=false +lastUpdatedFile= + +# +############################################################################### +# setupFMT(void) - find a suitable version of fmt / adjust +# +setupFMT() +{ + case $FMT in + "") + FMT=fmt + test ! -x /bin/fmt && test ! -f /usr/bin/fmt && + { test -x /bin/adjust || test -x /usr/bin/adjust; } && FMT=adjust + ;; + *) + return + ;; + esac +} + +############################################################################### +# myFmt(args) - run $FMT +# +myFmt() +{ + setupFMT + $FMT ${1+"$@"} +} + +############################################################################### +# echoShowVariable(args ...) +# show environment variables which names are as args and their values +# +echoShowVariable() +{ + for esv + do + var=$esv + eval val=\"\${$var+=}\${$var- is unset}\" + echo "$var$val" + done | grep -v 'is unset$' +} + +############################################################################### +# echoShowKpseVariable(args ...) +# show kpathsea variables which names are as args and their values +# +echoShowKpseVariable() +{ + for eskv + do + var=$eskv + val=`kpsewhich -var-value="$eskv"` + echo "$var=$val" + done +} + +############################################################################### +# echoLocateBinary(args ...) - show where programs actually exist +# +echoLocateBinary() +{ + for elb + do + elbLoc=`checkForBinary "$elb"` + if test -n "$ELB_PATH_ONLY"; then + test -n "$elbLoc" && echo "$elbLoc" + else + case $elbLoc in + "") echo "$elb: not found";; + *) echo "$elb: $elbLoc";; + esac + fi + done +} + +############################################################################### +# echoLocateCfgfile(args ...) - show where files actually exist +# +echoLocateCfgfile() +{ + for elc + do + case $elc in + texmf.cnf) elcLoc=`kpsewhich $elc`;; + *) elcLoc=`tcfmgr --cmd find --file "$elc"`;; + esac + case $elcLoc in + "") echo "$elc: not found";; + *) echo "$elcLoc";; + esac + done +} + +############################################################################### +# checkForBinary(prog) - echo full path of prog +# +checkForBinary() +{ + cfbBinary=$1 + + OLDIFS=$IFS + IFS=: + set x `echo "$PATH" | sed 's/^:/.:/; s/:$/:./; s/::/:.:/g'`; shift + found=false + for pathElem + do + case $pathElem in + "") continue;; + *) test -f "$pathElem/$cfbBinary" && { echo "$pathElem/$cfbBinary"; found=true; break; } + esac + done + IFS=$OLDIFS + case $found in + true) (exit 0); return 0;; + false) (exit 1); return 1;; + esac +} + +############################################################################### +# cleanup() - clean up the temp area and exit with proper exit status +# +cleanup() +{ + rc=$1 + $needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \ + && { cd / && rm -rf "$tmpdir"; } + (exit $rc); exit $rc +} + +############################################################################### +# setupTmpDir() - set up a temp directory and a trap to remove it +# +setupTmpDir() +{ + case $needsCleanup in + true) return;; + esac + + trap 'cleanup 1' 1 2 3 7 13 15 + needsCleanup=true + (umask 077; mkdir "$tmpdir") \ + || abort "could not create directory \`$tmpdir'" +} + +############################################################################### +# setupTexmfmain() - get value for MT_TEXMFMAIN (with caching) +# +setupTexmfmain() +{ + case $MT_TEXMFMAIN in + "") MT_TEXMFMAIN=`kpsewhich -var-value=TEXMFMAIN`;; + *) return;; + esac +} + +############################################################################### +# setupTexmfmain() - get value for MT_TEXMFDIST (with caching) +# +setupTexmfdist() +{ + case $MT_TEXMFDIST in + "") MT_TEXMFDIST=`kpsewhich -var-value=TEXMFDIST`;; + *) return;; + esac +} + +############################################################################### +# setupTexmfvar() - get value for MT_TEXMFVAR (with caching) +# +setupTexmfvar() +{ + case $MT_TEXMVAR in + "") MT_TEXMVAR=`kpsewhich -var-value=TEXMFVAR`;; + *) return;; + esac +} + +############################################################################### +# setupSystexmf() - get value for MT_SYSTEXMF (with caching) +# +setupSystexmf() +{ + case $MT_SYSTEXMF in + "") MT_SYSTEXMF=`kpsewhich -var-value=SYSTEXMF`;; + *) return;; + esac +} + +############################################################################### +# abort(errmsg) +# print `errmsg' to stderr and exit with error code 1 +# +abort() +{ + echo "$progname: $1." >&2 + cleanup 1 +} + +############################################################################### +# mktexdir(args) +# call mktexdir script, disable all features (to prevent sticky directories) +# +mktexdir() +{ + setupTexmfmain + MT_FEATURES=none "$MT_TEXMFMAIN/web2c/mktexdir" "$@" >&2 +} + +############################################################################### +# tcfmgr(args) - call tcfmgr script +# +tcfmgr() +{ + setupTexmfmain + "$MT_TEXMFMAIN/texconfig/tcfmgr" "$@" +} + +############################################################################### +# mktexupd(args) - call mktexupd script +# +mktexupd() +{ + setupTexmfmain + "$MT_TEXMFMAIN/web2c/mktexupd" "$@" +} + +############################################################################### +# getRelDir(file) +# matches file against SYSTEXMF. Returns relative directory of file within +# a texmf tree in variable relPart. +# +getRelDir() +{ + file=$1 + relPart= + + setupSystexmf + OLDIFS=$IFS + IFS=' +' + set x `echo "$MT_SYSTEXMF" | tr : ' +'`; shift + IFS=$OLDIFS + + # now loop over all components of SYSTEXMF + for dir + do + test -n "$dir" || continue + case "$file" in + $dir/*) + relPart=`echo "$file" | sed "s%$dir/*%%"` + break + ;; + esac + done + + # now check for success / failure + case $relPart in + ""|$file) + # empty or full filename -> getRelDir failed! + (exit 1); return 1 + ;; + *) + # relPart should just have the "dirname" part: + relPart=`echo "$relPart" | sed 's%/*[^/]*$%%'` + (exit 0); return 0 + ;; + esac +} + +############################################################################### +# configReplace(file pattern line) +# The first line in file that matches pattern gets replaced by line. +# line will be added at the end of the file if pattern does not match. +# +configReplace() +{ + configReplaceFile=$1; configReplacePat=$2; configReplaceLine=$3 + + if grep "$configReplacePat" "$configReplaceFile" >/dev/null; then + ed "$configReplaceFile" >/dev/null 2>&1 <<-eof + /$configReplacePat/c + $configReplaceLine + . + w + q +eof + else + echo "$configReplaceLine" >> $configReplaceFile + fi +} + +############################################################################### +# fmgrConfigReplace (file regex value) +# replaces line matching regex by value in file +# +fmgrConfigReplace() +{ + fmgrConfigReplaceChanged=false + + moreArgs="" + while + case $1 in + --*) moreArgs="$moreArgs $1 $2";; + *) break;; + esac + do shift; shift; done + fmgrConfigReplaceFile=$1 + fmgrConfigReplaceRegex=$2 + fmgrConfigReplaceValue=$3 + + setupTmpDir + co=`tcfmgr $moreArgs --tmp $tmpdir --cmd co --file $fmgrConfigReplaceFile` + if test $? != 0; then + echo "$progname: fmgrConfigReplace co failed for \`$fmgrConfigReplaceFile'" >&2 + (exit 1); return 1 + fi + set x $co; shift + fmgrConfigReplaceID=$1; fmgrConfigReplaceCfgFile=$3; fmgrConfigReplaceOrigFile=$4 + configReplace "$fmgrConfigReplaceCfgFile" "$fmgrConfigReplaceRegex" "$fmgrConfigReplaceValue" + ci=`tcfmgr --tmp $tmpdir --cmd ci --id "$fmgrConfigReplaceID"` + if test $? != 0; then + echo "$progname: fmgrConfigReplace ci failed for \`$fmgrConfigReplaceFile'" >&2 + (exit 1); return 1 + fi + case $ci in + "") :;; + $lastUpdatedFile) + fmgrConfigReplaceChanged=true;; + *) echo "$progname: updated configuration saved as file \`$ci'" >&2 + fmgrConfigReplaceChanged=true + lastUpdatedFile=$ci;; + esac + (exit 0); return 0 +} + +############################################################################### +# setupDvipsPaper(paper) +# rearranges config.ps to make paper the first paper definition +# +setupDvipsPaper() +{ + setupDvipsPaperChanged=false + setupDvipsPaperFile=config.ps + setupDvipsPaperDftPaper=$1 + + setupTmpDir + co=`tcfmgr --tmp $tmpdir --cmd co --file $setupDvipsPaperFile` + if test $? != 0; then + echo "$progname: setupDvipsPaper co failed for \`$setupDvipsPaperFile'" >&2 + (exit 1); return 1 + fi + set x $co; shift + setupDvipsPaperID=$1; setupDvipsPaperCfgFile=$3; setupDvipsPaperOrigFile=$4 + + ed "$setupDvipsPaperCfgFile" > /dev/null 2>&1 <<-eof + /@ /ka + \$a + @ + . + /@ $setupDvipsPaperDftPaper /;/@ /-1m'a-1 + \$d + w + q +eof + + ci=`tcfmgr --tmp $tmpdir --cmd ci --id "$setupDvipsPaperID"` + if test $? != 0; then + echo "$progname: setupDvipsPaper ci failed for \`$setupDvipsPaperFile'" >&2 + (exit 1); return 1 + fi + case $ci in + "") :;; + $lastUpdatedFile) + setupDvipsPaperChanged=true;; + *) echo "$progname: updated configuration saved as file \`$ci'" >&2 + setupDvipsPaperChanged=true + lastUpdatedFile=$ci;; + esac + (exit 0); return 0 +} + +############################################################################### +# setupModesMfFile(void) - find modes.mf file (with caching) +# +setupModesMfFile() +{ + case $modesMfFile in + "") + modesMfFile=`tcfmgr --cmd find --file modes.mf` + ;; + *) + return + ;; + esac +} + +############################################################################### +# locateConfigPsFile(void) - find config.ps file (with caching) +# +locateConfigPsFile() +{ + case $configPsFile in + "") + configPsFile=`tcfmgr --cmd find --file config.ps` + ;; + *) + return + ;; + esac +} + +############################################################################### +# listMfModes(file) - list modes from modes.mf file +# +listMfModes() +{ + grep mode_def "$modesMfFile" | + sed -e "s/mode_def //" \ + -e "s/ .*%[^ ]* / '/" \ + -e "s/\$/' /" | + egrep -v "^(help|%)" | sort +} + +############################################################################### +# listDvipsPapers(void) - list paper definitions from config.ps +# +listDvipsPapers() +{ + grep '@ ' $configPsFile | sed "s/..//;s/ / '/;s/\$/' /" +} + +############################################################################### +# getFormatsForHyphen(void) +# list all formats which have customizable hyphenation +# +getFormatsForHyphen() +{ + fmtutil --catcfg | awk '$3 != "-" {print $1}' | sort +} + +############################################################################### +# getRes(mode) - print resolution (both X and Y axis) to metafont mode +# +getRes() +{ + getResMode=$1 + ( + cd $tmpdir + cat >mftmp.mf <<-'eof' + let myexit = primitive_end_; + mode_setup; + string xdpi; + xdpi := decimal round pixels_per_inch; + message "XDPI = " & xdpi; + string ydpi; + ydpi := decimal round (pixels_per_inch * aspect_ratio); + message "YDPI = " & ydpi; + fontmaking := 0; + myexit; +eof + mf '\mode='"$getResMode"'; \input ./mftmp' &2; rc=1;; + *) + echo "$progname: unknown PAPER \`$3' given as argument for \`$progname dvipdfm paper'" >&2 + echo "$progname: try \`$progname dvipdfm paper' for help" >&2 + rc=1 ;; + esac ;; + # texconfig dvipdfm "" + "") + echo "$help" >&2; rc=1 ;; + # texconfig dvipdfm + *) + echo "$progname: unknown option \`$2' given as argument for \`$progname dvipdfm'" >&2 + echo "$progname: try \`$progname dvipdfm' for help" >&2 + rc=1 + ;; + esac + ;; + + # texconfig dvipdfmx + dvipdfmx) + help="Usage: $progname dvipdfmx paper PAPER + +Valid PAPER settings: + letter legal ledger tabloid a4 a3" + case $2 in + # texconfig dvipdfmx paper + paper-list) + for p in letter legal ledger tabloid a4 a3; do echo $p; done + ;; + paper) + case $3 in + letter|legal|ledger|tabloid|a4|a3) + fmgrConfigReplace dvipdfmx.cfg '^p' "p $3";; + "") echo "$help" >&2; rc=1;; + *) + echo "$progname: unknown PAPER \`$3' given as argument for \`$progname dvipdfmx paper'" >&2 + echo "$progname: try \`$progname dvipdfmx paper' for help" >&2 + rc=1 ;; + esac ;; + # texconfig dvipdfmx "" + "") + echo "$help" >&2; rc=1 ;; + # texconfig dvipdfmx + *) + echo "$progname: unknown option \`$2' given as argument for \`$progname dvipdfmx'" >&2 + echo "$progname: try \`$progname dvipdfmx' for help" >&2 + rc=1 + ;; + esac + ;; + + # texconfig dvips + dvips) + shift + help="Usage: $progname dvips add PRINTER + $progname dvips del PRINTER + $progname dvips paper PAPER + $progname dvips [-P PRINTER] mode MODE + $progname dvips [-P PRINTER] offset OFFSET + $progname dvips [-P PRINTER] printcmd CMD" + case $1 in + -P) + case $2 in + "") + echo "$progname: missing arg for parameter -P" >&2 + rc=1; (exit $rc); return $rc + ;; + *) + otherPrinter=true + otherPrinterName=$2 + otherPrinterFile=`kpsewhich -format='dvips config' "config.$otherPrinterName"` + case $otherPrinterFile in + "") + echo "$progname: configuration file \`config.$otherPrinterName' for printer \`$otherPrinterName' not found" >&2 + rc=1; (exit $rc); return $rc + ;; + *) shift; shift;; + esac + ;; + esac + ;; + *) + otherPrinter=false + ;; + esac + case $otherPrinter in + true) + tcBatchDvipsPrinter=$otherPrinterName + moreFmgrArgs="--reldir dvips/config --infile $otherPrinterFile" + ;; + *) + tcBatchDvipsPrinter=ps + ;; + esac + case $1 in + add) + case $2 in + "") + echo "Usage: $progname dvips add PRINTER" >&2 + rc=1 + ;; + *) + printerName=$2 + pFile=`kpsewhich -format='dvips config' "config.$printerName"` + case $pFile in + "") + setupTmpDir + tcfRet=`tcfmgr --emptyinfile --reldir dvips/config --cmd co --tmp $tmpdir --file "config.$printerName"` + if test $? != 0; then + echo "$progname: failed to add new configuration file \`config.$printerName'" >&2 + rc=1 + else + set x $tcfRet; shift + tcBatchDvipsAddID=$1; tcBatchDvipsAddFile=$3 + echo "% file config.$printerName; added by texconfig" > "$tcBatchDvipsAddFile" + tcfRet=`tcfmgr --tmp $tmpdir --id "$tcBatchDvipsAddID" --cmd ci` + if test $? != 0; then + echo "$progname: failed to add new configuration file \`config.$printerName'" >&2 + rc=1 + else + echo "$progname: file $tcfRet added" >&2 + fi + fi + ;; + *) + echo "$progname: configuration file for printer \`$printerName' already exists (\`$pFile')" >&2 + rc=1 + ;; + esac + ;; + esac + ;; + del) + case $2 in + "") + echo "Usage: $progname dvips del PRINTER" >&2 + rc=1 + ;; + *) + printerName=$2 + pFile=`kpsewhich -format='dvips config' "config.$printerName"` + case $pFile in + "") + echo "$progname: configuration file for printer \`$printerName' (config.$printerName) not found" >&2 + rc=1 + ;; + *) + if rm "$pFile"; then + echo "$progname: file \`$pFile' removed" >&2 + else + echo "$progname: failed to remove file \`$pFile'" >&2 + rc=1 + fi + ;; + esac + ;; + esac + ;; + paper-list) + locateConfigPsFile + listDvipsPapers + ;; + paper) + case $2 in + "") + echo "Usage: $progname dvips paper PAPER" >&2 + echo >&2; echo "Valid PAPER settings:" >&2 + locateConfigPsFile + listDvipsPapers | sed 's@ .*@@; s@^@ @' | myFmt + rc=1 + ;; + *) + tcBatchDvipsPaper=$2 + locateConfigPsFile + case "$configPsFile" in + "") + echo "$progname: file config.ps not found" >&2; rc=1 + ;; + *) + if grep "@ $tcBatchDvipsPaper " $configPsFile >/dev/null 2>&1; then + setupDvipsPaper "$tcBatchDvipsPaper" + else + echo "$progname: paper \`$tcBatchDvipsPaper' not found in file \`$configPsFile'" >&2; rc=1 + fi + ;; + esac + ;; + esac + ;; + mode) + case $2 in + "") + echo "Usage: $progname dvips mode MODE + +Valid MODE settings:" + setupModesMfFile + listMfModes | sed 's@ .*@@; s@^@ @' | myFmt + rc=1 + ;; + *) + tcBatchDvipsMode=$2 + setupTmpDir + setupModesMfFile + if checkElemInList "$tcBatchDvipsMode" `listMfModes | sed 's@ .*@@'`; then + set x `getRes "$tcBatchDvipsMode"`; shift + resX=$1; resY=$2 + fmgrConfigReplace $moreFmgrArgs config.$tcBatchDvipsPrinter '^M' "M $tcBatchDvipsMode" + fmgrConfigReplace $moreFmgrArgs config.$tcBatchDvipsPrinter '^D' "D $resX" + fmgrConfigReplace $moreFmgrArgs config.$tcBatchDvipsPrinter '^X' "X $resX" + fmgrConfigReplace $moreFmgrArgs config.$tcBatchDvipsPrinter '^Y' "Y $resY" + else + echo "$progname: unknown MODE \`$tcBatchDvipsMode' given as argument for \`$progname dvips mode'" >&2 + echo "$progname: try \`$progname dvips mode' for help" >&2 + rc=1 + fi + ;; + esac + ;; + offset) + offset=$2 + case $offset in + "") + echo "Usage: $progname dvips offset OFFSET" + rc=1 + ;; + *) + fmgrConfigReplace $moreFmgrArgs config.$tcBatchDvipsPrinter '^O' "O $offset" + esac + ;; + printcmd) + printcmd=$2 + case $printcmd in + "") + echo "Usage: $progname dvips printcmd CMD" + rc=1 + ;; + -) + fmgrConfigReplace $moreFmgrArgs config.$tcBatchDvipsPrinter '^o' o + ;; + *) + fmgrConfigReplace $moreFmgrArgs config.$tcBatchDvipsPrinter '^o' "o |$printcmd" + ;; + esac + ;; + "") + echo "$help" >&2; rc=1 + ;; + *) + echo "$progname: unknown option \`$1' given as argument for \`$progname dvips'" >&2 + echo "$progname: try \`$progname dvips' for help" >&2 + rc=1 + ;; + esac + ;; + + 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 + ;; + + findprog) + shift + ELB_PATH_ONLY=1 echoLocateBinary "$@" + ;; + + # handle "texconfig font" + font) + help="Usage: $progname font vardir DIR + $progname font ro + $progname font rw + +The vardir option changes the VARTEXFONTS variable in the texmf.cnf file. + +The rw option makes the VARTEXFONTS directory (and subtrees pk, tfm, +source) world writable and sets the features appendonlydir:varfonts +in mktex.cnf. + +The ro option makes the VARTEXFONTS directory (and subtrees pk, tfm, +source) writable for the owner only and sets the feature texmfvar in +mktex.cnf. + +For more information about these \`features', consult the teTeX manual +(e.g. by running \`texdoc TETEXDOC')." + + case $2 in + vardir) + case $3 in + "") + echo "$help" >&2 + rc=1 + ;; + *) + tcBatchFontVardir=$3 + tfc=`kpsewhich texmf.cnf` + if test -n "$tfc"; then + if test -w "$tfc"; then + configReplace "$tfc" '^VARTEXFONTS' "VARTEXFONTS = $tcBatchFontVardir" + else + echo "$progname: setting up vardir failed. Reason: no permission to write file \`$tfc'" >&2 + rc=1 + fi + else + echo "$progname: setting up vardir failed. Reason: failed to find file texmf.cnf" >&2 + rc=1 + fi + ;; + esac + ;; + rw) + MT_VARTEXFONTS=`kpsewhich -var-value VARTEXFONTS` + if test -z "$MT_VARTEXFONTS"; then + echo "$progname: failed to set \`font rw'; reason: could not determine VARTEXFONTS variable." >&2; rc=1 + return + fi + test -d "$MT_VARTEXFONTS" || mktexdir "$MT_VARTEXFONTS" + if test ! -d "$MT_VARTEXFONTS"; then + echo "$progname: failed to set \`font rw'; reason: directory \`$MT_VARTEXFONTS' does not exist." >&2; rc=1 + return + fi + chmod 1777 "$MT_VARTEXFONTS" || { + echo "$progname: failed to modify permissions in \`$MT_VARTEXFONTS'." >&2; rc=1 + return; + } + ( + cd "$MT_VARTEXFONTS" || exit + echo "$progname: modifying permissions in \`$MT_VARTEXFONTS' ..." >&2 + for d in pk tfm source; do + test -d "$d" && find $d -type d -exec chmod 1777 '{}' \; + done + echo "$progname: all permissions set." >&2 + ) + setupTmpDir + fmgrConfigReplace mktex.cnf '^: ..MT_FEATURES=' ": \${MT_FEATURES=appendonlydir:varfonts}" + ;; + ro) + MT_VARTEXFONTS=`kpsewhich -var-value VARTEXFONTS` + if test -z "$MT_VARTEXFONTS"; then + echo "$progname: failed to set \`font ro'; reason: could not determine VARTEXFONTS variable." >&2; rc=1 + return + fi + test -d "$MT_VARTEXFONTS" || mktexdir "$MT_VARTEXFONTS" + if test ! -d "$MT_VARTEXFONTS"; then + echo "$progname: failed to set \`font ro'; reason: directory \`$MT_VARTEXFONTS' does not exist." >&2; rc=1 + return + fi + chmod 755 "$MT_VARTEXFONTS" || { + echo "$progname: failed to modify permissions in \`$MT_VARTEXFONTS'." >&2; rc=1 + return; + } + ( + cd "$MT_VARTEXFONTS" || exit + echo "$progname: modifying permissions in \`$MT_VARTEXFONTS' ..." >&2 + for d in pk tfm source; do + test -d "$d" && find "$d" -type d -exec chmod 755 '{}' \; + done + echo "$progname: all permissions set." >&2 + ) + setupTmpDir + fmgrConfigReplace mktex.cnf '^: ..MT_FEATURES=' ": \${MT_FEATURES=texmfvar}" + ;; + "") echo "$help" >&2; rc=1;; + *) echo "$progname: unknown option \`$2' given as argument for \`$progname font'" >&2 + echo "$progname: try \`$progname font' for help" >&2 + rc=1 + ;; + esac + ;; + + formats) + cat >&2 <&2 + fmtutil --catcfg > $tmpdir/pre + fmtutil --edit + echo "$progname: analyzing new configuration..." >&2 + fmtutil --catcfg > $tmpdir/post + + if cmp $tmpdir/pre $tmpdir/post >/dev/null 2>&1; then + echo "$progname: no new/updated formats available ..." >&2 + else + echo "$progname: updating formats ..." >&2 + comm -13 $tmpdir/pre $tmpdir/post > $tmpdir/addOrChange + for i in `awk '{print $1}' $tmpdir/addOrChange`; do + fmtutil --byfmt "$i" || rc=1 + done + texlinks --multiplatform || rc=1 + fi + ;; + + help|--help|-h) + echo "$help" + ;; + + # "hyphen FORMAT" + hyphen) + cat >&2 <&2; rc=1 + ;; + *) + if checkElemInList "$tcBatchHyphenFormat" $formatsForHyphen; then + + tcBatchHyphenFile=`fmtutil --showhyphen "$tcBatchHyphenFormat"` + case $tcBatchHyphenFile in + "") + echo "$progname: could not find hyphen setup file for format \`$tcBatchHyphenFormat'" >&2 + rc=1 + return + ;; + esac + + getRelDir "$tcBatchHyphenFile" + case $relPart in + "") + # edit tcBatchHyphenFile directly + tcBatchHFID= + setupTmpDir + tcBatchHFEdit=$tcBatchHyphenFile + tcBatchHFOrig=$tmpdir/hforig + cp "$tcBatchHyphenFile" "$tcBatchHFOrig" + ;; + *) + # use tcfmgr + tcBatchHyphenFileBasename=`echo "$tcBatchHyphenFile" | sed 's@.*/@@'` + setupTmpDir + co=`tcfmgr --tmp $tmpdir --cmd co --file "$tcBatchHyphenFileBasename" --reldir "$relPart" --infile "$tcBatchHyphenFile"` + if test $? != 0; then + echo "$progname: failed to check out file \`$tcBatchHyphenFile'" >&2 + rc=1 + return 1 + else + set x $co; shift + tcBatchHFID=$1; tcBatchHFEdit=$3; tcBatchHFOrig=$4 + fi + ;; + esac + ${VISUAL-${EDITOR-vi}} "$tcBatchHFEdit" + if cmp "$tcBatchHFEdit" "$tcBatchHFOrig" >/dev/null 2>&1; then + echo "$progname: configuration unchanged." >&2 + else + case $tcBatchHFID in + "") + tcBatchHFOut=$tcBatchHFEdit + echo "$progname: updated configuration saved as file \`$tcBatchHFOut'" >&2 + lastUpdatedFile=$ci + ;; + *) + ci=`tcfmgr --tmp $tmpdir --cmd ci --id "$tcBatchHFID"` + if test $? != 0; then + echo "$progname: failed to check in file \`$tcBatchHyphenFileBasename'" >&2 + rc=1 + return + else + tcBatchHFOut=$ci + echo "$progname: updated configuration saved as file \`$tcBatchHFOut'" >&2 + lastUpdatedFile=$ci + fi + ;; + esac + fmtutil --byhyphen "$tcBatchHFOut" + fi + else + echo "$progname: invalid format \`$tcBatchHyphenFormat' specified as argument for \`$progname hyphen'" >&2 + echo "$progname: for getting help, try \`$progname hyphen'" >&2 + rc=1 + fi + ;; + esac + ;; + + hyphen-list) + getFormatsForHyphen + ;; + + init) + case $2 in + "") + if fmtutil --all \ + && texlinks --multiplatform \ + && updmap; then + : + else + rc=1 + fi + ;; + *) + shift 1 + for i in "$@"; do + fmtutil --byfmt "$i" || rc=1 + done + ;; + esac + ;; + + mode-list) + setupModesMfFile + listMfModes + ;; + + mode) + case $2 in + "") + echo "Usage: $progname mode MODE + +Valid MODE settings:" + setupModesMfFile + listMfModes | sed 's@ .*@@; s@^@ @' | myFmt + rc=1 + ;; + *) + tcBatchMode=$2 + setupModesMfFile + if checkElemInList $tcBatchMode `listMfModes | sed 's@ .*@@'`; then + + # modify mktex.cnf + setupTmpDir + fmgrConfigReplace mktex.cnf '^: ..MODE=' ": \${MODE=$tcBatchMode}" + set x `getRes "$tcBatchMode"`; shift + tcBatchRes=$1 + fmgrConfigReplace mktex.cnf '^: ..BDPI=' ": \${BDPI=$tcBatchRes}" + + if checkForBinary dvips >/dev/null && tcfmgr --cmd find --file config.ps >/dev/null 2>&1; then + tcBatch dvips mode "$tcBatchMode" + fi + if checkForBinary pdftex >/dev/null && tcfmgr --cmd find --file pdftexconfig.tex >/dev/null 2>&1; then + tcBatch pdftex mode "$tcBatchMode" + fi + else + echo "$progname: unknown mode \`$tcBatchMode' specified as argument for \`$progname mode'" >&2; rc=1 + fi + ;; + esac + ;; + + paper) + help="Usage: $progname paper PAPER + +Valid PAPER settings: + letter a4" + + p=$2; pXdvi=$2; pDvips=$2 + case $2 in + letter) + pXdvi=us;; + a4) + pXdvi=a4;; + "") echo "$help" >&2; rc=1; return;; + *) + echo "$progname: unknown PAPER \`$2' given as argument for \`$progname paper'" >&2 + echo "$progname: try \`$progname paper' for help" >&2 + rc=1 + return;; + esac + if checkForBinary dvips >/dev/null && tcfmgr --cmd find --file config.ps >/dev/null 2>&1; then + tcBatch dvips paper $pDvips + fi + if checkForBinary dvipdfm >/dev/null && tcfmgr --cmd find --file config >/dev/null 2>&1; then + tcBatch dvipdfm paper $p + fi + if checkForBinary dvipdfmx >/dev/null && tcfmgr --cmd find --file dvipdfmx.cfg >/dev/null 2>&1; then + tcBatch dvipdfmx paper $p + fi + if checkForBinary xdvi >/dev/null && tcfmgr --cmd find --file XDvi >/dev/null 2>&1; then + tcBatch xdvi paper $pXdvi + fi + if checkForBinary pdftex >/dev/null && tcfmgr --cmd find --file pdftexconfig.tex >/dev/null 2>&1; then + tcBatch pdftex paper $p + fi + ;; + + pdftex) + help="Usage: $progname pdftex paper PAPER + +Valid PAPER settings: + a4 letter" + case $2 in + + mode) + case $3 in + "") + echo "Usage: $progname pdftex mode MODE" + rc=1 + ;; + *) + tcBatchPdftexMode=$3 + setupTmpDir + setupModesMfFile + if checkElemInList "$tcBatchPdftexMode" `listMfModes | sed 's@ .*@@'`; then + set x `getRes "$tcBatchPdftexMode"`; shift + fmgrConfigReplace pdftexconfig.tex 'pdfpkresolution' "\\pdfpkresolution=$1" + if $fmgrConfigReplaceChanged; then + fmtutil --refresh + fi + else + echo "$progname: unknown MODE \`$tcBatchPdftexMode' given as argument for \`$progname pdftex mode'" >&2 + rc=1 + fi + ;; + esac + ;; + + 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 + ;; + "") echo "$help" >&2; rc=1;; + *) + echo "$progname: unknown PAPER \`$3' given as argument for \`$progname pdftex paper'" >&2 + echo "$progname: try \`$progname pdftex paper' for help" >&2 + rc=1 ;; + esac ;; + "") + echo "$help" >&2; rc=1;; + *) + echo "$progname: unknown option \`$2' given as argument for \`$progname pdftex'" >&2 + echo "$progname: try \`$progname pdftex' for help" >&2 + rc=1 + ;; + esac + ;; + + rehash) + mktexlsr + ;; + + # + version|--version) + echo "$progname version $version" + setupTexmfmain + setupTexmfdist + showDistVersionInfo + (exit 0); exit 0;; + + # handle "xdvi paper PAPER" + xdvi) + tcBatchXdviPapers='us "8.5x11" +usr "11x8.5" +legal "8.5x14" +foolscap "13.5x17.0" +a1 "59.4x84.0cm" +a2 "42.0x59.4cm" +a3 "29.7x42.0cm" +a4 "21.0x29.7cm" +a5 "14.85x21.0cm" +a6 "10.5x14.85cm" +a7 "7.42x10.5cm" +a1r "84.0x59.4cm" +a2r "59.4x42.0cm" +a3r "42.0x29.7cm" +a4r "29.7x21.0cm" +a5r "21.0x14.85cm" +a6r "14.85x10.5cm" +a7r "10.5x7.42cm" +b1 "70.6x100.0cm" +b2 "50.0x70.6cm" +b3 "35.3x50.0cm" +b4 "25.0x35.3cm" +b5 "17.6x25.0cm" +b6 "13.5x17.6cm" +b7 "8.8x13.5cm" +b1r "100.0x70.6cm" +b2r "70.6x50.0cm" +b3r "50.0x35.3cm" +b4r "35.3x25.0cm" +b5r "25.0x17.6cm" +b6r "17.6x13.5cm" +b7r "13.5x8.8cm" +c1 "64.8x91.6cm" +c2 "45.8x64.8cm" +c3 "32.4x45.8cm" +c4 "22.9x32.4cm" +c5 "16.2x22.9cm" +c6 "11.46x16.2cm" +c7 "8.1x11.46cm" +c1r "91.6x64.8cm" +c2r "64.8x45.8cm" +c3r "45.8x32.4cm" +c4r "32.4x22.9cm" +c5r "22.9x16.2cm" +c6r "16.2x11.46cm" +c7r "11.46x8.1cm"' + help="Usage: $progname xdvi paper PAPER + +Valid PAPER settings: + a1 a1r a2 a2r a3 a3r a4 a4r a5 a5r a6 a6r a7 a7r + b1 b1r b2 b2r b3 b3r b4 b4r b5 b5r b6 b6r b7 b7r + c1 c1r c2 c2r c3 c3r c4 c4r c5 c5r c6 c6r c7 c7r + foolscap legal us usr" + case $2 in + paper-list) + echo "$tcBatchXdviPapers" + ;; + paper) + case $3 in + a1|a1r|a2|a2r|a3|a3r|a4|a4r|a5|a5r|a6|a6r|a7|a7r|b1|b1r|b2|b2r|b3|b3r|b4|b4r|b5|b5r|b6|b6r|b7|b7r|c1|c1r|c2|c2r|c3|c3r|c4|c4r|c5|c5r|c6|c6r|c7|c7r|foolscap|legal|us|usr) + fmgrConfigReplace XDvi paper: "*paper: $3" + ;; + "") echo "$help" >&2; rc=1;; + *) + echo "$progname: unknown PAPER \`$3' given as argument for \`$progname xdvi paper'" >&2 + echo "$progname: try \`$progname xdvi paper' for help" >&2 + rc=1 ;; + esac ;; + "") + echo "$help" >&2; rc=1;; + *) + echo "$progname: unknown option \`$2' given as argument for \`$progname xdvi'" >&2 + echo "$progname: try \`$progname xdvi' for help" >&2 + rc=1 + ;; + esac + ;; + *) + echo "$progname: unknown option \`$1' given as argument for \`$progname'" >&2 + echo "$progname: try \`$progname help' for help" >&2 + rc=1 + esac +} + +############################################################################### +# tcInteractive(void) +# handle interactive mode +############################################################################### +tcInteractive() +{ + texconfig-dialog +} + +############################################################################### +# main() +############################################################################### +rc=0 +case $# in + 0) tcInteractive;; + *) tcBatch "$@";; +esac + +cleanup $rc diff --git a/Build/source/texk/texlive/tl_scripts/texlinks.1 b/Build/source/texk/texlive/tl_scripts/texlinks.1 new file mode 100644 index 00000000000..75e7effcb15 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/texlinks.1 @@ -0,0 +1,66 @@ +.TH "texlinks" "8" "November 2007" "teTeX" "teTeX" +.PP +.SH "NAME" +texlinks \- maintain symbolic links from format to engine +.PP +.SH "SYNOPSIS" +.PP +\fBtexlinks\fP [ \fIOPTIONS\fP\&.\&.\&. ] \fIDIRECTORIES\fP\&.\&.\&. +.PP +.SH "DESCRIPTION" +.PP +\fBtexlinks\fP is used to create or recreate symbolic links from +formats to engines according to the information in +\fIfmtutil\&.cnf\fP or a file specified with \fB--cnffile\fP\&. +.PP +\fIDIRECTORIES\fP is an optional list of directories in which to +operate\&. If no directories are specified the list of directories +depends on the \fB--multiplatform\fP option\&. +.PP +.SH "OPTIONS" +.PP +.IP "\fB--cnffile\fP \fIFILE\fP or \fB-f\fP \fIFILE\fP" +use file as configuration file (default: +\fIfmtutil\&.cnf\fP) +.IP "\fB--help\fP or \fB-h\fP" +show some help text +.IP "\fB--multiplatform\fP or \fB-m\fP" +operate in all +platform-specific directories (default: +operate only in the directory for this +platform) +.IP "\fB--silent\fP or \fB-s\fP" +silently skip over existing +scripts/binaries instead of printing a warning +.IP "\fB--unlink\fP or \fB-u\fP" +Unlink previously created symlinks +.IP "\fB--verbose\fP or \fB-v\fP" ++set verbose mode on (default: off) +.PP +.SH "FILES" +.PP +.IP "\fIfmtutil\&.cnf\fP" +default configuration file +.PP +.SH "SEE ALSO" +.PP +\fBfmtutil\fP(1), \fBfmtutil\&.cnf\fP(5) +.PP +Web page: +.PP +.SH "BUGS" +.PP +None known, but report any bugs found to (mailing list)\&. +.PP +.SH "AUTHOR" +.PP +\fBtexlinks\fP was written by Thomas Esser + in 1999\&. +\fBtexlinks\fP has been released into the public domain\&. +.PP +This manual page was written by C\&.M\&. Connelly +, for +the Debian GNU/Linux system\&. It may be used by other distributions +without contacting the author\&. Any mistakes or omissions in the +manual page are my fault; inquiries about or corrections to this +manual page should be directed to me (and not to the primary author)\&. diff --git a/Build/source/texk/texlive/tl_scripts/texlinks.sh b/Build/source/texk/texlive/tl_scripts/texlinks.sh new file mode 100755 index 00000000000..c6fd2880aae --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/texlinks.sh @@ -0,0 +1,335 @@ +#!/bin/sh +# $Id$ + +# Thomas Esser, 1999, 2002, 2003. public domain. + +# texlinks: script to maintain symlinks from format to engine. Interprets +# the lines given in fmtutil.cnf. + +# History: +# (Further changes in ChangeLog.) +# Tue Oct 9 14:23:01 BST 2007 +# Added unlink option (-u) to aid OpenBSD package uninstall +# Edd Barrett +# Sun Aug 28 21:41:06 CEST 2005 +# remove special cases for csplain,cslatex,pdfcslatex,pdfcsplain +# Fr Apr 8 19:15:05 CEST 2005 +# cleanup now has an argument for the return code +# So Mar 27 18:52:06 CEST 2005 +# honor $TMPDIR, $TEMP and $TMP, not just $TMP +# Mon May 10 20:52:48 CEST 2004 +# kpseaccess instead of access +# Thu Dec 25 22:11:53 CET 2003, te: +# add version string +# Tue Apr 9 22:46:34 CEST 2002, te: +# do not create symlinks for cont-??, metafun and mptopdf + +test -f /bin/sh5 && test -z "$RUNNING_SH5" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \ + && { RUNNING_SH5=true; export RUNNING_SH5; exec /bin/sh5 $0 ${1+"$@"}; } +unset RUNNING_SH5 + +test -f /bin/bsh && test -z "$RUNNING_BSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \ + && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; } +unset RUNNING_BSH + +export PATH + +# hack around a bug in zsh: +test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"' + +version='$Id$' +progname=texlinks +cnf=fmtutil.cnf # name of the config file + +usage='Usage: texlinks [OPTION]... [DIRECTORY]... + +Create symbolic links format -> engine according to fmtutil setup. + +Mandatory arguments to long options are mandatory for short options too. + -e, --exeext EXT append EXT to symlink targets (default: none) + -f, --cnffile FILE use FILE as config file (default: fmtutil.cnf) + -m, --multiplatform operate in all platform specific directories + (default: operate only in directory for this platform) + -q, --quiet silently skip existing scripts / binaries + (default: issue warning) + -s, --silent same as -q + -u, --unlink remove symlinks created by texlinks + -v, --verbose enable verbose messages (default: off) + -h, --help show this help text + --version show version string + +The DIRECTORY arguments are an optional list of directories in which to +operate. If no directories are specified and --multiplatform is +likewise not specified, the directory of this script itself is used. +With --multiplatform, all child dirs of an upper-level bin/ dir are used. + +Report bugs to: tex-k@tug.org +TeX Live home page: +' + +############################################################################### +# abort(errmsg) +# print `errmsg' to stderr and exit with error code 1 +############################################################################### +abort() { errmsg "texlinks: $1."; cleanup 1; } + +# error message to stderr: +errmsg() { echo "$@" >&2; } + +# give message to stderr only if "verbose" mode is on: +verbose_echo() { $verbose && errmsg "$@"; } + +# in verbose mode: show command that is executed: +verbose_do() { verbose_echo "$@"; "$@"; } + +############################################################################### +# cleanup() +# clean up the temp area and exit with proper exit status +############################################################################### +cleanup() +{ + rc=$1 + $needsCleanup && test -n "$tmpdir" && test -d "$tmpdir" \ + && { rm -f "$tmpdir"/*; cd /; rmdir "$tmpdir"; } + exit $rc +} + +############################################################################### +# setupTmpDir() +# set up a temp directory and a trap to remove it +############################################################################### +setupTmpDir() +{ + $needsCleanup && return + + trap 'cleanup 1' 1 2 3 7 13 15 + needsCleanup=true + (umask 077; mkdir "$tmpdir") \ + || abort "could not create directory \`$tmpdir'" +} + + +# search a binary along $PATH: +check_for_binary() +{ + testbin=$1 + set x `echo "$PATH" | sed 's/^:/.:/; s/:$/:./; s/::/:.:/g; s/:/ /g'`; shift + for i + do + if [ -x "$i/$testbin" ]; then + echo "$i/$testbin" + return 0 + fi + done + return 1 +} + + +############################################################################### +# install_link(dest src) +# create a symlink like ln -s dest src, but make sure that src is not +# an existing binary, possibly adding the executable extension if +# passed on the command. +############################################################################### +install_link() +{ + # make symlink src -> dest + dest=$1; src=$2 + + case $src in + */mf) + if test "$dest" = mf-nowin; then + if test -f $selfautoloc/mfw; then + dest=mfw # name for windows-enabled mf, once upon a time + verbose_echo "both mfw and mf-nowin exists, $src linked to $dest" + fi + if test -f $selfautoloc/mf && test -f $selfautoloc/mf-nowin; then + # have both mf and mf-nowin binaries. no link. + verbose_echo "skipped metafont symlink $src -> $dest (special case)" + return + fi + fi + ;; + esac + + # append .exe if supplied (for cygwin). + test -n "$exeext" && dest="$dest$exeext" + + case $src in + */cont-??|*/mptopdf) + # context includes wrapper scripts that create/run these. + verbose_echo "skipped ConTeXtish symlink $src -> $dest (special case)" + ;; + *) + test "x$src" != "x`(ls -ld $src | awk '{print $NF}') 2>/dev/null`" && + rm -f "$src" + + if test -f "$src"; then + case $silent in + true) + ;; + *) + errmsg "install_link $src -> $dest failed: file already exists." + ;; + esac + else + verbose_do ln -s "$dest" "$src" + fi + ;; + esac +} + +############################################################################### +# search_symlinkdir() +# look if $PATH has only symlinks to the real binaries and find that +# directory. Also check if this directory is writable. +############################################################################### +search_symlinkdir() +{ + kpsewhich=`check_for_binary kpsewhich` + test -z "$kpsewhich" && return 1 + symlinkdir=`echo $kpsewhich | sed 's@/*kpsewhich$@@'` + kpseaccess -w "$symlinkdir" || return 1 + touch "$symlinkdir/tl$$" + if test -f "$selfautoloc/tl$$"; then + rm -f "$symlinkdir/tl$$" + return 1 + else + rm -f "$symlinkdir/tl$$" + return 0 + fi +} + +############################################################################### +# upd_symlinkdir() +# if $PATH has only symlinks to the real binaries, update that directory +# that holds the symlinks +############################################################################### +upd_symlinkdir() +{ + search_symlinkdir || return 0 + for i in `sed 's@ .*@@' cnf_file_ln.$$`; do + install_link "$selfautoloc/$i" "$symlinkdir/$i" + done +} + +############################################################################### +# rm_link() +# Delete a previously installed link +############################################################################### +rm_link() +{ + link=$1; + if test -e $link; then + if test -h $link; then + verbose_do rm -Rf $link + else + verbose_echo "kept $link, since not a symlink" + fi + else + verbose_echo "skipped $link, non-existent" + fi +} + +############################################################################### +# main() +# parse commandline arguments, initialize variables, +# switch into temp. direcrory, execute desired command +############################################################################### +main() +{ + cnf_file= # global variable: full name of the config file + dirs= + needsCleanup=false + + exeext= + multiplatform=false + verbose=false + unlink=false + silent=false + thisdir=`pwd` + : ${KPSE_DOT=$thisdir}; export KPSE_DOT + selfautoloc=`kpsewhich --expand-var='$SELFAUTOLOC'` + while + case $1 in + --h*|-h) + echo "$usage"; exit 0;; + --version) + echo "$progname version $version"; exit 0;; + --cnffile|-f) + shift; cnf_file=$1;; + --e*|-e) shift; exeext=$1;; + --m*|-m) multiplatform=true;; + --s*|-s|--q*|-q) silent=true;; + --u*|-u) unlink=true;; + --v*|-v) verbose=true;; + -*) errmsg "fmtutil: unknown option \`$1' ignored.";; + *) break;; + esac + do test $# -gt 0 && shift; done + dirs="$*" + + # 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" + + + tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/texlinks.$$ + setupTmpDir + cd "$tmpdir" || cleanup 1 + + sed '/^[ ]*#/d; /^[ ]*$/d' $cnf_file \ + | awk '{print $1, $2}' > cnf_file_ln.$$ + + if test -z "$dirs"; then + if test $multiplatform = true; then + case $selfautoloc in + */bin) dirs=$selfautoloc;; + *) parent=`kpsewhich --expand-var='$SELFAUTODIR'` + dirs=`find $parent -type f -name kpsewhich -print \ + | sed 's@/kpsewhich$@@'`;; + esac + else + dirs=$selfautoloc + fi + fi + + for d in $dirs; do + kpseaccess -w $d \ + || { errmsg "$d: no write permissions. Skipping..."; continue; } + # cnf_file_ln.$$ has lines with "format engine" pairs + set x `cat cnf_file_ln.$$`; shift + while test $# != 0; do + fmt=$1; engine=$2; shift; shift + + # Some broken shells destroy the positional arguments when calling a + # shellfunction. Therefore, we save and restore them "by hand" in the + # main_args_while variable. + main_args_while="$@" + + test "x$fmt" = "x$engine" && continue + if test -f "$d/$engine$exeext"; then + case $unlink in + true) + rm_link "$d/$fmt";; + *) + install_link "$engine" "$d/$fmt";; + esac + else + verbose_echo "skipped $d/$engine, engine does not exist" + fi + + # restore positional arguments: + set x $main_args_while; shift + + done + done + upd_symlinkdir +} + +main ${1+"$@"} + +# set successful return code +cleanup 0 diff --git a/Build/source/texk/texlive/tl_scripts/updmap-sys.sh b/Build/source/texk/texlive/tl_scripts/updmap-sys.sh new file mode 100755 index 00000000000..6f3c8365658 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/updmap-sys.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +# updmap-sys: Thomas Esser, public domain. + +# wrapper script for updmap with TEXMFVAR and TEXMFCONFIG set to +# TEXMFSYSVAR / TEXMFSYSCONFIG + +test -f /bin/ksh && test -z "$RUNNING_KSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \ + && { RUNNING_KSH=true; export RUNNING_KSH; exec /bin/ksh $0 ${1+"$@"}; } +unset RUNNING_KSH + +test -f /bin/bsh && test -z "$RUNNING_BSH" \ + && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \ + && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; } +unset RUNNING_BSH + +export PATH + +# hack around a bug in zsh: +test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"' + +v=`kpsewhich -var-value TEXMFSYSVAR` +c=`kpsewhich -var-value TEXMFSYSCONFIG` + +TEXMFVAR="$v" +TEXMFCONFIG="$c" +export TEXMFVAR TEXMFCONFIG + +exec updmap ${1+"$@"} diff --git a/Build/source/texk/texlive/tl_scripts/updmap.1 b/Build/source/texk/texlive/tl_scripts/updmap.1 new file mode 100644 index 00000000000..5bc81acc69d --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/updmap.1 @@ -0,0 +1,360 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.9. +.TH UPDMAP "1" "August 2012" "TeX Live" "User Commands" +.SH NAME +updmap \- manage TeX font maps, per-user +.br +updmap-sys \- manage TeX font maps, system-wide +.SH SYNOPSIS +.B updmap +[\fIOPTION\fR] ... [\fICOMMAND\fR] +.br +.B updmap-sys +[\fIOPTION\fR] ... [\fICOMMAND\fR] +.SH DESCRIPTION +updmap (TeX Live, multi) version $Id: updmap.pl 27264 2012\-07\-31 05:10:29Z preining $ +.PP +Update the default font map files used by pdftex, dvips, and dvipdfm(x), +and optionally pxdvi, as determined by all configuration files updmap.cfg +(the ones returned by running "kpsewhich \fB\-\-all\fR updmap.cfg", but see below). +.PP +Among other things, these map files are used to determine which fonts +should be used as bitmaps and which as outlines, and to determine which +font files are included in the PDF or PostScript output. +.PP +By default, the TeX filename database (ls\-R) is also updated. +.SH OPTIONS +.TP +\fB\-\-cnffile\fR FILE +read FILE for the updmap configuration +(can be given multiple times, in which case +all the files are used) +.TP +\fB\-\-dvipdfmxoutputdir\fR DIR +specify output directory (dvipdfm(x) syntax) +.TP +\fB\-\-dvipsoutputdir\fR DIR +specify output directory (dvips syntax) +.TP +\fB\-\-pdftexoutputdir\fR DIR +specify output directory (pdftex syntax) +.TP +\fB\-\-pxdvioutputdir\fR DIR +specify output directory (pxdvi syntax) +.TP +\fB\-\-outputdir\fR DIR +specify output directory (for all files) +.TP +\fB\-\-copy\fR +cp generic files rather than using symlinks +.TP +\fB\-\-force\fR +recreate files even if config hasn't changed +.TP +\fB\-\-nomkmap\fR +do not recreate map files +.TP +\fB\-\-nohash\fR +do not run texhash +.TP +\fB\-n\fR, \fB\-\-dry\-run\fR +only show the configuration, no output +.TP +\fB\-\-quiet\fR, \fB\-\-silent\fR +reduce verbosity +.SS "Commands:" +.TP +\fB\-\-help\fR +show this message and exit +.TP +\fB\-\-version\fR +show version information and exit +.TP +\fB\-\-showoption\fR OPTION +show the current setting of OPTION +.TP +\fB\-\-showoptions\fR OPTION +show possible settings for OPTION +.TP +\fB\-\-setoption\fR OPTION VALUE +set OPTION to value; option names below +.TP +\fB\-\-setoption\fR OPTION=VALUE +as above, just different syntax +.TP +\fB\-\-enable\fR MAPTYPE MAPFILE +add "MAPTYPE MAPFILE" to updmap.cfg, +where MAPTYPE is Map, MixedMap, or KanjiMap +.TP +\fB\-\-enable\fR Map=MAPFILE +add "Map MAPFILE" to updmap.cfg +.HP +\fB\-\-enable\fR MixedMap=MAPFILE add "MixedMap MAPFILE" to updmap.cfg +.HP +\fB\-\-enable\fR KanjiMap=MAPFILE add "KanjiMap MAPFILE" to updmap.cfg +.TP +\fB\-\-disable\fR MAPFILE +disable MAPFILE, of whatever type +.TP +\fB\-\-listmaps\fR +list all active and inactive maps +.TP +\fB\-\-listavailablemaps\fR +same as \fB\-\-listmaps\fR, but without +unavailable map files +.TP +\fB\-\-syncwithtrees\fR +disable unavailable map files in updmap.cfg +.PP +Explanation of the map types: the (only) difference between Map and +MixedMap is that MixedMap entries are not added to psfonts_pk.map. +The purpose is to help users with devices that render Type 1 outline +fonts worse than mode\-tuned Type 1 bitmap fonts. So, MixedMap is used +for fonts that are available as both Type 1 and Metafont. +KanjiMap entries are added to psfonts_t1.map and kanjix.map. +.PP +Explanation of the OPTION names for \fB\-\-showoptions\fR, \fB\-\-showoption\fR, \fB\-\-setoption\fR: +.TP +dvipsPreferOutline +true|false (default true) +.IP +Whether dvips uses bitmaps or outlines, when both are available. +.TP +dvipsDownloadBase35 +true|false (default true) +.IP +Whether dvips includes the standard 35 PostScript fonts in its output. +.TP +pdftexDownloadBase14 +true|false (default true) +.IP +Whether pdftex includes the standard 14 PDF fonts in its output. +.TP +pxdviUse +true|false (default false) +.IP +Whether maps for pxdvi (Japanese\-patched xdvi) are under updmap's control. +.TP +kanjiEmbed +(any string) +.TP +kanjiVariant +(any string) +.IP +See below. +.TP +LW35 +URWkb|URW|ADOBEkb|ADOBE (default URWkb) +.IP +Adapt the font and file names of the standard 35 PostScript fonts. +URWkb URW fonts with "berry" filenames (e.g. uhvbo8ac.pfb) +URW URW fonts with "vendor" filenames (e.g. n019064l.pfb) +ADOBEkb Adobe fonts with "berry" filenames (e.g. phvbo8an.pfb) +ADOBE Adobe fonts with "vendor" filenames (e.g. hvnbo___.pfb) +.IP +These options are only read and acted on by updmap; dvips, pdftex, etc., +do not know anything about them. They work by changing the default map +file which the programs read, so they can be overridden by specifying +command\-line options or configuration files to the programs, as +explained at the beginning of updmap.cfg. +.IP +The options kanjiEmbed and kanjiVariant specify special replacements +in the map lines. If a map contains the string @kanjiEmbed@, then +this will be replaced by the value of that option; similarly for +kanjiVariant. In this way, users of Japanese TeX can select different +fonts to be included in the final output. +.SH ENVIRONMENT +.PP +Explanation of trees and files normally used: +.IP +If \fB\-\-cnffile\fR is specified on the command line (possibly multiple +times), its value(s) are used. Otherwise, updmap reads all the +updmap.cfg files found by running `kpsewhich \fB\-all\fR updmap.cfg', in the +order returned by kpsewhich, with one exception: an updmap.cfg found +in TEXMFLOCAL is given higher priority than the updmap.cfg in +TEXMFMAIN, to ensure that local adjustments by administrators take +precedence over what is shipped in TeX Live. +.IP +In any case, if multiple updmap.cfg files are found, all the maps +mentioned in all the updmap.cfg files are merged. +.IP +Thus, if updmap.cfg files are present in all trees, and the default +layout is used as shipped with TeX Live, the following files are +read, in the given order. +.nf +.IP +For updmap\-sys: +TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf\-config/web2c/updmap.cfg +TEXMFSYSVAR $TEXLIVE/YYYY/texmf\-var/web2c/updmap.cfg +TEXMFLOCAL $TEXLIVE/texmf\-local/web2c/updmap.cfg +TEXMFMAIN $TEXLIVE/YYYY/texmf/web2c/updmap.cfg +TEXMFDIST $TEXLIVE/YYYY/texmf\-dist/web2c/updmap.cfg +.IP +For updmap: +TEXMFCONFIG $HOME/.texliveYYYY/texmf\-config/web2c/updmap.cfg +TEXMFVAR $HOME/.texliveYYYY/texmf\-var/web2c/updmap.cfg +TEXMFHOME $HOME/texmf/web2c/updmap.cfg +TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf\-config/web2c/updmap.cfg +TEXMFSYSVAR $TEXLIVE/YYYY/texmf\-var/web2c/updmap.cfg +TEXMFLOCAL $TEXLIVE/texmf\-local/web2c/updmap.cfg +TEXMFMAIN $TEXLIVE/YYYY/texmf/web2c/updmap.cfg +TEXMFDIST $TEXLIVE/YYYY/texmf\-dist/web2c/updmap.cfg +.IP +(where YYYY is the TeX Live release version). +.fi +.IP +There is another exception to keep upgradability from earlier versions +of TeX Live: if a file TEXMFLOCAL/web2c/updmap\-local.cfg exists +(formerly used by tlmgr to merge local fonts), then the file +TEXMFLOCAL/web2c/updmap.cfg is ignored (if it exists) and that +updmap\-local.cfg is used instead. In this case, updmap recognizes the +previous syntax for disabling map files in updmap\-local.cfg (this +syntax is different from what is used now). +.IP +According to the actions, updmap might write to one of the given files +or create a new updmap.cfg, described further below. +.IP +Where changes are saved: if config files are given on the command +line, then the first one given will be used to save any changes from +\fB\-\-setoption\fR, \fB\-\-enable\fR or \fB\-\-disable\fR. If the config files are taken +from kpsewhich output, then the algorithm is more complex: +.IP +1) If $TEXMFCONFIG/web2c/updmap.cfg or $TEXMFHOME/web2c/updmap.cfg +appears in the list of used files, then the one listed first by +kpsewhich \fB\-\-all\fR (equivalently, the one returned by kpsewhich +updmap.cfg), is used. +.IP +2) If neither of the above two are present and changes are made, a +new config file is created in $TEXMFCONFIG/web2c/updmap.cfg. +.IP +Resolving multiple definitions of a font: +.IP +If a font is defined in more than one map file, then the definition +coming from the first\-listed updmap.cfg is used. If a font is +defined multiple times within the same map file, one is chosen +arbitrarily. In both cases a warning is issued. +.IP +Disabling maps: +.IP +updmap.cfg files with higher priority (listed earlier) can disable +maps mentioned in lower priority (listed later) updmap.cfg files by +writing, e.g., +.IP +#! Map mapname.map +.IP +or +.IP +#! MixedMap mapname.map +.IP +in the higher\-priority updmap.cfg file. +.IP +As an example, suppose you have a copy of MathTime Pro fonts +and want to disable the Belleek version of the fonts; that is, +disable the map belleek.map. You can create the file +$TEXMFCONFIG/web2c/updmap.cfg with the content +.IP +#! Map belleek.map +Map mt\-plus.map +Map mt\-yy.map +.IP +and call updmap. +.IP +updmap writes the map files for dvips (psfonts.map) and pdftex +(pdftex.map) to the TEXMFVAR/fonts/map/updmap/{dvips,pdftex}/ +directories. +.IP +The log file is written to TEXMFVAR/web2c/updmap.log. +.IP +When updmap\-sys is run, TEXMFSYSCONFIG and TEXMFSYSVAR are used +instead of TEXMFCONFIG and TEXMFVAR, respectively. This is the only +difference between updmap\-sys and updmap. +.IP +Other locations may be used if you give them on the command line, or +these trees don't exist, or you are not using the original TeX Live. +.IP +To see the precise locations of the various files that +will be read and written, give the \fB\-n\fR option (or read the source). +.SH EXAMPLES +.PP +For step\-by\-step instructions on making new fonts known to TeX, read +http://tug.org/fonts/fontinstall.html. For even more terse +instructions, read the beginning of updmap.cfg. +.SH FILES +Configuration and input files: +.IP "\fIupdmap\&.cfg\fP" +Main configuration file\&. In +\fItexmf/web2c\fP by default, but may be located elsewhere +depending on your distribution\&. Each texmf tree read should have its +own \fIupdmap.cfg\fP. +.IP "\fIdvips35\&.map\fP" +Map file for standard 35 PostScript fonts for +use with \fBdvips\fP(1)\&. +.IP "\fIpdftex35\&.map\fP" +Map file for standard 35 PostScript fonts for +use with \fBpdftex\fP(1)\&. +.IP "\fIps2pk35\&.map\fP" +Map file for standard 35 PostScript fonts for +use with \fBps2pk\fP(1)\&. +.PP +Output files: +.IP "\fIpsfonts\&.map\fP" +For \fBdvips\fP(1)\&. +Same as \fIpsfonts_t1\&.map\fP if option \fBdvipsPreferOutline\fP active, +else as \fIpsfonts_pk\&.map\fP. +.IP "\fIpsfonts_pk\&.map\fP" +For \fBdvips\fP(1)\&. +Without information from MixedMap files\&. +(Setting of \fBdvipsPreferOutline\fP ignored\&.) +.IP "\fIpsfonts_t1\&.map\fP" +For \fBdvips\fP(1)\&. +With information from MixedMap files\&. +(Setting of \fBdvipsPreferOutline\fP ignored\&.) +.IP "\fIdownload35\&.map\fP" +For \fBdvips\fP(1)\&. +Always downloads the standard 35 fonts\&. +(Setting of \fBdvipsDownloadBase35\fP ignored\&.) +.IP "\fIbuiltin35\&.map\fP" +For \fBdvips\fP(1)\&. +Never downloads the standard 35 fonts\&. +(Setting of \fBdvipsDownloadBase35\fP ignored\&.) +.IP "\fIpdftex\&.map\fP" +For \fBpdftex\fP(1)\&. +Same as \fIpdftex_dl14\&.map\fP if option \fBpdftexDownloadBase14\fP active, +else as \fIpdftex_ndl14\&.map\fP. +.IP "\fIpdftex_dl14\&.map\fP" +For \fBpdftex\fP(1)\&. +Always downloads the standard 14 fonts\&. +.IP "\fIpdftex_ndl14\&.map\fP" +For \fBpdftex\fP(1)\&. +Never downloads the standard 14 fonts\&. +.IP "\fIps2pk\&.map\fP" +Similar to \fIpsfonts.map\fP file, but +forces all fonts to be downloaded, so this map file can be used with +\fBxdvi\fP(1) and \fBps2pk\fP(1)\&. +.PP +Configuration files for \fBdvips\fP(1): +.IP "\fIconfig\&.builtin35\fP" +Loads \fIbuiltin35\&.map\fP instead +of \fIpsfonts\&.map\fP\&. +.IP "\fIconfig\&.download35\fP" +Loads \fIdownload35\&.map\fP instead +of \fIpsfonts\&.map\fP\&. +.IP "\fIconfig\&.outline\fP" +Loads \fIpsfonts_t1\&.map\fP instead +of \fIpsfonts\&.map\fP\&. +.IP "\fIconfig\&.pdf\fP" +Loads \fIpsfonts_t1\&.map\fP instead +of \fIpsfonts\&.map\fP and has additional optimizations for PDF generation\&. +.IP "\fIconfig\&.pk\fP" +Loads \fIpsfonts_pk\&.map\fP instead +of \fIpsfonts\&.map\fP\&. +.IP "\fIconfig\&.www\fP" +Loads \fIpsfonts_t1\&.map\fP instead +of \fIpsfonts\&.map\fP\&. +(For compatibility with old versions\&.) +.IP "\fIconfig\&.gstopk\fP" +Loads \fIpsfonts_t1\&.map\fP instead +of \fIpsfonts\&.map\fP\&. +.SH "REPORTING BUGS" +Report bugs to: tex\-k@tug.org +.br +TeX Live home page: diff --git a/Build/source/texk/texlive/tl_scripts/updmap.cfg.5 b/Build/source/texk/texlive/tl_scripts/updmap.cfg.5 new file mode 100644 index 00000000000..43a7cc2d23f --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/updmap.cfg.5 @@ -0,0 +1,155 @@ +.\" Hey, Emacs! This is an -*- nroff -*- source file. +.\" +.\" Copyright (C) 2004, 2012 Hilmar Preusse +.\" Copyright (C) 2012 Norbert Preining +.\" +.\" This is free software; you can redistribute it and/or modify it under +.\" the terms of the GNU General Public License as published by the Free +.\" Software Foundation; either version 2, or (at your option) any later +.\" version. +.\" +.\" This is distributed in the hope that it will be useful, but WITHOUT +.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this program. if not, see . +.\" +.TH "UPDMAP.CFG" "20" "November 2012" "TeX Live" "TeX Live" +.SH "NAME" +\fBupdmap.cfg\fR \- configuration of font mapping/inclusion for dvips and +friends. +.SH "DESCRIPTION" +The file \fBupdmap.cfg\fR is the central font configuration file of a +teTeX system and is read by \fBupdmap\fP(1). It describes if and how +fonts should be included (or not included) into PS-/PDF-files. This +works for Outline (Postscript Type1) and Bitmap Fonts (Postscript +Type3) mostly coming from MetaFont. +.PP +\fBupdmap\fP is a utility that creates font configuration files for +\fBdvips\fP(1), \fBpdftex\fP(1), \fBxdvi\fP(1), \fBps2pk\fP(1), +\fBgsftopk\fP(1), and \fBdvipdfmx\fP(1)\&. In +an ideal world, updmap would be unnecessary -- each of these programs +would read the same configuration file to learn what fonts are +available and how they should be treated\&. As things stand, however, +each of these tools has subtly different requirements and thereby +needs its own font configuration file\&. \fBupdmap\fP creates font +configuration files for all of these programs from several sources, +namely all \fBupdmap.cfg\fR, allowing you to easily keep all the different +configuration files in sync\&. +.P +Running "updmap --help" will output the main documentation for using +\fBupdmap\fR. +.P +\fBdvipsPreferOutline\fR +.br +Configures if \fBdvips\fR (by default) should prefer bitmap fonts or outline fonts +if both are available? Independent of this setting, outlines can be forced +by putting "p psfonts_t1.map" into a config file that dvips reads. Bitmaps +can be forced by putting "p psfonts_pk.map" into a config file. We provide +such config files which can be enabled via +\fBdvips\fR \fI-Poutline\fR (resp. \fBdvips\fR \fI-Ppk\fR). +.br +Valid settings for dvipsPreferOutline are \fItrue\fR / \fIfalse\fR. +.P +\fBLW35\fR +.br +Which fonts of the "Basic 35 Laserwriter Fonts" do you want to use and +how are the filenames chosen? Valid settings: +.br +URW: URW fonts with "vendor" filenames (e.g. n019064l.pfb) +.br +URWkb: URW fonts with "berry" filenames (e.g. uhvbo8ac.pfb) +.br +ADOBE: Adobe fonts with "vendor" filenames (e.g. hvnbo___.pfb) +.br +ADOBEkb: Adobe fonts with "berry" filenames (e.g. phvbo8an.pfb) +.P +\fBdvipsDownloadBase35\fR +.br +Configures if \fBdvips\fR (by default) should download the 35 base +PostScript fonts into the document (set \fItrue\fR) or should these +fonts be used from the ps interpreter / printer (set \fIfalse\fR). +.br +The user can override the default by specifying \fBdvips\fR \fI-Pdownload35\fR +(resp. \fBdvips\fR \fI-Pbuiltin35\fR) to download the LW35 fonts +(resp. use the built-in fonts). +.br +Valid settings are \fItrue\fR / \fIfalse\fR. +.P +\fBpdftexDownloadBase14\fR +.br +Should \fBpdftex\fR download the 14 base PDF fonts? Since some configurations +(ps / pdf tools / printers) use bad default fonts, it is safer to download +the fonts. The pdf files get bigger, but that is the cost. +.br +Valid settings are \fItrue\fR (download the fonts) or \fIfalse\fR (don't +download the fonts). Adobe recommends embedding all fonts. +.P +\fBpxdviUse\fR +.br +Should special map files for pxdvi be created? pxdvi is an adaption of xdvi +with support for reading and displaying files generated by the ptex family +of engines. +.br +Valid settings are \fItrue\fR (generate configuration) or \fIfalse\fR. See +http://www.tug.org/texlive/updmap-kanji.html for detailed discussion. +.P +\fBkanjiEmbed\fR +.br +\fBkanjiVariant\fR +.br +The options \fBkanjiEmbed\fR and \fBkanjiVariant\fR specify special +replacements in the map lines. In a map, the string "@kanjiEmbed@" +will be replaced by the value of that option; similarly for +\fBkanjiVariant\fR. In this way, users of Japanese TeX can select +different fonts to be included in the final output. +.P +\fBMap\fR +.br +Points to a map file, which describes a mapping from a font (called in the TeX +document) to the pfb file containing the Postscript code. +.br +Usage: \fBMap\fR filename.map +.P +The syntax of map files is the same as \fBdvips\fP(1) uses, see the +section "psfonts.map" in the manual of \fBdvips\fP(1). +.P +\fBMixedMap\fR +.br +Similar to \fBMap\fR. It should be used when there is Type1 and a bitmap +implementation of the font (the latter mostly coming from MetaFont). These +entries will not be used in the default map of \fBdvips\fR if +\fBdvipsPreferOutline\fR is set to \fIfalse\fR. +.br +Usage: \fBMixedMap\fR filename.map +.P +\fBKanjiMap\fR +.br +Similar to \fBMap\fR. This should be used for kanji fonts. +.br +Usage: \fBKanjiMap\fR filename.map +.P +The sign \fB#\fR precedes a comment. +.P +Map files not to be used should be commented out using the string +\fB#!\fR at the beginning of the line. Such entries can be +(de-)activated using \fBupdmap\fR with the options \fI--enable\fR and +\fI--disable\fR, respectively. + +.SH "AUTHOR" +This manual page was written by Hilmar Preusse and +extended by Norbert Preining , for +the Debian GNU/Linux system by simply copying the comments from +\fBupdmap.cfg\fR and rewriting some of them. It may be used by other +distributions without contacting the author. Any mistakes or omissions in +the manual page are our fault; inquiries about or corrections to this manual +page should be directed to tex-live@tug.org. + +.SH "SEE ALSO" +updmap(1), dvips(1) + +.SH "THANKS TO" +Frank Kuester, +Thomas Esser. diff --git a/Build/source/texk/texlive/tl_scripts/updmap.help2man b/Build/source/texk/texlive/tl_scripts/updmap.help2man new file mode 100644 index 00000000000..4864c2d74f4 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/updmap.help2man @@ -0,0 +1,100 @@ +# $Id$ +# This help2man auxiliary file is in the public domain. +# Originally created by Karl Berry. +# The FILES text from Claire Connelly. +# See the Makefile for the help2man invocation. +# do not fill the long TEXMF* tables. + +[NAME] +updmap \- manage TeX font maps, per-user +.br +updmap-sys \- manage TeX font maps, system-wide + +/in the final output/ +.SH ENVIRONMENT + +/in the given order/ +.nf + +/where YYYY is/ +.fi + +/give the -n option/ +.SH EXAMPLES + +[FILES] +Configuration and input files: +.IP "\fIupdmap\&.cfg\fP" +Main configuration file\&. In +\fItexmf/web2c\fP by default, but may be located elsewhere +depending on your distribution\&. Each texmf tree read should have its +own \fIupdmap.cfg\fP. +.IP "\fIdvips35\&.map\fP" +Map file for standard 35 PostScript fonts for +use with \fBdvips\fP(1)\&. +.IP "\fIpdftex35\&.map\fP" +Map file for standard 35 PostScript fonts for +use with \fBpdftex\fP(1)\&. +.IP "\fIps2pk35\&.map\fP" +Map file for standard 35 PostScript fonts for +use with \fBps2pk\fP(1)\&. +.PP +Output files: +.IP "\fIpsfonts\&.map\fP" +For \fBdvips\fP(1)\&. +Same as \fIpsfonts_t1\&.map\fP if option \fBdvipsPreferOutline\fP active, +else as \fIpsfonts_pk\&.map\fP. +.IP "\fIpsfonts_pk\&.map\fP" +For \fBdvips\fP(1)\&. +Without information from MixedMap files\&. +(Setting of \fBdvipsPreferOutline\fP ignored\&.) +.IP "\fIpsfonts_t1\&.map\fP" +For \fBdvips\fP(1)\&. +With information from MixedMap files\&. +(Setting of \fBdvipsPreferOutline\fP ignored\&.) +.IP "\fIdownload35\&.map\fP" +For \fBdvips\fP(1)\&. +Always downloads the standard 35 fonts\&. +(Setting of \fBdvipsDownloadBase35\fP ignored\&.) +.IP "\fIbuiltin35\&.map\fP" +For \fBdvips\fP(1)\&. +Never downloads the standard 35 fonts\&. +(Setting of \fBdvipsDownloadBase35\fP ignored\&.) +.IP "\fIpdftex\&.map\fP" +For \fBpdftex\fP(1)\&. +Same as \fIpdftex_dl14\&.map\fP if option \fBpdftexDownloadBase14\fP active, +else as \fIpdftex_ndl14\&.map\fP. +.IP "\fIpdftex_dl14\&.map\fP" +For \fBpdftex\fP(1)\&. +Always downloads the standard 14 fonts\&. +.IP "\fIpdftex_ndl14\&.map\fP" +For \fBpdftex\fP(1)\&. +Never downloads the standard 14 fonts\&. +.IP "\fIps2pk\&.map\fP" +Similar to \fIpsfonts.map\fP file, but +forces all fonts to be downloaded, so this map file can be used with +\fBxdvi\fP(1) and \fBps2pk\fP(1)\&. +.PP +Configuration files for \fBdvips\fP(1): +.IP "\fIconfig\&.builtin35\fP" +Loads \fIbuiltin35\&.map\fP instead +of \fIpsfonts\&.map\fP\&. +.IP "\fIconfig\&.download35\fP" +Loads \fIdownload35\&.map\fP instead +of \fIpsfonts\&.map\fP\&. +.IP "\fIconfig\&.outline\fP" +Loads \fIpsfonts_t1\&.map\fP instead +of \fIpsfonts\&.map\fP\&. +.IP "\fIconfig\&.pdf\fP" +Loads \fIpsfonts_t1\&.map\fP instead +of \fIpsfonts\&.map\fP and has additional optimizations for PDF generation\&. +.IP "\fIconfig\&.pk\fP" +Loads \fIpsfonts_pk\&.map\fP instead +of \fIpsfonts\&.map\fP\&. +.IP "\fIconfig\&.www\fP" +Loads \fIpsfonts_t1\&.map\fP instead +of \fIpsfonts\&.map\fP\&. +(For compatibility with old versions\&.) +.IP "\fIconfig\&.gstopk\fP" +Loads \fIpsfonts_t1\&.map\fP instead +of \fIpsfonts\&.map\fP\&. diff --git a/Build/source/texk/texlive/tl_scripts/updmap.pl b/Build/source/texk/texlive/tl_scripts/updmap.pl new file mode 100755 index 00000000000..d265ebd1fb5 --- /dev/null +++ b/Build/source/texk/texlive/tl_scripts/updmap.pl @@ -0,0 +1,2306 @@ +#!/usr/bin/env perl +# mupdmap: utility to maintain map files for outline fonts. +# $Id$ +# +# Copyright 2011, 2012 Norbert Preining +# This file is licensed under the GNU General Public License version 2 +# or any later version. +# +# History: +# Original shell script (C) 2002 Thomas Esser +# first perl variant (C) Fabrice Popineau +# later adaptions by Reinhard Kotucha and Karl Berry +# the original versions were licensed under the following agreement: +# Anyone may freely use, modify, and/or distribute this file, without +# limitation. +# +# TODO +# - check all other invocations +# - after TL2012? Maybe remove support for reading updmap-local.cfg +# + +my $TEXMFROOT; + +BEGIN { + $^W=1; + $TEXMFROOT = `kpsewhich -var-value=TEXMFROOT`; + if ($?) { + print STDERR "updmap: Cannot find TEXMFROOT, aborting!\n"; + exit 1; + } + chomp($TEXMFROOT); + unshift (@INC, "$TEXMFROOT/tlpkg"); +} + + +my $version = '$Id$'; + +use Getopt::Long qw(:config no_autoabbrev ignore_case_always); +use strict; +use TeXLive::TLUtils qw(mkdirhier mktexupd win32 basename dirname + sort_uniq member); + +#use Data::Dumper; +#$Data::Dumper::Indent = 1; + +(my $prg = basename($0)) =~ s/\.pl$//; + +# sudo sometimes does not reset the home dir of root, check on that +# see more comments at the definition of the function itself +# this function checks by itself whether it is running on windows or not +reset_root_home(); + +chomp(my $TEXMFMAIN = `kpsewhich --var-value=TEXMFMAIN`); +chomp(my $TEXMFVAR = `kpsewhich -var-value=TEXMFVAR`); +chomp(my $TEXMFCONFIG = `kpsewhich -var-value=TEXMFCONFIG`); +chomp(my $TEXMFHOME = `kpsewhich -var-value=TEXMFHOME`); + +# make sure that on windows *everything* is in lower case for comparison +if (win32()) { + $TEXMFMAIN = lc($TEXMFMAIN); + $TEXMFVAR = lc($TEXMFVAR); + $TEXMFCONFIG = lc($TEXMFCONFIG); + $TEXMFROOT = lc($TEXMFROOT); + $TEXMFHOME = lc($TEXMFHOME); +} + + +my %opts = ( quiet => 0, nohash => 0, nomkmap => 0 ); +my $alldata; +my $updLSR; + +my @cmdline_options = ( + "listfiles", + "cnffile=s@", + "copy", + "disable=s@", + "dvipdfmoutputdir=s", + "dvipdfmxoutputdir=s", + "dvipsoutputdir=s", + # the following does not work, Getopt::Long looses the first + # entry in a multi setting, treat it separately in processOptions + # furthermore, it is not supported by older perls, so do it differently + #"enable=s{1,2}", + "edit", + "force", + "listavailablemaps", + "listmaps|l", + "nohash", + "nomkmap", + "dry-run|n", + "outputdir=s", + "pdftexoutputdir=s", + "pxdvioutputdir=s", + "quiet|silent|q", + # the following is a correct specification of an option according + # to the manual, but it does not work! + # we will treat that option by itself in processOptions + # furthermore, it is not supported by older perls, so do it differently + #"setoption=s@{1,2}", + "showoptions=s@", + "showoption=s@", + "syncwithtrees", + "version", + "help|h", + # some debugging invocations + "_readsave=s", + ); + +my %settings = ( + dvipsPreferOutline => { + type => "binary", + default => "true", + }, + LW35 => { + type => "string", + possible => [ qw/URW URWkb ADOBE ADOBEkb/ ], + default => "URWkb", + }, + dvipsDownloadBase35 => { + type => "binary", + default => "true", + }, + pdftexDownloadBase14 => { + type => "binary", + default => "true", + }, + dvipdfmDownloadBase14 => { + type => "binary", + default => "true", + }, + pxdviUse => { + type => "binary", + default => "false", + }, + kanjiEmbed => { + type => "any", + default => "noEmbed", + }, + kanjiVariant => { + type => "any", + default => "", + }, +); + +&main(); + +############### + +sub main { + processOptions(); + + help() if $opts{'help'}; + + if ($opts{'version'}) { + print version(); + exit (0); + } + + if ($opts{'dvipdfmoutputdir'} && !defined($opts{'dvipdfmxoutputdir'})) { + $opts{'dvipdfmxoutputdir'} = $opts{'dvipdfmoutputdir'}; + printf STDERR "Using --dvipdfmoutputdir options for dvipdfmx, but please use --dvipdfmxoutputdir\n"; + } + + if ($opts{'dvipdfmoutputdir'} && $opts{'dvipdfmxoutputdir'} && + $opts{'dvipdfmoutputdir'} ne $opts{'dvipdfmxoutputdir'}) { + printf STDERR "Options for --dvipdfmoutputdir and --dvipdfmxoutputdir do not agree\nplease use only --dvipdfmxoutputdir. Exiting.\n"; + exit(1); + } + + if ($opts{'_readsave'}) { + read_updmap_files($opts{'_readsave'}); + merge_settings_replace_kanji(); + print "READING DONE ============================\n"; + #print Dumper($alldata); + $alldata->{'updmap'}{$opts{'_readsave'}}{'changed'} = 1; + save_updmap($opts{'_readsave'}); + exit 0; + } + + if ($opts{'showoptions'}) { + for my $o (@{$opts{'showoptions'}}) { + if (defined($settings{$o})) { + if ($settings{$o}{'type'} eq "binary") { + print "true false\n"; + } elsif ($settings{$o}{'type'} eq "string") { + print "@{$settings{$o}{'possible'}}\n"; + } elsif ($settings{$o}{'type'} eq "any") { + print "(any string)\n"; + } else { + print "strange: unknown type of option $o\nplease report\n"; + } + } else { + print "$prg: unknown option: $o\n"; + } + } + exit 0; + } + + # config file for changes + my $changes_config_file; + + # determine which config files should be used + # replaces the former "setupCfgFile" + # + # we also determine here where changes will be saved to + if ($opts{'cnffile'}) { + my @tmp; + for my $f (@{$opts{'cnffile'}}) { + if (! -f $f) { + die "$prg: Config file \"$f\" not found."; + } + push @tmp, (win32() ? lc($f) : $f); + } + @{$opts{'cnffile'}} = @tmp; + # in case that config files are given on the command line, the first + # in the list is the one where changes will be written to. + ($changes_config_file) = @{$opts{'cnffile'}}; + } else { + my @all_files = `kpsewhich -all updmap.cfg`; + chomp(@all_files); + my @used_files; + for my $f (@all_files) { + push @used_files, (win32() ? lc($f) : $f); + } + # + my $TEXMFLOCALVAR; + my @TEXMFLOCAL; + if (win32()) { + chomp($TEXMFLOCALVAR =`kpsewhich --expand-path=\$TEXMFLOCAL`); + @TEXMFLOCAL = map { lc } split(/;/ , $TEXMFLOCALVAR); + } else { + chomp($TEXMFLOCALVAR =`kpsewhich --expand-path='\$TEXMFLOCAL'`); + @TEXMFLOCAL = split /:/ , $TEXMFLOCALVAR; + } + # + # search for TEXMFLOCAL/web2c/updmap.cfg + # check for compatibility with old updmap-local.cfg + my @tmlused; + for my $tml (@TEXMFLOCAL) { + my $TMLabs = Cwd::abs_path($tml); + next if (!$TMLabs); + my $oldfound = 0; + if (-r "$TMLabs/web2c/updmap-local.cfg") { + push @tmlused, "$TMLabs/web2c/updmap-local.cfg"; + warning("Old configuration file\n $TMLabs/web2c/updmap-local.cfg\nfound! "); + $oldfound = 1; + } + if (-r "$TMLabs/web2c/updmap.cfg") { + if ($oldfound) { + warning("Will read it *instead* of\n $TMLabs/web2c/updmap.cfg\n"); + } else { + push @tmlused, "$TMLabs/web2c/updmap.cfg"; + } + } + warning("Please consider moving the information from updmap-local.cfg to\n $TMLabs/web2c/updmap.cfg\n") + if ($oldfound); + } + # + # reorder used files: we move TEXMFLOCAL (if used) just above TEXMFMAIN + # as sysadmins will probably adjust values there + # + # updmap (user): + # ============== + # as found: + # TEXMFCONFIG $HOME/.texliveYYYY/texmf-config/web2c/updmap.cfg + # TEXMFVAR $HOME/.texliveYYYY/texmf-var/web2c/updmap.cfg + # TEXMFHOME $HOME/texmf/web2c/updmap.cfg + # TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg + # TEXMFSYSVAR $TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg + # TEXMFMAIN $TEXLIVE/YYYY/texmf/web2c/updmap.cfg + # TEXMFLOCAL $TEXLIVE/texmf-local/web2c/updmap.cfg + # TEXMFDIST $TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg + # + # as used: + # TEXMFCONFIG $HOME/.texliveYYYY/texmf-config/web2c/updmap.cfg + # TEXMFVAR $HOME/.texliveYYYY/texmf-var/web2c/updmap.cfg + # TEXMFHOME $HOME/texmf/web2c/updmap.cfg + # TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg + # TEXMFSYSVAR $TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg + # TEXMFLOCAL $TEXLIVE/texmf-local/web2c/updmap.cfg + # TEXMFMAIN $TEXLIVE/YYYY/texmf/web2c/updmap.cfg + # TEXMFDIST $TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg + # + # updmap-sys (root): + # ================== + # as found: + # TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg + # TEXMFSYSVAR $TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg + # TEXMFMAIN $TEXLIVE/YYYY/texmf/web2c/updmap.cfg + # TEXMFLOCAL $TEXLIVE/texmf-local/web2c/updmap.cfg + # TEXMFDIST $TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg + # + # as used: + # TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg + # TEXMFSYSVAR $TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg + # TEXMFLOCAL $TEXLIVE/texmf-local/web2c/updmap.cfg + # TEXMFMAIN $TEXLIVE/YYYY/texmf/web2c/updmap.cfg + # TEXMFDIST $TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg + # + if (@tmlused) { + my @tmp; + for my $f (@used_files) { + if ($f =~ m!\Q$TEXMFMAIN/\E!) { + push @tmp, @tmlused; + push @tmp, $f; + } else { + my $pushit = 1; + for my $tml (@TEXMFLOCAL) { + if ($f =~ m!\Q$tml\E!) { + $pushit = 0; + last; + } + } + push @tmp, $f if ($pushit); + } + } + @used_files = @tmp; + } + @{$opts{'cnffile'}} = @used_files; + # + # determine the config file that we will use for changes + # if in the list of used files contains either one from + # TEXMFHOME or TEXMFCONFIG (which is TEXMFSYSCONFIG in the -sys case) + # then use the *top* file (which will be either one of the two), + # if none of the two exists, create a file in TEXMFCONFIG and use it + my $use_top = 0; + for my $f (@used_files) { + if ($f =~ m!(\Q$TEXMFHOME\E|\Q$TEXMFCONFIG\E)/web2c/updmap.cfg!) { + $use_top = 1; + last; + } + } + if ($use_top) { + ($changes_config_file) = @used_files; + } else { + # add the empty config file + my $dn = "$TEXMFCONFIG/web2c"; + $changes_config_file = "$dn/updmap.cfg"; + } + } + if (!$opts{'quiet'}) { + print "$prg is using the following updmap.cfg files (in precedence order):\n"; + for my $f (@{$opts{'cnffile'}}) { + print " $f\n"; + } + print "$prg is using the following updmap.cfg file for writing changes:\n"; + print " $changes_config_file\n"; + } + if ($opts{'listfiles'}) { + # we listed it above, so be done + exit 0; + } + + $alldata->{'changes_config'} = $changes_config_file; + + read_updmap_files(@{$opts{'cnffile'}}); + + if ($opts{'showoption'}) { + merge_settings_replace_kanji(); + for my $o (@{$opts{'showoption'}}) { + if (defined($settings{$o})) { + my ($v, $vo) = get_cfg($o); + $v = "\"$v\"" if ($v =~ m/\s/); + print "$o=$v ($vo)\n"; + } else { + printf STDERR "$prg: unknown option: $o\n"; + } + } + exit 0; + } + + if ($opts{'listmaps'}) { + merge_settings_replace_kanji(); + for my $m (keys %{$alldata->{'maps'}}) { + my $origin = $alldata->{'maps'}{$m}{'origin'}; + print $alldata->{'updmap'}{$origin}{'maps'}{$m}{'type'}, " $m ", + $alldata->{'updmap'}{$origin}{'maps'}{$m}{'status'}, " in $origin\n"; + } + exit 0; + } + + # we do changes always in the used config file with the highest + # priority + my $bakFile = $changes_config_file; + $bakFile =~ s/\.cfg$/.bak/; + my $changed = 0; + + if ($opts{'syncwithtrees'}) { + merge_settings_replace_kanji(); + my @missing = read_map_files(); + if (@missing) { + print "Missing map files found, disabling\n"; + for my $m (@missing) { + my $orig = $alldata->{'maps'}{$m}{'origin'}; + print "\t$m (in $orig)\n"; + } + print "in $changes_config_file\n"; + print "Do you really want to continue (y/N)? "; + my $answer = ; + $answer = "n" if !defined($answer); + chomp($answer); + print "answer =$answer=\n"; + if ($answer ne "y" && $answer ne "Y") { + print "Please fix manually before running updmap(-sys) again!\n"; + exit 0; + } + $changed ||= enable_disable_maps(@missing); + print "finished.\n"; + # the original script did not run any update of the map files here, + # should we do that? + } + exit 0; + } + + $updLSR = &mktexupd(); + $updLSR->{mustexist}(0); + + my $cmd; + if ($opts{'edit'}) { + if ($opts{"dry-run"}) { + printf STDERR "No, are you joking, you want to edit with --dry-run?\n"; + exit 1; + } + # it's not a good idea to edit updmap.cfg manually these days, + # but for compatibility we'll silently keep the option. + $cmd = 'edit'; + my $editor = $ENV{'VISUAL'} || $ENV{'EDITOR'}; + $editor ||= (&win32 ? "notepad" : "vi"); + if (-r $changes_config_file) { + ©File($changes_config_file, $bakFile); + } else { + touch($bakFile); + touch($changes_config_file); + } + system($editor, $changes_config_file); + $changed = files_are_different($bakFile, $changes_config_file); + } elsif ($opts{'setoption'}) { + $cmd = 'setOption'; + $changed = setOptions (@{$opts{'setoption'}}); + } elsif ($opts{'enable'} || $opts{'disable'}) { + $cmd = 'enableMap'; + $changed ||= enable_disable_maps(@{$opts{'enable'}}, @{$opts{'disable'}}); + } + + + if ($cmd && !$opts{'force'} && !$changed) { + print "$changes_config_file unchanged. Map files not recreated.\n" + if !$opts{'quiet'}; + } else { + if (!$opts{'nomkmap'}) { + # before we continue we have to make sure that a newly created config + # file is acually used. So we have to push the $changes_config_file + # onto the list of available files. Since it is already properly + # initialized and the merging is done later, all settings should be + # honored + my @aaa = @{$alldata->{'order'}}; + unshift @aaa, $changes_config_file; + $alldata->{'order'} = [ @aaa ]; + # + setupOutputDir("dvips"); + setupOutputDir("pdftex"); + setupOutputDir("dvipdfmx"); + setupOutputDir("pxdvi"); + merge_settings_replace_kanji(); + my @missing = read_map_files(); + if (@missing) { + print STDERR "\nERROR: The following map file(s) couldn't be found:\n"; + for my $m (@missing) { + my $orig = $alldata->{'maps'}{$m}{'origin'}; + print STDERR "\t$m (in $orig)\n"; + } + print STDERR "\n\tDid you run mktexlsr?\n\n" . + "\tYou can disable non-existent map entries using the option\n". + "\t --syncwithtrees.\n\n"; + exit 1; + } + merge_data(); + # for inspecting the output + #print STDERR Data::Dumper->Dump([$alldata], [qw(mapdata)]); + #print Dumper($alldata); + mkMaps(); + } + unlink ($bakFile) if (-r $bakFile); + } + + if (!$opts{'nohash'}) { + print "$prg: Updating ls-R files.\n" if !$opts{'quiet'}; + $updLSR->{exec}() unless $opts{"dry-run"}; + } + + return 0; +} + +################################################################## +# +# + +sub getFonts { + my ($first, @rest) = @_; + my $getall = 0; + my @maps = (); + return if !defined($first); + if ($first eq "-all") { + $getall = 1; + @maps = @rest; + } else { + @maps = ($first, @rest); + } + my @lines = (); + for my $m (@maps) { + if (defined($alldata->{'maps'}{$m})) { + print LOG "\n" . $alldata->{'maps'}{$m}{'fullpath'} . ":\n" unless $opts{'dry-run'}; + push @lines, "% $m"; + for my $k (sort keys %{$alldata->{'maps'}{$m}{'fonts'}}) { + if ($getall || $alldata->{'fonts'}{$k}{'origin'} eq $m) { + if (defined($alldata->{'maps'}{$m}{'fonts'}{$k})) { + push @lines, "$k " . $alldata->{'maps'}{$m}{'fonts'}{$k}; + } else { + print "undefined fonts for $k in $m ?!?!?\n"; + } + print LOG "$k\n" unless $opts{'dry-run'}; + } + } + } + } + chomp @lines; + return @lines; +} + +############################################################################### +# writeLines() +# write the lines in $filename +# +sub writeLines { + my ($fname, @lines) = @_; + return if $opts{"dry-run"}; + map { ($_ !~ m/\n$/ ? s/$/\n/ : $_ ) } @lines; + open FILE, ">$fname" or die "$prg: can't write lines to $fname: $!"; + print FILE @lines; + close FILE; +} + +############################################################################### +# to_pdftex() +# if $pdftexStripEnc is set, strip "PS_Encoding_Name ReEncodeFont" +# from map entries; they are ignored by pdftex. But since the sh +# incarnation of updmap included them, and we want to minimize +# differences, this is not done by default. +# +sub to_pdftex { + my $pdftexStripEnc = 0; + return @_ unless $pdftexStripEnc; + my @in = @_; + my @out; + foreach my $line (@in) { + if ($line =~ /^(.*\s+)(\S+\s+ReEncodeFont\s)(.*)/) { + $line = "$1$3"; + $line =~ s/\s+\"\s+\"\s+/ /; + } + push @out, $line; + } + return @out; +} + +############################################################################### +# setupSymlinks() +# set symlink for psfonts.map according to dvipsPreferOutline variable +# +sub setupSymlinks { + my ($dvipsPreferOutline, $dvipsoutputdir, $pdftexDownloadBase14, $pdftexoutputdir) = @_; + my $src; + my %link; + my @link; + + if ($dvipsPreferOutline eq "true") { + $src = "psfonts_t1.map"; + } else { + $src = "psfonts_pk.map"; + } + unlink "$dvipsoutputdir/psfonts.map" unless $opts{"dry-run"}; + push @link, &SymlinkOrCopy("$dvipsoutputdir", "$src", "psfonts.map"); + + if ($pdftexDownloadBase14 eq "true") { + $src = "pdftex_dl14.map"; + } else { + $src = "pdftex_ndl14.map"; + } + unlink "$pdftexoutputdir/pdftex.map" unless $opts{"dry-run"}; + push @link, &SymlinkOrCopy("$pdftexoutputdir", "$src", "pdftex.map"); + %link = @link; + return \%link; +} + +############################################################################### +# SymlinkOrCopy(dir, src, dest) +# create symlinks if possible, otherwise copy files +# +sub SymlinkOrCopy { + my ($dir, $src, $dest) = @_; + return ($src, $dest) if $opts{"dry-run"}; + if (&win32 || $opts{'copy'}) { # always copy + ©File("$dir/$src", "$dir/$dest"); + } else { # symlink if supported by fs, copy otherwise + system("cd \"$dir\" && ln -s $src $dest 2>/dev/null || " + . "cp -p \"$dir/$src\" \"$dir/$dest\""); + } + # remember for "Files generated" in &mkMaps. + return ($dest, $src); +} + + +############################################################################### +# transLW35(mode args ...) +# transform fontname and filenames according to transformation specified +# by mode. Possible values: +# URW|URWkb|ADOBE|ADOBEkb +# +sub transLW35 { + my ($mode, @lines) = @_; + + my @psADOBE = ( + 's/ URWGothicL-Demi / AvantGarde-Demi /', + 's/ URWGothicL-DemiObli / AvantGarde-DemiOblique /', + 's/ URWGothicL-Book / AvantGarde-Book /', + 's/ URWGothicL-BookObli / AvantGarde-BookOblique /', + 's/ URWBookmanL-DemiBold / Bookman-Demi /', + 's/ URWBookmanL-DemiBoldItal / Bookman-DemiItalic /', + 's/ URWBookmanL-Ligh / Bookman-Light /', + 's/ URWBookmanL-LighItal / Bookman-LightItalic /', + 's/ NimbusMonL-Bold / Courier-Bold /', + 's/ NimbusMonL-BoldObli / Courier-BoldOblique /', + 's/ NimbusMonL-Regu / Courier /', + 's/ NimbusMonL-ReguObli / Courier-Oblique /', + 's/ NimbusSanL-Bold / Helvetica-Bold /', + 's/ NimbusSanL-BoldCond / Helvetica-Narrow-Bold /', + 's/ NimbusSanL-BoldItal / Helvetica-BoldOblique /', + 's/ NimbusSanL-BoldCondItal / Helvetica-Narrow-BoldOblique /', + 's/ NimbusSanL-Regu / Helvetica /', + 's/ NimbusSanL-ReguCond / Helvetica-Narrow /', + 's/ NimbusSanL-ReguItal / Helvetica-Oblique /', + 's/ NimbusSanL-ReguCondItal / Helvetica-Narrow-Oblique /', + 's/ CenturySchL-Bold / NewCenturySchlbk-Bold /', + 's/ CenturySchL-BoldItal / NewCenturySchlbk-BoldItalic /', + 's/ CenturySchL-Roma / NewCenturySchlbk-Roman /', + 's/ CenturySchL-Ital / NewCenturySchlbk-Italic /', + 's/ URWPalladioL-Bold / Palatino-Bold /', + 's/ URWPalladioL-BoldItal / Palatino-BoldItalic /', + 's/ URWPalladioL-Roma / Palatino-Roman /', + 's/ URWPalladioL-Ital / Palatino-Italic /', + 's/ StandardSymL / Symbol /', + 's/ NimbusRomNo9L-Medi / Times-Bold /', + 's/ NimbusRomNo9L-MediItal / Times-BoldItalic /', + 's/ NimbusRomNo9L-Regu / Times-Roman /', + 's/ NimbusRomNo9L-ReguItal / Times-Italic /', + 's/ URWChanceryL-MediItal / ZapfChancery-MediumItalic /', + 's/ Dingbats / ZapfDingbats /', + ); + + my @fileADOBEkb = ( + 's/\buagd8a.pfb\b/pagd8a.pfb/', + 's/\buagdo8a.pfb\b/pagdo8a.pfb/', + 's/\buagk8a.pfb\b/pagk8a.pfb/', + 's/\buagko8a.pfb\b/pagko8a.pfb/', + 's/\bubkd8a.pfb\b/pbkd8a.pfb/', + 's/\bubkdi8a.pfb\b/pbkdi8a.pfb/', + 's/\bubkl8a.pfb\b/pbkl8a.pfb/', + 's/\bubkli8a.pfb\b/pbkli8a.pfb/', + 's/\bucrb8a.pfb\b/pcrb8a.pfb/', + 's/\bucrbo8a.pfb\b/pcrbo8a.pfb/', + 's/\bucrr8a.pfb\b/pcrr8a.pfb/', + 's/\bucrro8a.pfb\b/pcrro8a.pfb/', + 's/\buhvb8a.pfb\b/phvb8a.pfb/', + 's/\buhvb8ac.pfb\b/phvb8an.pfb/', + 's/\buhvbo8a.pfb\b/phvbo8a.pfb/', + 's/\buhvbo8ac.pfb\b/phvbo8an.pfb/', + 's/\buhvr8a.pfb\b/phvr8a.pfb/', + 's/\buhvr8ac.pfb\b/phvr8an.pfb/', + 's/\buhvro8a.pfb\b/phvro8a.pfb/', + 's/\buhvro8ac.pfb\b/phvro8an.pfb/', + 's/\buncb8a.pfb\b/pncb8a.pfb/', + 's/\buncbi8a.pfb\b/pncbi8a.pfb/', + 's/\buncr8a.pfb\b/pncr8a.pfb/', + 's/\buncri8a.pfb\b/pncri8a.pfb/', + 's/\buplb8a.pfb\b/pplb8a.pfb/', + 's/\buplbi8a.pfb\b/pplbi8a.pfb/', + 's/\buplr8a.pfb\b/pplr8a.pfb/', + 's/\buplri8a.pfb\b/pplri8a.pfb/', + 's/\busyr.pfb\b/psyr.pfb/', + 's/\butmb8a.pfb\b/ptmb8a.pfb/', + 's/\butmbi8a.pfb\b/ptmbi8a.pfb/', + 's/\butmr8a.pfb\b/ptmr8a.pfb/', + 's/\butmri8a.pfb\b/ptmri8a.pfb/', + 's/\buzcmi8a.pfb\b/pzcmi8a.pfb/', + 's/\buzdr.pfb\b/pzdr.pfb/', + ); + + my @fileURW = ( + 's/\buagd8a.pfb\b/a010015l.pfb/', + 's/\buagdo8a.pfb\b/a010035l.pfb/', + 's/\buagk8a.pfb\b/a010013l.pfb/', + 's/\buagko8a.pfb\b/a010033l.pfb/', + 's/\bubkd8a.pfb\b/b018015l.pfb/', + 's/\bubkdi8a.pfb\b/b018035l.pfb/', + 's/\bubkl8a.pfb\b/b018012l.pfb/', + 's/\bubkli8a.pfb\b/b018032l.pfb/', + 's/\bucrb8a.pfb\b/n022004l.pfb/', + 's/\bucrbo8a.pfb\b/n022024l.pfb/', + 's/\bucrr8a.pfb\b/n022003l.pfb/', + 's/\bucrro8a.pfb\b/n022023l.pfb/', + 's/\buhvb8a.pfb\b/n019004l.pfb/', + 's/\buhvb8ac.pfb\b/n019044l.pfb/', + 's/\buhvbo8a.pfb\b/n019024l.pfb/', + 's/\buhvbo8ac.pfb\b/n019064l.pfb/', + 's/\buhvr8a.pfb\b/n019003l.pfb/', + 's/\buhvr8ac.pfb\b/n019043l.pfb/', + 's/\buhvro8a.pfb\b/n019023l.pfb/', + 's/\buhvro8ac.pfb\b/n019063l.pfb/', + 's/\buncb8a.pfb\b/c059016l.pfb/', + 's/\buncbi8a.pfb\b/c059036l.pfb/', + 's/\buncr8a.pfb\b/c059013l.pfb/', + 's/\buncri8a.pfb\b/c059033l.pfb/', + 's/\buplb8a.pfb\b/p052004l.pfb/', + 's/\buplbi8a.pfb\b/p052024l.pfb/', + 's/\buplr8a.pfb\b/p052003l.pfb/', + 's/\buplri8a.pfb\b/p052023l.pfb/', + 's/\busyr.pfb\b/s050000l.pfb/', + 's/\butmb8a.pfb\b/n021004l.pfb/', + 's/\butmbi8a.pfb\b/n021024l.pfb/', + 's/\butmr8a.pfb\b/n021003l.pfb/', + 's/\butmri8a.pfb\b/n021023l.pfb/', + 's/\buzcmi8a.pfb\b/z003034l.pfb/', + 's/\buzdr.pfb\b/d050000l.pfb/', + ); + + my @fileADOBE = ( + 's/\buagd8a.pfb\b/agd_____.pfb/', + 's/\buagdo8a.pfb\b/agdo____.pfb/', + 's/\buagk8a.pfb\b/agw_____.pfb/', + 's/\buagko8a.pfb\b/agwo____.pfb/', + 's/\bubkd8a.pfb\b/bkd_____.pfb/', + 's/\bubkdi8a.pfb\b/bkdi____.pfb/', + 's/\bubkl8a.pfb\b/bkl_____.pfb/', + 's/\bubkli8a.pfb\b/bkli____.pfb/', + 's/\bucrb8a.pfb\b/cob_____.pfb/', + 's/\bucrbo8a.pfb\b/cobo____.pfb/', + 's/\bucrr8a.pfb\b/com_____.pfb/', + 's/\bucrro8a.pfb\b/coo_____.pfb/', + 's/\buhvb8a.pfb\b/hvb_____.pfb/', + 's/\buhvb8ac.pfb\b/hvnb____.pfb/', + 's/\buhvbo8a.pfb\b/hvbo____.pfb/', + 's/\buhvbo8ac.pfb\b/hvnbo___.pfb/', + 's/\buhvr8a.pfb\b/hv______.pfb/', + 's/\buhvr8ac.pfb\b/hvn_____.pfb/', + 's/\buhvro8a.pfb\b/hvo_____.pfb/', + 's/\buhvro8ac.pfb\b/hvno____.pfb/', + 's/\buncb8a.pfb\b/ncb_____.pfb/', + 's/\buncbi8a.pfb\b/ncbi____.pfb/', + 's/\buncr8a.pfb\b/ncr_____.pfb/', + 's/\buncri8a.pfb\b/nci_____.pfb/', + 's/\buplb8a.pfb\b/pob_____.pfb/', + 's/\buplbi8a.pfb\b/pobi____.pfb/', + 's/\buplr8a.pfb\b/por_____.pfb/', + 's/\buplri8a.pfb\b/poi_____.pfb/', + 's/\busyr.pfb\b/sy______.pfb/', + 's/\butmb8a.pfb\b/tib_____.pfb/', + 's/\butmbi8a.pfb\b/tibi____.pfb/', + 's/\butmr8a.pfb\b/tir_____.pfb/', + 's/\butmri8a.pfb\b/tii_____.pfb/', + 's/\buzcmi8a.pfb\b/zcmi____.pfb/', + 's/\buzdr.pfb\b/zd______.pfb/', + ); + + if ($mode eq "" || $mode eq "URWkb") { + # do nothing + } elsif ($mode eq "URW") { + for my $r (@fileURW) { + map { eval($r); } @lines; + } + } elsif ($mode eq "ADOBE" || $mode eq "ADOBEkb") { + for my $r (@psADOBE) { + map { eval($r); } @lines; + } + my @filemode = eval ("\@file" . $mode); + for my $r (@filemode) { + map { eval($r); } @lines; + } + } + return @lines; +} + +############################################################################### +# cidx2dvips() +# reads from stdin, writes to stdout. It transforms "cid-x"-like syntax into +# "dvips"-like syntax. +# +# Specifying the PS Name: +# dvips needs the PSname instead of the file name. Thus we allow specifying +# the PSname in the comment: +# The PS Name can be specified in the font definition line +# by including the following sequence somewhere after the +# other components: +# +# %!PS +# +# where +# is either a space or a tab character +# is *one* word, defined by \w\w* perl re +# is a non-\w char or the end of line +# +# That means we could have +# ... %here the PS font name: %!PS fontname some other comment +# ... %!PS fontname %other comments +# ... %!PS fontname +# +############################################################################### + +# reimplementation of the cryptic code that was there before +sub cidx2dvips { + my ($s) = @_; + my %fname_psname = ( + # Morisawa + 'A-OTF-FutoGoB101Pr6N-Bold' => 'FutoGoB101Pr6N-Bold', + 'A-OTF-FutoGoB101Pro-Bold' => 'FutoGoB101Pro-Bold', + 'A-OTF-FutoMinA101Pr6N-Bold' => 'FutoMinA101Pr6N-Bold', + 'A-OTF-FutoMinA101Pro-Bold' => 'FutoMinA101Pro-Bold', + 'A-OTF-GothicBBBPr6N-Medium' => 'GothicBBBPr6N-Medium', + 'A-OTF-GothicBBBPro-Medium' => 'GothicBBBPro-Medium', + 'A-OTF-Jun101Pr6N-Light' => 'Jun101Pr6N-Light', + 'A-OTF-Jun101Pro-Light' => 'Jun101Pro-Light', + 'A-OTF-MidashiGoPr6N-MB31' => 'MidashiGoPr6N-MB31', + 'A-OTF-MidashiGoPro-MB31' => 'MidashiGoPro-MB31', + 'A-OTF-RyuminPr6N-Light' => 'RyuminPr6N-Light', + 'A-OTF-RyuminPro-Light' => 'RyuminPro-Light', + # Hiragino font file names and PS names are the same + # + # IPA + 'ipaexg' => 'IPAexGothic', + 'ipaexm' => 'IPAexMincho', + 'ipag' => 'IPAGothic', + 'ipam' => 'IPAMincho', + # + # Kozuka font names and PS names are the same + ); + my @d; + foreach (@$s) { + # ship empty lines and comment lines out as is + if (m/^\s*(%.*)?$/) { + push(@d, $_); + next; + } + # get rid of new lines for now + chomp; + # save the line for warnings + my $l = $_; + # first check whether a PSname is given + my $psname; + # + # the matching on \w* is greedy, so will take all the word chars available + # that means we do not need to test for end of word + if ($_ =~ m/%!PS\s\s*([0-9A-Za-z-_][0-9A-Za-z-_]*)/) { + $psname = $1; + } + # remove comments + s/[^0-9A-Za-z-_]*%.*$//; + # replace supported ",SOMETHING" constructs + my $italicmax = 0; + if (m/,BoldItalic/) { + $italicmax = .3; + s/,BoldItalic//; + } + s/,Bold//; + if (m/,Italic/) { + $italicmax = .3; + s/,Italic//; + } + # break out if unsupported constructs are found: @ / , + next if (m![\@/,]!); + # make everything single spaced + s/\s\s*/ /g; + # unicode encoded fonts are not supported + next if (m!^\w\w* unicode !); + # now we have the following format + # some options like -e or -s + if ($_ !~ m/([^ ][^ ]*) ([^ ][^ ]*) ([^ ][^ ]*)( (.*))?$/) { + print STDERR "cidx2dvips warning: Cannot translate font line:\n==> $l\n"; + print STDERR "Current translation status: ==>$_==\n"; + next; + } + my $tfmname = $1; + my $cid = $2; + my $fname = $3; + my $opts = (defined($5) ? " $5" : ""); + # remove extensions from $fname + $fname =~ s/\.[Oo][Tt][Ff]//; + $fname =~ s/\.[Tt][Tt][FfCc]//; + # remove leading ! from $fname + $fname =~ s/^!//; + # remove leading :: from $fname + $fname =~ s/:[0-9]+://; + # remove leading space from $opt + $opts =~ s/^\s+//; + # replace -e and -s in the options + $opts =~ s/-e ([.0-9-][.0-9-]*)/ "$1 ExtendFont"/; + if (m/-s ([.0-9-][.0-9-]*)/) { + if ($italicmax > 0) { + # we have already a definition of SlantFont via ,Italic or ,BoldItalic + # warn the user that larger one is kept + print STDERR "cidx2dvips: warning: Double slant specified via Italic and -s:\n==> $l\n==> Using only the biggest slant value.\n"; + } + $italicmax = $1 if ($1 > $italicmax); + $opts =~ s/-s ([.0-9-][.0-9-]*)//; + } + if ($italicmax != 0) { + $opts .= " \"$italicmax SlantFont\""; + } + # print out the result + if (defined($psname)) { + push @d, "$tfmname $psname-$cid$opts\n"; + } else { + if (defined($fname_psname{$fname})) { + push @d, "$tfmname $fname_psname{$fname}-$cid$opts\n"; + } else { + push @d, "$tfmname $fname-$cid$opts\n"; + } + } + } + return @d; +} + +sub cidx2dvips_old { + my ($s) = @_; + my @d; + foreach (@$s) { + if (m/^%/) { + push(@d, $_); + next; + } + s/,BoldItalic/ -s .3/; + s/,Bold//; + s/,Italic/ -s .3/; + s/\s\s*/ /g; + if ($_ =~ /.*[@\:\/,]/) {next;} + elsif ($_ =~ /^[^ ][^ ]* unicode /) {next;} + s/^([^ ][^ ]* [^ ][^ ]* [^ ][^ ]*)\.[Oo][Tt][Ff]/$1/; + s/^([^ ][^ ]* [^ ][^ ]* [^ ][^ ]*)\.[Tt][Tt][FfCc]/$1/; + s/$/ %/; + s/^(([^ ]*).*)/$1$2/; + s/^([^ ][^ ]* ([^ ][^ ]*) !*([^ ][^ ]*).*)/$1 $3-$2/; + s/^(.* -e ([.0-9-][.0-9-]*).*)/$1 "$2 ExtendFont"/; + s/^(.* -s ([.0-9-][.0-9-]*).*)/$1 "$2 SlantFont"/; + s/.*%//; + push(@d, $_); + } + return @d +} + +sub get_cfg { + my ($v) = @_; + if (defined($alldata->{'merged'}{'setting'}{$v})) { + return ( $alldata->{'merged'}{'setting'}{$v}{'val'}, + $alldata->{'merged'}{'setting'}{$v}{'origin'} ); + } else { + return ($settings{$v}{'default'}, "default"); + } +} + +sub mkMaps { + my $logfile; + + $logfile = "$TEXMFVAR/web2c/updmap.log"; + + if (! $opts{'dry-run'}) { + mkdirhier("$TEXMFVAR/web2c"); + open LOG, ">$logfile" + or die "$prg: Can't open log file \"$logfile\": $!"; + print LOG &version(); + printf LOG "%s\n\n", scalar localtime(); + print LOG "Using the following config files:\n"; + for (@{$opts{'cnffile'}}) { + print LOG " $_\n"; + } + } + sub print_and_log { + my $str=shift; + print $str if !$opts{'quiet'}; + print LOG $str unless $opts{'dry-run'}; + } + sub only_log { + print LOG shift unless $opts{'dry-run'}; + } + + my ($mode, $mode_origin) = get_cfg('LW35'); + my ($dvipsPreferOutline, $dvipsPreferOutline_origin) = + get_cfg('dvipsPreferOutline'); + my ($dvipsDownloadBase35, $dvipsDownloadBase35_origin) = + get_cfg('dvipsDownloadBase35'); + my ($pdftexDownloadBase14, $pdftexDownloadBase14_origin) = + get_cfg('pdftexDownloadBase14'); + my ($pxdviUse, $pxdviUse_origin) = get_cfg('pxdviUse'); + my ($kanjiEmbed, $kanjiEmbed_origin) = get_cfg('kanjiEmbed'); + my ($kanjiVariant, $kanjiVariant_origin) = get_cfg('kanjiVariant'); + + print_and_log ("\n$prg is creating new map files" + . "\nusing the following configuration:" + . "\n LW35 font names : " + . "$mode ($mode_origin)" + . "\n prefer outlines : " + . "$dvipsPreferOutline ($dvipsPreferOutline_origin)" + . "\n texhash enabled : " + . ($opts{'nohash'} ? "false" : "true") + . "\n download standard fonts (dvips) : " + . "$dvipsDownloadBase35 ($dvipsDownloadBase35_origin)" + . "\n download standard fonts (pdftex) : " + . "$pdftexDownloadBase14 ($pdftexDownloadBase14_origin)" + . "\n kanjiEmbed replacement string : " + . "$kanjiEmbed ($kanjiEmbed_origin)" + . "\n kanjiVariant replacement string : " + . "$kanjiVariant ($kanjiVariant_origin)" + . "\n create a mapfile for pxdvi : " + . "$pxdviUse ($pxdviUse_origin)" + . "\n\n"); + + print_and_log ("Scanning for LW35 support files"); + my $dvips35 = $alldata->{'maps'}{"dvips35.map"}{'fullpath'}; + my $pdftex35 = $alldata->{'maps'}{"pdftex35.map"}{'fullpath'}; + my $ps2pk35 = $alldata->{'maps'}{"ps2pk35.map"}{'fullpath'}; + my $LW35 = "\n$dvips35\n$pdftex35\n$ps2pk35\n\n"; + only_log ("\n"); + only_log ($LW35); + print_and_log (" [ 3 files]\n"); + only_log ("\n"); + + print_and_log ("Scanning for MixedMap entries"); + my @mixedmaps; + my @notmixedmaps; + my @kanjimaps; + for my $m (keys %{$alldata->{'maps'}}) { + my $origin = $alldata->{'maps'}{$m}{'origin'}; + next if !defined($origin); + next if ($alldata->{'updmap'}{$origin}{'maps'}{$m}{'status'} eq "disabled"); + push @mixedmaps, $m + if ($alldata->{'updmap'}{$origin}{'maps'}{$m}{'type'} eq "MixedMap"); + push @notmixedmaps, $m + if ($alldata->{'updmap'}{$origin}{'maps'}{$m}{'type'} eq "Map"); + push @kanjimaps, $m + if ($alldata->{'updmap'}{$origin}{'maps'}{$m}{'type'} eq "KanjiMap"); + } + + @mixedmaps = sort @mixedmaps; + @notmixedmaps = sort @notmixedmaps; + @kanjimaps = sort @kanjimaps; + only_log("\n"); + foreach my $m (sort @mixedmaps) { + if (defined($alldata->{'maps'}{$m}{'fullpath'})) { + only_log($alldata->{'maps'}{$m}{'fullpath'} . "\n"); + } else { + only_log("$m (full path not set?)\n"); + } + } + only_log("\n"); + print_and_log (sprintf(" [%3d files]\n", scalar @mixedmaps)); + only_log("\n"); + + print_and_log ("Scanning for KanjiMap entries"); + only_log("\n"); + foreach my $m (@kanjimaps) { + if (defined($alldata->{'maps'}{$m}{'fullpath'})) { + only_log($alldata->{'maps'}{$m}{'fullpath'} . "\n"); + } else { + only_log("$m (full path not set?)\n"); + } + } + only_log("\n"); + print_and_log (sprintf(" [%3d files]\n", scalar @kanjimaps)); + only_log("\n"); + + print_and_log ("Scanning for Map entries"); + only_log("\n"); + foreach my $m (@notmixedmaps) { + if (defined($alldata->{'maps'}{$m}{'fullpath'})) { + only_log($alldata->{'maps'}{$m}{'fullpath'} . "\n"); + } else { + only_log("$m (full path not set?)\n"); + } + } + only_log("\n"); + print_and_log (sprintf(" [%3d files]\n\n", scalar @notmixedmaps)); + only_log("\n"); + + # Create psfonts_t1.map, psfonts_pk.map, ps2pk.map and pdftex.map: + my $dvipsoutputdir = $opts{'dvipsoutputdir'}; + my $pdftexoutputdir = $opts{'pdftexoutputdir'}; + my $dvipdfmxoutputdir = $opts{'dvipdfmxoutputdir'}; + my $pxdvioutputdir = $opts{'pxdvioutputdir'}; + if (!$opts{'dry-run'}) { + my @managed_files = ("$dvipsoutputdir/download35.map", + "$dvipsoutputdir/builtin35.map", + "$dvipsoutputdir/psfonts_t1.map", + "$dvipsoutputdir/psfonts_pk.map", + "$pdftexoutputdir/pdftex_dl14.map", + "$pdftexoutputdir/pdftex_ndl14.map", + "$dvipdfmxoutputdir/kanjix.map", + "$dvipsoutputdir/ps2pk.map"); + push @managed_files, "$pxdvioutputdir/xdvi-ptex.map" + if ($pxdviUse eq "true"); + for my $file (@managed_files) { + open FILE, ">$file"; + print FILE "% $file:\ +% maintained by updmap[-sys] (multi).\ +% Don't change this file directly. Use updmap[-sys] instead.\ +% See the updmap documentation.\ +% A log of the run that created this file is available here:\ +% $logfile\ +"; + close FILE; + } + } + + my @kanjimaps_fonts = getFonts(@kanjimaps); + @kanjimaps_fonts = &normalizeLines(@kanjimaps_fonts); + my @ps2pk_fonts = getFonts('-all', "ps2pk35.map"); + my @dvips35_fonts = getFonts('-all', "dvips35.map"); + my @pdftex35_fonts = getFonts('-all', "pdftex35.map"); + my @mixedmaps_fonts = getFonts(@mixedmaps); + my @notmixedmaps_fonts = getFonts(@notmixedmaps); + + print "Generating output for dvipdfmx...\n" if !$opts{'quiet'}; + &writeLines(">$dvipdfmxoutputdir/kanjix.map", @kanjimaps_fonts); + + if ($pxdviUse eq "true") { + # we use the very same data as for kanjix.map, but generate + # a different file, so that in case a user wants to hand-craft it + print "Generating output for pxdvi...\n" if !$opts{'quiet'}; + &writeLines(">$pxdvioutputdir/xdvi-ptex.map", @kanjimaps_fonts); + } + + + print "Generating output for ps2pk...\n" if !$opts{'quiet'}; + my @ps2pk_map; + push @ps2pk_map, "% ps2pk35.map"; + push @ps2pk_map, transLW35($mode, @ps2pk_fonts); + push @ps2pk_map, @mixedmaps_fonts; + push @ps2pk_map, @notmixedmaps_fonts; + &writeLines(">$dvipsoutputdir/ps2pk.map", + normalizeLines(@ps2pk_map)); + + print "Generating output for dvips...\n" if !$opts{'quiet'}; + my @download35_map; + push @download35_map, "% ps2pk35.map"; + push @download35_map, transLW35($mode, @ps2pk_fonts); + &writeLines(">$dvipsoutputdir/download35.map", + normalizeLines(@download35_map)); + + my @builtin35_map; + push @builtin35_map, "% dvips35.map"; + push @builtin35_map, transLW35($mode, @dvips35_fonts); + &writeLines(">$dvipsoutputdir/builtin35.map", + normalizeLines(@builtin35_map)); + + my @dftdvips_fonts = + (($dvipsDownloadBase35 eq "true") ? @ps2pk_fonts : @dvips35_fonts); + + my @psfonts_t1_map; + if ($dvipsDownloadBase35 eq "true") { + push @psfonts_t1_map, "% ps2pk35.map"; + @dftdvips_fonts = @ps2pk_fonts; + } else { + push @psfonts_t1_map, "% dvips35.map"; + @dftdvips_fonts = @dvips35_fonts; + } + push @psfonts_t1_map, transLW35($mode, @dftdvips_fonts); + my @tmpkanji2 = cidx2dvips(\@kanjimaps_fonts); + push @psfonts_t1_map, @mixedmaps_fonts; + push @psfonts_t1_map, @notmixedmaps_fonts; + push @psfonts_t1_map, @tmpkanji2; + &writeLines(">$dvipsoutputdir/psfonts_t1.map", + normalizeLines(@psfonts_t1_map)); + + my @psfonts_pk_map; + push @psfonts_pk_map, transLW35($mode, @dftdvips_fonts); + push @psfonts_pk_map, @notmixedmaps_fonts; + push @psfonts_pk_map, @tmpkanji2; + &writeLines(">$dvipsoutputdir/psfonts_pk.map", + normalizeLines(@psfonts_pk_map)); + + print "Generating output for pdftex...\n" if !$opts{'quiet'}; + # remove PaintType due to Sebastian's request + my @pdftexmaps_ndl; + push @pdftexmaps_ndl, "% pdftex35.map"; + push @pdftexmaps_ndl, transLW35($mode, @pdftex35_fonts); + push @pdftexmaps_ndl, @mixedmaps_fonts; + push @pdftexmaps_ndl, @notmixedmaps_fonts; + @pdftexmaps_ndl = grep { $_ !~ m/(^%\|PaintType)/ } @pdftexmaps_ndl; + + my @pdftexmaps_dl; + push @pdftexmaps_dl, "% ps2pk35.map"; + push @pdftexmaps_dl, transLW35($mode, @ps2pk_fonts); + push @pdftexmaps_dl, @mixedmaps_fonts; + push @pdftexmaps_dl, @notmixedmaps_fonts; + @pdftexmaps_dl = grep { $_ !~ m/(^%\|PaintType)/ } @pdftexmaps_dl; + + my @pdftex_ndl14_map = @pdftexmaps_ndl; + @pdftex_ndl14_map = &normalizeLines(@pdftex_ndl14_map); + @pdftex_ndl14_map = &to_pdftex(@pdftex_ndl14_map); + &writeLines(">$pdftexoutputdir/pdftex_ndl14.map", @pdftex_ndl14_map); + + my @pdftex_dl14_map = @pdftexmaps_dl; + @pdftex_dl14_map = &normalizeLines(@pdftex_dl14_map); + @pdftex_dl14_map = &to_pdftex(@pdftex_dl14_map); + &writeLines(">$pdftexoutputdir/pdftex_dl14.map", @pdftex_dl14_map); + + our $link = &setupSymlinks($dvipsPreferOutline, $dvipsoutputdir, $pdftexDownloadBase14, $pdftexoutputdir); + + print_and_log ("\nFiles generated:\n"); + sub dir { + my ($d, $f, $target)=@_; + our $link; + if (-e "$d/$f") { + my @stat=lstat("$d/$f"); + my ($s,$m,$h,$D,$M,$Y)=localtime($stat[9]); + my $timestamp=sprintf ("%04d-%02d-%02d %02d:%02d:%02d", + $Y+1900, $M+1, $D, $h, $m, $s); + my $date=sprintf "%12d %s %s", $stat[7], $timestamp, $f; + print_and_log ($date); + + if (-l "$d/$f") { + my $lnk=sprintf " -> %s\n", readlink ("$d/$f"); + print_and_log ($lnk); + } elsif ($f eq $target) { + if (&files_are_identical("$d/$f", "$d/" . $link->{$target})) { + print_and_log (" = $link->{$target}\n"); + } else { + print_and_log (" = ?????\n"); # This shouldn't happen. + } + } else { + print_and_log ("\n"); + } + } else { + print STDERR "Warning: File $d/$f doesn't exist.\n"; + print LOG "Warning: File $d/$f doesn't exist.\n" + unless $opts{'dry-run'}; + } + } + + my $d; + $d = "$dvipsoutputdir"; + print_and_log(" $d:\n"); + foreach my $f ('builtin35.map', 'download35.map', 'psfonts_pk.map', + 'psfonts_t1.map', 'ps2pk.map', 'psfonts.map') { + dir ($d, $f, 'psfonts.map'); + $updLSR->{add}("$d/$f") unless $opts{'dry-run'}; + } + $d = "$pdftexoutputdir"; + print_and_log(" $d:\n"); + foreach my $f ('pdftex_dl14.map', 'pdftex_ndl14.map', 'pdftex.map') { + dir ($d, $f, 'pdftex.map'); + $updLSR->{add}("$d/$f") unless $opts{'dry-run'}; + } + $d="$dvipdfmxoutputdir"; + print_and_log(" $d:\n"); + foreach my $f ('kanjix.map') { + dir ($d, $f, ''); + $updLSR->{add}("$d/$f") unless $opts{'dry-run'}; + } + if ($pxdviUse eq "true") { + $d="$pxdvioutputdir"; + print_and_log(" $d:\n"); + foreach my $f ('xdvi-ptex.map') { + dir ($d, $f, ''); + $updLSR->{add}("$d/$f") unless $opts{'dry-run'}; + } + } + close LOG unless $opts{'dry-run'}; + print "\nTranscript written on \"$logfile\".\n" if !$opts{'quiet'}; + +} + + +sub locateMap { + my $map = shift; + my $ret = `kpsewhich --format=map $map`; + chomp($ret); + return $ret; +} + +sub processOptions { + # first process the stupid setoption= s@{1,2} which is not accepted + # furthermore, try to work around missing s{1,2} support in older perls + my $oldconfig = Getopt::Long::Configure(qw(pass_through)); + our @setoptions; + our @enable; + sub read_one_or_two { + my ($opt, $val) = @_; + our @setoptions; + our @enable; + # check if = occirs in $val, if not, get the next argument + if ($val =~ m/=/) { + if ($opt eq "setoption") { + push @setoptions, $val; + } else { + push @enable, $val; + } + } else { + my $vv = shift @ARGV; + die "Try \"$prg --help\" for more information.\n" + if !defined($vv); + if ($opt eq "setoption") { + push @setoptions, "$val=$vv"; + } else { + push @enable, "$val=$vv"; + } + } + } + GetOptions("setoption=s@" => \&read_one_or_two, + "enable=s@" => \&read_one_or_two) or + die "Try \"$prg --help\" for more information.\n"; + + @{$opts{'setoption'}} = @setoptions if (@setoptions); + @{$opts{'enable'}} = @enable if (@enable); + + Getopt::Long::Configure($oldconfig); + + # now continue with normal option handling + + GetOptions(\%opts, @cmdline_options) or + die "Try \"$prg --help\" for more information.\n"; +} + +# determines the output dir for driver from cmd line, or if not given +# from TEXMFVAR +sub setupOutputDir { + my $driver = shift; + if (!$opts{$driver . "outputdir"}) { + if ($opts{'outputdir'}) { + $opts{$driver . "outputdir"} = $opts{'outputdir'}; + } else { + $opts{$driver . "outputdir"} = "$TEXMFVAR/fonts/map/$driver/updmap"; + } + } + my $od = $opts{$driver . "outputdir"}; + if (!$opts{"dry-run"}) { + &mkdirhier($od); + if (! -w $od) { + die "$prg: Directory \"$od\" isn't writable: $!"; + } + } + print "$driver output dir: \"$od\"\n" if !$opts{'quiet'}; + return $od; +} + +############################################################################### +# setOption (@options) +# parse @options for "key=value" (one element of @options) +# we can only have "key=value" since that is the way it was prepared +# in process_options +# (These were the values provided to --setoption.) +# +sub setOptions { + my (@options) = @_; + for (my $i = 0; $i < @options; $i++) { + my $o = $options[$i]; + + my ($key,$val) = split (/=/, $o, 2); + + die "$prg: unexpected empty key or val for options (@options), goodbye.\n" + if !$key || !defined($val); + + &setOption ($key, $val); + } + return save_updmap($alldata->{'changes_config'}); +} + +sub enable_disable_maps { + my (@what) = @_; + my $tc = $alldata->{'changes_config'}; + die "$prg: top config file $tc has not been read." + if (!defined($alldata->{'updmap'}{$tc})); + my $changed = 0; + + for my $w (@what) { + if ($w =~ m/=/) { + # this is --enable MapType=MapName + my ($type, $map) = split ('=', $w); + enable_map($tc, $type, $map); + } else { + # this is --disable MapName + disable_map($tc, $w); + } + } + return save_updmap($tc); +} + +sub enable_map { + my ($tc, $type, $map) = @_; + + die "$prg: invalid mapType $type" if ($type !~ m/^(Map|MixedMap|KanjiMap)$/); + + if (defined($alldata->{'updmap'}{$tc}{'maps'}{$map})) { + # the map data has already been read in, no special precautions necessary + if (($alldata->{'updmap'}{$tc}{'maps'}{$map}{'status'} eq "enabled") && + ($alldata->{'updmap'}{$tc}{'maps'}{$map}{'type'} eq $type)) { + # nothing to do here ... be happy! + return; + } else { + $alldata->{'updmap'}{$tc}{'maps'}{$map}{'status'} = "enabled"; + $alldata->{'updmap'}{$tc}{'maps'}{$map}{'type'} = $type; + $alldata->{'maps'}{$map}{'origin'} = $tc; + $alldata->{'maps'}{$map}{'status'} = "enabled"; + $alldata->{'updmap'}{$tc}{'changed'} = 1; + } + } else { + # add a new map file! + $alldata->{'updmap'}{$tc}{'maps'}{$map}{'type'} = $type; + $alldata->{'updmap'}{$tc}{'maps'}{$map}{'status'} = "enabled"; + $alldata->{'updmap'}{$tc}{'maps'}{$map}{'line'} = -1; + $alldata->{'updmap'}{$tc}{'changed'} = 1; + $alldata->{'maps'}{$map}{'origin'} = $tc; + $alldata->{'maps'}{$map}{'status'} = "enabled"; + } +} + +sub disable_map { + my ($tc, $map) = @_; + + if (defined($alldata->{'updmap'}{$tc}{'maps'}{$map})) { + # the map data has already been read in, no special precautions necessary + if ($alldata->{'updmap'}{$tc}{'maps'}{$map}{'status'} eq "disabled") { + # nothing to do here ... be happy! + } else { + $alldata->{'updmap'}{$tc}{'maps'}{$map}{'status'} = "disabled"; + $alldata->{'maps'}{$map}{'origin'} = $tc; + $alldata->{'maps'}{$map}{'status'} = "disabled"; + $alldata->{'updmap'}{$tc}{'changed'} = 1; + } + } else { + # disable a Map type that might be activated in a lower ranked updmap.cfg + if (!defined($alldata->{'maps'}{$map})) { + warning("Map is not present anywhere, why should I disable it?\n"); + return; + } + my $orig = $alldata->{'maps'}{$map}{'origin'}; + # add a new entry to the top level where we disable it + # copy over the type from the last entry + $alldata->{'updmap'}{$tc}{'maps'}{$map}{'type'} = + $alldata->{'updmap'}{$orig}{'maps'}{$map}{'type'}; + $alldata->{'updmap'}{$tc}{'maps'}{$map}{'status'} = "disabled"; + $alldata->{'updmap'}{$tc}{'maps'}{$map}{'line'} = -1; + # rewrite the origin + $alldata->{'maps'}{$map}{'origin'} = $tc; + $alldata->{'maps'}{$map}{'status'} = "disabled"; + # go on for writing + $alldata->{'updmap'}{$tc}{'changed'} = 1; + } +} + + +# returns 1 if actually saved due to changes +sub save_updmap { + my $fn = shift; + return if $opts{'dry-run'}; + my %upd = %{$alldata->{'updmap'}{$fn}}; + if ($upd{'changed'}) { + mkdirhier(dirname($fn)); + open (FN, ">$fn") || die "$prg: can't write to $fn: $!"; + my @lines = @{$upd{'lines'}}; + if (!@lines) { + print "Creating new config file $fn\n"; + # update lsR database + $updLSR->{add}($fn); + $updLSR->{exec}(); + # reset the LSR stuff, otherwise we add files several times + $updLSR->{reset}(); + } + # collect the lines with data + my %line_to_setting; + my %line_to_map; + my @add_setting; + my @add_map; + if (defined($upd{'setting'})) { + for my $k (keys %{$upd{'setting'}}) { + if ($upd{'setting'}{$k}{'line'} == -1) { + push @add_setting, $k; + } else { + $line_to_setting{$upd{'setting'}{$k}{'line'}} = $k; + } + } + } + if (defined($upd{'maps'})) { + for my $k (keys %{$upd{'maps'}}) { + if ($upd{'maps'}{$k}{'line'} == -1) { + push @add_map, $k; + } else { + $line_to_map{$upd{'maps'}{$k}{'line'}} = $k; + } + } + } + for my $i (0..$#lines) { + if (defined($line_to_setting{$i})) { + my $k = $line_to_setting{$i}; + my $v = $upd{'setting'}{$k}{'val'}; + print FN "$k $v\n"; + } elsif (defined($line_to_map{$i})) { + my $m = $line_to_map{$i}; + my $rm; + if (defined($upd{'maps'}{$m}{'original'})) { + # we have the case that @noEmbed@ was replaced by the respective + # setting. Before writing out we have to replace this back with + # the original line!A + $rm = $upd{'maps'}{$m}{'original'}; + } else { + $rm = $m; + } + my $t = $upd{'maps'}{$m}{'type'}; + my $p = ($upd{'maps'}{$m}{'status'} eq "disabled" ? "#! " : ""); + print FN "$p$t $rm\n"; + } else { + print FN "$lines[$i]\n"; + } + } + # add the new settings and maps + for my $k (@add_setting) { + my $v = $upd{'setting'}{$k}{'val'}; + print FN "$k $v\n"; + } + for my $m (@add_map) { + my $t = $upd{'maps'}{$m}{'type'}; + my $p = ($upd{'maps'}{$m}{'status'} eq "disabled" ? "#! " : ""); + print FN "$p$t $m\n"; + } + close(FN) || warn("Cannot close file handle for $fn: $!"); + delete $alldata->{'updmap'}{$fn}{'changed'}; + return 1; + } + return 0; +} + +###################### +# check for correct option value +# +sub check_option { + my ($opt, $val) = @_; + if ((($settings{$opt}{'type'} eq "binary") && + $val ne "true" && $val ne "false") || + (($settings{$opt}{'type'} eq "string") && + !member($val, @{$settings{$opt}{'possible'}}))) { + return 0; + } + return 1; +} + +############################################################################### +# setOption (conf_file, option, value) +# sets option to value in the config file (replacing the existing setting +# or by adding a new line to the config file). +# +sub setOption { + my ($opt, $val) = @_; + + die "$prg: Unsupported option $opt." if (!defined($settings{$opt})); + die "$0: Invalid value $val for option $opt." + if (!check_option($opt, $val)); + + # silently accept this old option name, just in case. + return if $opt eq "dvipdfmDownloadBase14"; + + #print "Setting option $opt to $val...\n" if !$opts{'quiet'}; + my $tc = $alldata->{'changes_config'}; + + die "$prg: top config file $tc has not been read." + if (!defined($alldata->{'updmap'}{$tc})); + + if (defined($alldata->{'updmap'}{$tc}{'setting'}{$opt}{'val'})) { + # the value is already set, do nothing + if ($alldata->{'updmap'}{$tc}{'setting'}{$opt}{'val'} eq $val) { + return; + } + $alldata->{'updmap'}{$tc}{'setting'}{$opt}{'val'} = $val; + $alldata->{'updmap'}{$tc}{'changed'} = 1; + } else { + $alldata->{'updmap'}{$tc}{'setting'}{$opt}{'val'} = $val; + $alldata->{'updmap'}{$tc}{'setting'}{$opt}{'line'} = -1; + $alldata->{'updmap'}{$tc}{'changed'} = 1; + } +} + + +############################################################################### +# copyFile() +# copy file $src to $dst, sets $dst creation and mod time +# +sub copyFile { + my ($src, $dst) = @_; + my $dir; + ($dir=$dst)=~s/(.*)\/.*/$1/; + mkdirhier($dir); + + $src eq $dst && return "can't copy $src to itself!\n"; + + open IN, "<$src" or die "$0: can't open source file $src for copying: $!"; + open OUT, ">$dst"; + + binmode(IN); + binmode(OUT); + print OUT ; + close(OUT); + close(IN); + my @t = stat($src); + utime($t[8], $t[9], $dst); +} + +############################################################################### +# files_are_identical(file_A, file_B) +# compare two files. Same as cmp(1). +# +sub files_are_identical { + my $file_A=shift; + my $file_B=shift; + my $retval=0; + + open IN, "$file_A"; + my $A=(); + close IN; + open IN, "$file_B"; + my $B=(); + close IN; + + $retval=1 if ($A eq $B); + return $retval; +} + +############################################################################### +# files_are_different(file_A, file_B[, comment_char]) +# compare two equalized files. +# +sub files_are_different { + my $file_A=shift; + my $file_B=shift; + my $comment=shift; + my $retval=0; + + my $A=equalize_file("$file_A", $comment); + my $B=equalize_file("$file_B", $comment); + $retval=1 unless ($A eq $B); + return $retval; +} + +############################################################################### +# equalize_file(filename[, comment_char]) +# read a file and return its processed content as a string. +# look into the source code for more details. +# +sub equalize_file { + my $file=shift; + my $comment=shift; + my @temp; + + open IN, "$file"; + my @lines = (); + close IN; + chomp(@lines); + + for (@lines) { + s/\s*${comment}.*// if (defined $comment); # remove comments + next if /^\s*$/; # remove empty lines + s/\s+/ /g; # replace multiple whitespace chars by a single one + push @temp, $_; + } + return join('X', sort(@temp)); +} + +############################################################################### +# normalizeLines() +# not the original function, we want it to keep comments, that are +# anyway only the file names we are adding! +# whitespace is exactly one space, no empty lines, +# no whitespace at end of line, one space before and after " +# +sub normalizeLines { + my @lines = @_; + my %count = (); + + # @lines = grep { $_ !~ m/^[*#;%]/ } @lines; + map {$_ =~ s/\s+/ /gx } @lines; + @lines = grep { $_ !~ m/^\s*$/x } @lines; + map { $_ =~ s/\s$//x ; + $_ =~ s/\s*\"\s*/ \" /gx; + $_ =~ s/\" ([^\"]*) \"/\"$1\"/gx; + } @lines; + + # @lines = grep {++$count{$_} < 2 } (sort @lines); + @lines = grep {++$count{$_} < 2 } (@lines); + + return @lines; +} + + +################################################################# +# +# reading updmap-cfg files and the actual map files +# +# the following hash saves *all* the information and is passed around +# we do not fill everything from the very beginning to make sure that +# we only read what is necessary (speed!) +# +# initialized by main +# $alldata->{'changes_config'} = the config file where changes are saved +# +# initialized by read_updmap_files +# $alldata->{'order'} = [ list of updmap in decreasing priority ] +# $alldata->{'updmap'}{$full_path_name_of_updmap}{'lines'} = \@lines +# $alldata->{'updmap'}{$full_path_name_of_updmap}{'setting'}{$key}{'val'} = $val +# $alldata->{'updmap'}{$full_path_name_of_updmap}{'setting'}{$key}{'line'} = $i +# $alldata->{'updmap'}{$full_path_name_of_updmap}{'maps'}{$mapname}{'type'} +# = 'Map'|'MixedMap'|'KanjiMap'|'disabled' +# $alldata->{'updmap'}{$full_path_name_of_updmap}{'maps'}{$mapname}{'status'} +# = 'enabled'|'disabled' +# $alldata->{'updmap'}{$full_path_name_of_updmap}{'maps'}{$mapname}{'line'} = $i +# $alldata->{'maps'}{$m}{'origin'} = $updmap_path_name +# $alldata->{'maps'}{$m}{'status'} = enabled | disabled +# +# initialized by read_map_files +# $alldata->{'maps'}{$m}{'fonts'}{$font} = $definition +# $alldata->{'fonts'}{$f}{'origin'} = $map +# +# initialized by merge_data +# $alldata->{'merged'}{'setting'}{$key}{'val'} = $val +# $alldata->{'merged'}{'setting'}{$key}{'origin'} = $origin_updmap_cfg +# $alldata->{'merged'}{'allMaps'}{'fonts'}{$fontdef} = $rest +# $alldata->{'merged'}{'noMixedMaps'}{'fonts'}{$fontdef} = $rest +# $alldata->{'merged'}{'KanjiMaps'}{'fonts'}{$fontdef} = $rest +# + +sub read_updmap_files { + my (@l) = @_; + for my $l (@l) { + my $updmap = read_updmap_file($l); + $alldata->{'updmap'}{$l}{'lines'} = $updmap->{'lines'}; + if (defined($updmap->{'setting'})) { + for my $k (keys %{$updmap->{'setting'}}) { + $alldata->{'updmap'}{$l}{'setting'}{$k}{'val'} = $updmap->{'setting'}{$k}{'val'}; + $alldata->{'updmap'}{$l}{'setting'}{$k}{'line'} = $updmap->{'setting'}{$k}{'line'}; + } + } + if (defined($updmap->{'maps'})) { + for my $k (keys %{$updmap->{'maps'}}) { + $alldata->{'updmap'}{$l}{'maps'}{$k}{'type'} = $updmap->{'maps'}{$k}{'type'}; + $alldata->{'updmap'}{$l}{'maps'}{$k}{'status'} = $updmap->{'maps'}{$k}{'status'}; + $alldata->{'updmap'}{$l}{'maps'}{$k}{'line'} = $updmap->{'maps'}{$k}{'line'}; + } + } + } + # in case the changes_config is a new one read it in and initialize it here + my $cc = $alldata->{'changes_config'}; + if (! -r $cc) { + $alldata->{'updmap'}{$cc}{'lines'} = [ ]; + } + # + $alldata->{'order'} = \@l; +} + +sub merge_settings_replace_kanji { + # + my @l = @{$alldata->{'order'}}; + # + # for security clean out everything that was there + %{$alldata->{'merged'}} = (); + # + # first read in the settings + # we read it in *reverse* order and simple fill up the combined data + # thus if there are multiple definitions/settings, the one coming from + # the first in the original list will win! + for my $l (reverse @l) { + # merge settings + if (defined($alldata->{'updmap'}{$l}{'setting'})) { + for my $k (keys %{$alldata->{'updmap'}{$l}{'setting'}}) { + $alldata->{'merged'}{'setting'}{$k}{'val'} = $alldata->{'updmap'}{$l}{'setting'}{$k}{'val'}; + $alldata->{'merged'}{'setting'}{$k}{'origin'} = $l; + } + } + } + # + my ($kanjiEmbed, $kanjiEmbed_origin) = get_cfg('kanjiEmbed'); + my ($kanjiVariant, $kanjiVariant_origin) = get_cfg('kanjiVariant'); + # + # go through all map files and check that the text is properly replaced + # after the replacement check that the generated map file actually + # exists, we do NOT want to break in this case! + # + for my $l (@l) { + for my $m (keys %{$alldata->{'updmap'}{$l}{'maps'}}) { + if ($m =~ m/\@kanjiEmbed@/ || $m =~ m/\@kanjiVariant@/) { + my $newm = $m; + $newm =~ s/\@kanjiEmbed@/$kanjiEmbed/; + $newm =~ s/\@kanjiVariant@/$kanjiVariant/; + if (locateMap($newm)) { + # now we have to update various linked items + $alldata->{'updmap'}{$l}{'maps'}{$newm}{'type'} = + $alldata->{'updmap'}{$l}{'maps'}{$m}{'type'}; + $alldata->{'updmap'}{$l}{'maps'}{$newm}{'status'} = + $alldata->{'updmap'}{$l}{'maps'}{$m}{'status'}; + $alldata->{'updmap'}{$l}{'maps'}{$newm}{'line'} = + $alldata->{'updmap'}{$l}{'maps'}{$m}{'line'}; + $alldata->{'updmap'}{$l}{'maps'}{$newm}{'original'} = $m; + } else { + print "$prg: generated map $newm (from $m) does not exists, not activating it!\n"; + } + # in any case delete the @kanji...@ entry line, such a map will + # never exist + delete $alldata->{'updmap'}{$l}{'maps'}{$m}; + } + } + } + # + # first round determine which maps should be used and which type, as + # different updmap.cfg files might specify different types of maps + # (MixedMap or Map or KanjiMap). + # Again, we have to do that in reverse order + for my $l (reverse @l) { + if (defined($alldata->{'updmap'}{$l}{'maps'})) { + for my $m (keys %{$alldata->{'updmap'}{$l}{'maps'}}) { + $alldata->{'maps'}{$m}{'origin'} = $l; + $alldata->{'maps'}{$m}{'status'} = $alldata->{'updmap'}{$l}{'maps'}{$m}{'status'}; + } + } + } +} + +sub read_updmap_file { + my $fn = shift; + my $is_old_local = ($fn =~ m/updmap-local.cfg/ ? 1 : 0); + my %data; + if (!open(FN,"<$fn")) { + die ("Cannot read $fn: $!"); + } + # we count lines from 0 ..!!!! + my $i = -1; + my @lines = ; + chomp(@lines); + $data{'lines'} = [ @lines ]; + close(FN) || warn("Cannot close $fn: $!"); + for (@lines) { + $i++; + chomp; + if ($is_old_local) { + # in case we read an old updmap-local.cfg we have to make sure + # that the disable lines + # ^#!foo.map + # are rewritten to proper disable lines + # ^#! Map foo.map + # we are guessing here the type of the map (namely Map) + $_ =~ s/^#!([^ ])/#! Map $1/; + } + next if /^\s*$/; + next if /^\s*#$/; + next if /^\s*#[^!]/; + next if /^\s*##/; + next if /^#![^ ]/; + # allow for commands on the line itself + s/([^#].*)#.*$/$1/; + my ($a, $b, @rest) = split ' '; + # make sure we get empty strings as arguments + $b = "" if (!defined($b)); + if ($a eq "#!") { + if ($b eq "Map" || $b eq "MixedMap" || $b eq "KanjiMap") { + my $c = shift @rest; + if (!defined($c)) { + warning("$prg: apparently not a real disable line, ignored: $_\n"); + } else { + if (defined($data{'maps'}{$c})) { + warning("$prg: double mention of $c in $fn\n"); + } + $data{'maps'}{$c}{'status'} = 'disabled'; + $data{'maps'}{$c}{'type'} = $b; + $data{'maps'}{$c}{'line'} = $i; + } + } + next; + } + if (@rest) { + warning("$prg: line $i in $fn contains a syntax error, more than two words!\n"); + } + if (defined($settings{$a})) { + if (check_option($a, $b)) { + $data{'setting'}{$a}{'val'} = $b; + $data{'setting'}{$a}{'line'} = $i; + } else { + warning("$prg: unknown setting for $a: $b, ignored!\n"); + } + } elsif ($a eq "Map" || $a eq "MixedMap" || $a eq "KanjiMap") { + if (defined($data{'maps'}{$b}) && $data{'maps'}{$b}{'type'} ne $a) { + warning("$prg: double mention of $b with conflicting types in $fn\n"); + } else { + $data{'maps'}{$b}{'type'} = $a; + $data{'maps'}{$b}{'status'} = 'enabled'; + $data{'maps'}{$b}{'line'} = $i; + } + } else { + warning("$prg: unrecognized line $i in $fn: $_\n"); + } + } + return \%data; +} + +sub read_map_files { + if (!defined($alldata->{'updmap'})) { + return; + } + my @missing; + my @l = @{$alldata->{'order'}}; + # first collect all the map files we are interested in + # and determine whether they exist, and get their full path + my @maps; + for my $f (@l) { + next if !defined($alldata->{'updmap'}{$f}{'maps'}); + for my $m (keys %{$alldata->{'updmap'}{$f}{'maps'}}) { + # only read a map file if its final status is enabled! + push @maps, $m if ($alldata->{'maps'}{$m}{'status'} eq 'enabled'); + } + } + for my $m (qw/dvips35.map pdftex35.map ps2pk35.map/) { + push @maps, $m; + $alldata->{'maps'}{$m}{'status'} = 'enabled'; + } + @maps = sort_uniq(@maps); + my @fullpath = `kpsewhich --format=map @maps`; + chomp @fullpath; + foreach my $map (@maps) { + my ($ff) = grep /\/$map(\.map)?$/, @fullpath; + if ($ff) { + $alldata->{'maps'}{$map}{'fullpath'} = $ff; + } else { + # if the map file is not found, then push it onto the list of + # missing map files, since we know that it is enabled + push @missing, $map; + } + } + + # + # read in the three basic fonts definition maps + for my $m (qw/dvips35.map pdftex35.map ps2pk35.map/) { + my $ret = read_map_file($alldata->{'maps'}{$m}{'fullpath'}); + my @ff = (); + for my $font (keys %$ret) { + $alldata->{'fonts'}{$font}{'origin'} = $m; + $alldata->{'maps'}{$m}{'fonts'}{$font} = $ret->{$font}; + } + } + # we read the updmap in reverse directions, since we + # replace the origin field of font definition always with the + # top one + for my $f (reverse @l) { + my @maps = keys %{$alldata->{'updmap'}{$f}{'maps'}}; + for my $m (@maps) { + # we do not read a map file multiple times, if $alldata{'maps'}{$m} is + # defined we expect that it was read and do skip it + next if defined($alldata->{'maps'}{$m}{'fonts'}); + # we do not read a map files content if it is disabled + next if ($alldata->{'maps'}{$m}{'status'} eq 'disabled'); + if (!defined($alldata->{'maps'}{$m}{'fullpath'})) { + # we have already pushed these map files onto the list of missing + # map files, so do nothing here + next; + } + my $ret = read_map_file($alldata->{'maps'}{$m}{'fullpath'}); + if (defined($ret)) { + for my $font (keys %$ret) { + if (defined($alldata->{'fonts'}{$font})) { + # we got another definition, warn on that + # if the origin is not defined by now, the font is defined + # multiple times in the same map file, otherwise it is + # defined in another map file already + if (defined($alldata->{'fonts'}{$font}{'origin'})) { + my $fontorig = $alldata->{'fonts'}{$font}{'origin'}; + my $maporig; + if (($fontorig eq "ps2pk35.map") || + ($fontorig eq "pdftex35.map") || + ($fontorig eq "dvips35.map")) { + $maporig = "built in map - both used - warning!"; + } else { + $maporig = "from " . $alldata->{'maps'}{$fontorig}{'origin'}; + } + warning("$prg: font $font is defined multiple times:\n"); + warning("$prg: $fontorig ($maporig)\n"); + warning("$prg: $m (from $f) (used)\n"); + } else { + warning("$prg: font $font is multiply defined in $m, using an arbitrary instance!\n"); + } + } + $alldata->{'fonts'}{$font}{'origin'} = $m; + $alldata->{'maps'}{$m}{'fonts'}{$font} = $ret->{$font}; + } + } + } + } + return (@missing); +} + +sub read_map_file { + my $fn = shift; + my @lines; + if (!open(MF,"<$fn")) { + warn("cannot open $fn: $!"); + return; + } + @lines = ; + close(MF); + chomp(@lines); + my %data; + for (@lines) { + next if /^\s*#/; + next if /^\s*%/; + next if /^\s*$/; + my ($a, $b) = split(' ', $_, 2); + $data{$a} = $b; + } + return \%data; +} + +# +# merging the various font definitions +# +sub merge_data { + my @l = @{$alldata->{'order'}}; + # + # now merge the data + # + for my $m (keys %{$alldata->{'maps'}}) { + my $origin = $alldata->{'maps'}{$m}{'origin'}; + next if !defined($origin); + next if ($alldata->{'updmap'}{$origin}{'maps'}{$m}{'status'} eq "disabled"); + for my $f (keys %{$alldata->{'maps'}{$m}{'fonts'}}) { + # use the font definition only for those fonts where the origin matches + if ($alldata->{'fonts'}{$f}{'origin'} eq $m) { + $alldata->{'merged'}{'allMaps'}{'fonts'}{$f} = + $alldata->{'maps'}{$m}{'fonts'}{$f} + if ($alldata->{'updmap'}{$origin}{'maps'}{$m}{'type'} ne "KanjiMap"); + $alldata->{'merged'}{'noMixedMaps'}{'fonts'}{$f} = + $alldata->{'maps'}{$m}{'fonts'}{$f} + if ($alldata->{'updmap'}{$origin}{'maps'}{$m}{'type'} eq "Map"); + $alldata->{'merged'}{'KanjiMap'}{'fonts'}{$f} = + $alldata->{'maps'}{$m}{'fonts'}{$f} + if ($alldata->{'updmap'}{$origin}{'maps'}{$m}{'type'} eq "KanjiMap"); + } + } + } +} + + +# +# $HOME and sudo and updmap-sys horror +# some instances of sudo do not reset $HOME to the home of root +# as an effect of "sudo updmap" creates root owned files in the home +# of a normal user, and "sudo updmap-sys" uses map files and updmap.cfg +# files from the directory of a normal user, but creating files +# in TEXMFSYSCONFIG. This is *all* wrong. +# we check: if we are running as UID 0 (root) on Unix and the +# ENV{HOME} is NOT the same as the one of root, then give a warning +# and reset it to the real home dir of root. + +sub reset_root_home { + if (!win32() && ($> == 0)) { # $> is effective uid + my $envhome = $ENV{'HOME'}; + # if $HOME isn't an existing directory, we don't care. + if (defined($envhome) && (-d $envhome)) { + # we want to avoid calling getpwuid as far as possible, so if + # $envhome is one of some usual values we accept it without worrying. + if ($envhome =~ m,^(/|/root|/var/root)/*$,) { + return; + } + # $HOME is defined, check what is the home of root in reality + my (undef,undef,undef,undef,undef,undef,undef,$roothome) = getpwuid(0); + if (defined($roothome)) { + if ($envhome ne $roothome) { + warning("$prg: resetting \$HOME value (was $envhome) to root's " + . "actual home ($roothome).\n"); + $ENV{'HOME'} = $roothome; + } else { + # envhome and roothome do agree, nothing to do, that is the good case + } + } else { + warning("$prg: home of root not defined, strange!\n"); + } + } + } +} + +sub warning { + print STDERR @_; +} + +# +# help, version etc etc +# + +sub version { + my $ret = sprintf "%s (TeX Live, multi) version %s\n", $prg, $version; + return $ret; +} + +sub help { + my $usage = <<"EOF"; +Usage: $prg [OPTION] ... [COMMAND] + or: $prg-sys [OPTION] ... [COMMAND] + +Update the default font map files used by pdftex, dvips, and dvipdfm(x), +and optionally pxdvi, as determined by all configuration files updmap.cfg +(the ones returned by running "kpsewhich --all updmap.cfg", but see below). + +Among other things, these map files are used to determine which fonts +should be used as bitmaps and which as outlines, and to determine which +font files are included in the PDF or PostScript output. + +By default, the TeX filename database (ls-R) is also updated. + +Options: + --cnffile FILE read FILE for the updmap configuration + (can be given multiple times, in which case + all the files are used) + --dvipdfmxoutputdir DIR specify output directory (dvipdfm(x) syntax) + --dvipsoutputdir DIR specify output directory (dvips syntax) + --pdftexoutputdir DIR specify output directory (pdftex syntax) + --pxdvioutputdir DIR specify output directory (pxdvi syntax) + --outputdir DIR specify output directory (for all files) + --copy cp generic files rather than using symlinks + --force recreate files even if config hasn't changed + --nomkmap do not recreate map files + --nohash do not run texhash + -n, --dry-run only show the configuration, no output + --quiet, --silent reduce verbosity + +Commands: + --help show this message and exit + --version show version information and exit + --showoption OPTION show the current setting of OPTION + --showoptions OPTION show possible settings for OPTION + --setoption OPTION VALUE set OPTION to value; option names below + --setoption OPTION=VALUE as above, just different syntax + --enable MAPTYPE MAPFILE add "MAPTYPE MAPFILE" to updmap.cfg, + where MAPTYPE is Map, MixedMap, or KanjiMap + --enable Map=MAPFILE add \"Map MAPFILE\" to updmap.cfg + --enable MixedMap=MAPFILE add \"MixedMap MAPFILE\" to updmap.cfg + --enable KanjiMap=MAPFILE add \"KanjiMap MAPFILE\" to updmap.cfg + --disable MAPFILE disable MAPFILE, of whatever type + --listmaps list all active and inactive maps + --listavailablemaps same as --listmaps, but without + unavailable map files + --syncwithtrees disable unavailable map files in updmap.cfg + +Explanation of the map types: the (only) difference between Map and +MixedMap is that MixedMap entries are not added to psfonts_pk.map. +The purpose is to help users with devices that render Type 1 outline +fonts worse than mode-tuned Type 1 bitmap fonts. So, MixedMap is used +for fonts that are available as both Type 1 and Metafont. +KanjiMap entries are added to psfonts_t1.map and kanjix.map. + +Explanation of the OPTION names for --showoptions, --showoption, --setoption: + + dvipsPreferOutline true|false (default true) + Whether dvips uses bitmaps or outlines, when both are available. + dvipsDownloadBase35 true|false (default true) + Whether dvips includes the standard 35 PostScript fonts in its output. + pdftexDownloadBase14 true|false (default true) + Whether pdftex includes the standard 14 PDF fonts in its output. + pxdviUse true|false (default false) + Whether maps for pxdvi (Japanese-patched xdvi) are under updmap's control. + kanjiEmbed (any string) + kanjiVariant (any string) + See below. + LW35 URWkb|URW|ADOBEkb|ADOBE (default URWkb) + Adapt the font and file names of the standard 35 PostScript fonts. + URWkb URW fonts with "berry" filenames (e.g. uhvbo8ac.pfb) + URW URW fonts with "vendor" filenames (e.g. n019064l.pfb) + ADOBEkb Adobe fonts with "berry" filenames (e.g. phvbo8an.pfb) + ADOBE Adobe fonts with "vendor" filenames (e.g. hvnbo___.pfb) + + These options are only read and acted on by updmap; dvips, pdftex, etc., + do not know anything about them. They work by changing the default map + file which the programs read, so they can be overridden by specifying + command-line options or configuration files to the programs, as + explained at the beginning of updmap.cfg. + + The options kanjiEmbed and kanjiVariant specify special replacements + in the map lines. If a map contains the string \@kanjiEmbed\@, then + this will be replaced by the value of that option; similarly for + kanjiVariant. In this way, users of Japanese TeX can select different + fonts to be included in the final output. + +Explanation of trees and files normally used: + + If --cnffile is specified on the command line (possibly multiple + times), its value(s) are used. Otherwise, updmap reads all the + updmap.cfg files found by running \`kpsewhich -all updmap.cfg', in the + order returned by kpsewhich, with one exception: an updmap.cfg found + in TEXMFLOCAL is given higher priority than the updmap.cfg in + TEXMFMAIN, to ensure that local adjustments by administrators take + precedence over what is shipped in TeX Live. + + In any case, if multiple updmap.cfg files are found, all the maps + mentioned in all the updmap.cfg files are merged. + + Thus, if updmap.cfg files are present in all trees, and the default + layout is used as shipped with TeX Live, the following files are + read, in the given order. + + For updmap-sys: + TEXMFSYSCONFIG \$TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg + TEXMFSYSVAR \$TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg + TEXMFLOCAL \$TEXLIVE/texmf-local/web2c/updmap.cfg + TEXMFMAIN \$TEXLIVE/YYYY/texmf/web2c/updmap.cfg + TEXMFDIST \$TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg + + For updmap: + TEXMFCONFIG \$HOME/.texliveYYYY/texmf-config/web2c/updmap.cfg + TEXMFVAR \$HOME/.texliveYYYY/texmf-var/web2c/updmap.cfg + TEXMFHOME \$HOME/texmf/web2c/updmap.cfg + TEXMFSYSCONFIG \$TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg + TEXMFSYSVAR \$TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg + TEXMFLOCAL \$TEXLIVE/texmf-local/web2c/updmap.cfg + TEXMFMAIN \$TEXLIVE/YYYY/texmf/web2c/updmap.cfg + TEXMFDIST \$TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg + + (where YYYY is the TeX Live release version). + + There is another exception to keep upgradability from earlier versions + of TeX Live: if a file TEXMFLOCAL/web2c/updmap-local.cfg exists + (formerly used by tlmgr to merge local fonts), then the file + TEXMFLOCAL/web2c/updmap.cfg is ignored (if it exists) and that + updmap-local.cfg is used instead. In this case, updmap recognizes the + previous syntax for disabling map files in updmap-local.cfg (this + syntax is different from what is used now). + + According to the actions, updmap might write to one of the given files + or create a new updmap.cfg, described further below. + + Where changes are saved: if config files are given on the command + line, then the first one given will be used to save any changes from + --setoption, --enable or --disable. If the config files are taken + from kpsewhich output, then the algorithm is more complex: + + 1) If \$TEXMFCONFIG/web2c/updmap.cfg or \$TEXMFHOME/web2c/updmap.cfg + appears in the list of used files, then the one listed first by + kpsewhich --all (equivalently, the one returned by kpsewhich + updmap.cfg), is used. + + 2) If neither of the above two are present and changes are made, a + new config file is created in \$TEXMFCONFIG/web2c/updmap.cfg. + + Resolving multiple definitions of a font: + If a font is defined in more than one map file, then the definition + coming from the first-listed updmap.cfg is used. If a font is + defined multiple times within the same map file, one is chosen + arbitrarily. In both cases a warning is issued. + + Disabling maps: + updmap.cfg files with higher priority (listed earlier) can disable + maps mentioned in lower priority (listed later) updmap.cfg files by + writing, e.g., + \#! Map mapname.map + or + \#! MixedMap mapname.map + in the higher-priority updmap.cfg file. + + As an example, suppose you have a copy of MathTime Pro fonts + and want to disable the Belleek version of the fonts; that is, + disable the map belleek.map. You can create the file + \$TEXMFCONFIG/web2c/updmap.cfg with the content + #! Map belleek.map + Map mt-plus.map + Map mt-yy.map + and call $prg. + + updmap writes the map files for dvips (psfonts.map) and pdftex + (pdftex.map) to the TEXMFVAR/fonts/map/updmap/{dvips,pdftex}/ + directories. + + The log file is written to TEXMFVAR/web2c/updmap.log. + + When updmap-sys is run, TEXMFSYSCONFIG and TEXMFSYSVAR are used + instead of TEXMFCONFIG and TEXMFVAR, respectively. This is the only + difference between updmap-sys and updmap. + + Other locations may be used if you give them on the command line, or + these trees don't exist, or you are not using the original TeX Live. + + To see the precise locations of the various files that + will be read and written, give the -n option (or read the source). + +For step-by-step instructions on making new fonts known to TeX, read +http://tug.org/fonts/fontinstall.html. For even more terse +instructions, read the beginning of updmap.cfg. + +Report bugs to: tex-k\@tug.org +TeX Live home page: +EOF +; + print &version(); + print $usage; + exit 0; +} + +### Local Variables: +### perl-indent-level: 2 +### tab-width: 2 +### indent-tabs-mode: nil +### End: +# vim:set tabstop=2 expandtab: # -- cgit v1.2.3