diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-08-08 14:43:05 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-08-08 14:43:05 +0000 |
commit | c46cd43491e2f371ad919380950f383cf25f0a76 (patch) | |
tree | 719e3208838452c1e9ef7cdd27b2df5ac65601b0 | |
parent | 7c673255c363c3edabb7684db79429502460e9f4 (diff) |
Move remaining tetex/ scripts to texlive/linked_scripts/
git-svn-id: svn://tug.org/texlive/trunk@27343 c570f23f-e606-0410-a88d-b1316a301751
131 files changed, 244 insertions, 55483 deletions
diff --git a/Build/source/ChangeLog b/Build/source/ChangeLog index e00d0e6e808..461b184c4ef 100644 --- a/Build/source/ChangeLog +++ b/Build/source/ChangeLog @@ -1,3 +1,7 @@ +2012-08-08 Peter Breitenlohner <peb@mppmu.mpg.de> + + * Makefile.am: Running texlinks in texk/texlive/linked_scripts. + 2012-07-10 Peter Breitenlohner <peb@mppmu.mpg.de> * Build: Add TL_COMPILER_GFLAGS also to OBJCXXFLAGS. diff --git a/Build/source/Makefile.am b/Build/source/Makefile.am index d0fb6647a1d..960be2eb207 100644 --- a/Build/source/Makefile.am +++ b/Build/source/Makefile.am @@ -88,8 +88,8 @@ world: all @echo "top-level make $@: running install-strip..." $(MAKE) $(AM_MAKEFLAGS) install-strip ## - @echo "top-level make $@: running texlinks in texk/tetex..." - cd texk/tetex && $(MAKE) $(AM_MAKEFLAGS) run-texlinks + @echo "top-level make $@: running texlinks in texk/texlive/linked_scripts..." + cd texk/texlive/linked_scripts && $(MAKE) $(AM_MAKEFLAGS) run-texlinks ## @echo "top-level make $@: running $(check_target)..." $(MAKE) $(AM_MAKEFLAGS) $(check_target) diff --git a/Build/source/Makefile.in b/Build/source/Makefile.in index 338f031a23a..28f8b370d58 100644 --- a/Build/source/Makefile.in +++ b/Build/source/Makefile.in @@ -941,8 +941,8 @@ subsubdir-conf.cmd: world: all @echo "top-level make $@: running install-strip..." $(MAKE) $(AM_MAKEFLAGS) install-strip - @echo "top-level make $@: running texlinks in texk/tetex..." - cd texk/tetex && $(MAKE) $(AM_MAKEFLAGS) run-texlinks + @echo "top-level make $@: running texlinks in texk/texlive/linked_scripts..." + cd texk/texlive/linked_scripts && $(MAKE) $(AM_MAKEFLAGS) run-texlinks @echo "top-level make $@: running $(check_target)..." $(MAKE) $(AM_MAKEFLAGS) $(check_target) @echo "make $@ done." diff --git a/Build/source/texk/tetex/ChangeLog b/Build/source/texk/tetex/ChangeLog index 678e334fdbe..459ffe2f408 100644 --- a/Build/source/texk/tetex/ChangeLog +++ b/Build/source/texk/tetex/ChangeLog @@ -1,13 +1,20 @@ +2012-08-08 Peter Breitenlohner <peb@mppmu.mpg.de> + + * fmtutil*, tcfmgr*, texconfig*, texlinks* (removed): + Moved from here to ../texlive/tetex/. + * Makefile.am: Adapted; run-texlinks rule + 2012-08-07 Peter Breitenlohner <peb@mppmu.mpg.de> * tests/, all*, dvi2fax*, dvired*, fontinst*, kpsetool*, kpsewhere*, ps2frag*, pslatex*, rubibtex*, rumakeindex*, - updmap* (removed): Moved from here to ../texlive/. + updmap* (removed): Moved from here to ../texlive/tetex/. * Makefile.am: Adapted. 2012-08-06 Peter Breitenlohner <peb@mppmu.mpg.de> - * e2pall.man, texdoctk.man, texdoctk.man: Moved to ../texlive/. + * e2pall.man, texdoctk.man, texdoctk.man (removed): Moved from + here to ../texlive/tetex/. * Makefile.am: Adapted. 2012-08-04 Karl Berry <karl@tug.org> diff --git a/Build/source/texk/tetex/Makefile.am b/Build/source/texk/tetex/Makefile.am index 5cffb1cfc63..fec265ce561 100644 --- a/Build/source/texk/tetex/Makefile.am +++ b/Build/source/texk/tetex/Makefile.am @@ -5,89 +5,9 @@ ## ACLOCAL_AMFLAGS = -I ../../m4 -EXTRA_DIST = - -perl_scripts = - -shell_scripts = - -sh_scripts = \ - fmtutil \ - fmtutil-sys \ - texconfig \ - texconfig-dialog \ - texconfig-sys \ - texlinks - -scriptsdir = texmf/scripts/tetex -nodist_bin_SCRIPTS = - -include $(srcdir)/../am/script_links.am - -texmfdir = $(datarootdir)/$(scriptsdir) -dist_texmf_SCRIPTS = $(perl_scripts:=.pl) $(shell_scripts:=.sh) - -if !WIN32 -dist_bin_SCRIPTS = $(sh_scripts) -endif !WIN32 - -CLEANFILES = $(nodist_bin_SCRIPTS) - -dist_man1_MANS = \ - fmtutil.man \ - texconfig.man \ - texlinks.man - -dist_man5_MANS = \ - fmtutil.cnf.5 - -texconfigdir = $(datarootdir)/texmf/texconfig -dist_texconfig_SCRIPTS = tcfmgr -dist_texconfig_DATA = tcfmgr.map - -web2cdir = $(datarootdir)/texmf/web2c -dist_web2c_DATA = fmtutil.cnf - -bin_links = \ - fmtutil:mktexfmt - -include $(top_srcdir)/../am/bin_links.am - -man1_links = $(bin_links) \ - fmtutil:fmtutil-sys \ - texconfig:texconfig-sys - -include $(top_srcdir)/../am/man1_links.am - -install-exec-hook: install-bin-links - -install-data-hook: install-perl-links install-shell-links install-man1-links - -uninstall-hook: uninstall-bin-links uninstall-links uninstall-man1-links - -EXTRA_DIST += \ - README.texdoctk - -## Not used -## -EXTRA_DIST += \ +EXTRA_DIST = \ + README.texdoctk \ old-fontinst.bat \ old-updmap \ updmap-single.pl -## -.PHONY: run-texlinks -## This target is invoked by the top-level make, -## 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/tetex/Makefile.in b/Build/source/texk/tetex/Makefile.in index 4f7b2b169a2..559b558560c 100644 --- a/Build/source/texk/tetex/Makefile.in +++ b/Build/source/texk/tetex/Makefile.in @@ -13,8 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - - VPATH = @srcdir@ am__make_dryrun = \ { \ @@ -49,24 +47,16 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -DIST_COMMON = $(am__configure_deps) $(am__dist_bin_SCRIPTS_DIST) \ - $(dist_man1_MANS) $(dist_man5_MANS) $(dist_texconfig_DATA) \ - $(dist_texconfig_SCRIPTS) $(dist_texmf_SCRIPTS) \ - $(dist_web2c_DATA) $(srcdir)/../am/script_links.am \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/../../build-aux/install-sh \ - $(top_srcdir)/../../build-aux/missing \ - $(top_srcdir)/../am/bin_links.am \ - $(top_srcdir)/../am/man1_links.am $(top_srcdir)/configure \ +subdir = . +DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/../../build-aux/install-sh \ + $(top_srcdir)/../../build-aux/missing $(top_srcdir)/configure \ ../../build-aux/config.guess ../../build-aux/config.sub \ ../../build-aux/depcomp ../../build-aux/install-sh \ ../../build-aux/ltmain.sh ../../build-aux/missing \ ../../build-aux/texinfo.tex ../../build-aux/ylwrap ChangeLog -@WIN32_TRUE@@WIN32_WRAP_TRUE@am__append_1 = $(wrappers) -subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-win32.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -74,41 +64,6 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__dist_bin_SCRIPTS_DIST = fmtutil fmtutil-sys texconfig \ - texconfig-dialog texconfig-sys texlinks -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(texconfigdir)" \ - "$(DESTDIR)$(texmfdir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" \ - "$(DESTDIR)$(texconfigdir)" "$(DESTDIR)$(web2cdir)" -SCRIPTS = $(dist_bin_SCRIPTS) $(dist_texconfig_SCRIPTS) \ - $(dist_texmf_SCRIPTS) $(nodist_bin_SCRIPTS) SOURCES = DIST_SOURCES = am__can_run_installinfo = \ @@ -116,11 +71,6 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -man1dir = $(mandir)/man1 -man5dir = $(mandir)/man5 -NROFF = nroff -MANS = $(dist_man1_MANS) $(dist_man5_MANS) -DATA = $(dist_texconfig_DATA) $(dist_web2c_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -144,23 +94,16 @@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ -DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ -EXEEXT = @EXEEXT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ @@ -168,7 +111,6 @@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ -OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -185,10 +127,7 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -am__include = @am__include@ am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -224,57 +163,18 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I ../../m4 -EXTRA_DIST = ../../build-aux/relpath README.texdoctk old-fontinst.bat \ - old-updmap updmap-single.pl -perl_scripts = -shell_scripts = -sh_scripts = \ - fmtutil \ - fmtutil-sys \ - texconfig \ - texconfig-dialog \ - texconfig-sys \ - texlinks - -scriptsdir = texmf/scripts/tetex -nodist_bin_SCRIPTS = $(am__append_1) -all_scripts = $(lua_scripts) $(perl_scripts) $(shell_scripts) -@WIN32_TRUE@@WIN32_WRAP_TRUE@wrappers = $(all_scripts:=.exe) -@WIN32_TRUE@@WIN32_WRAP_TRUE@runscript = $(top_srcdir)/../../texk/texlive/w32_wrapper/runscript.exe -texmfdir = $(datarootdir)/$(scriptsdir) -dist_texmf_SCRIPTS = $(perl_scripts:=.pl) $(shell_scripts:=.sh) -@WIN32_FALSE@dist_bin_SCRIPTS = $(sh_scripts) -CLEANFILES = $(nodist_bin_SCRIPTS) -dist_man1_MANS = \ - fmtutil.man \ - texconfig.man \ - texlinks.man - -dist_man5_MANS = \ - fmtutil.cnf.5 - -texconfigdir = $(datarootdir)/texmf/texconfig -dist_texconfig_SCRIPTS = tcfmgr -dist_texconfig_DATA = tcfmgr.map -web2cdir = $(datarootdir)/texmf/web2c -dist_web2c_DATA = fmtutil.cnf -bin_links = \ - fmtutil:mktexfmt - -man1_links = $(bin_links) \ - fmtutil:fmtutil-sys \ - texconfig:texconfig-sys - -run_texlinks = $(DESTDIR)$(bindir)/texlinks -v \ - -f $(DESTDIR)$(web2cdir)/fmtutil.cnf \ - -e "$(EXEEXT)" $(DESTDIR)$(bindir) +EXTRA_DIST = \ + README.texdoctk \ + old-fontinst.bat \ + old-updmap \ + updmap-single.pl all: all-am .SUFFIXES: am--refresh: Makefile @: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../am/script_links.am $(top_srcdir)/../am/bin_links.am $(top_srcdir)/../am/man1_links.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -297,7 +197,6 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; -$(srcdir)/../am/script_links.am $(top_srcdir)/../am/bin_links.am $(top_srcdir)/../am/man1_links.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck @@ -307,270 +206,6 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): -install-dist_binSCRIPTS: $(dist_bin_SCRIPTS) - @$(NORMAL_INSTALL) - @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-dist_binSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) -install-dist_texconfigSCRIPTS: $(dist_texconfig_SCRIPTS) - @$(NORMAL_INSTALL) - @list='$(dist_texconfig_SCRIPTS)'; test -n "$(texconfigdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(texconfigdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(texconfigdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(texconfigdir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(texconfigdir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-dist_texconfigSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(dist_texconfig_SCRIPTS)'; test -n "$(texconfigdir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - dir='$(DESTDIR)$(texconfigdir)'; $(am__uninstall_files_from_dir) -install-dist_texmfSCRIPTS: $(dist_texmf_SCRIPTS) - @$(NORMAL_INSTALL) - @list='$(dist_texmf_SCRIPTS)'; test -n "$(texmfdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(texmfdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(texmfdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(texmfdir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(texmfdir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-dist_texmfSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(dist_texmf_SCRIPTS)'; test -n "$(texmfdir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - dir='$(DESTDIR)$(texmfdir)'; $(am__uninstall_files_from_dir) -install-nodist_binSCRIPTS: $(nodist_bin_SCRIPTS) - @$(NORMAL_INSTALL) - @list='$(nodist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-nodist_binSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(nodist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) -install-man1: $(dist_man1_MANS) - @$(NORMAL_INSTALL) - @list1='$(dist_man1_MANS)'; \ - list2=''; \ - test -n "$(man1dir)" \ - && test -n "`echo $$list1$$list2`" \ - || exit 0; \ - echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ - { for i in $$list1; do echo "$$i"; done; \ - if test -n "$$list2"; then \ - for i in $$list2; do echo "$$i"; done \ - | sed -n '/\.1[a-z]*$$/p'; \ - fi; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ - done; } - -uninstall-man1: - @$(NORMAL_UNINSTALL) - @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) -install-man5: $(dist_man5_MANS) - @$(NORMAL_INSTALL) - @list1='$(dist_man5_MANS)'; \ - list2=''; \ - test -n "$(man5dir)" \ - && test -n "`echo $$list1$$list2`" \ - || exit 0; \ - echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ - { for i in $$list1; do echo "$$i"; done; \ - if test -n "$$list2"; then \ - for i in $$list2; do echo "$$i"; done \ - | sed -n '/\.5[a-z]*$$/p'; \ - fi; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ - done; } - -uninstall-man5: - @$(NORMAL_UNINSTALL) - @list='$(dist_man5_MANS)'; test -n "$(man5dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) -install-dist_texconfigDATA: $(dist_texconfig_DATA) - @$(NORMAL_INSTALL) - @list='$(dist_texconfig_DATA)'; test -n "$(texconfigdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(texconfigdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(texconfigdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(texconfigdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(texconfigdir)" || exit $$?; \ - done - -uninstall-dist_texconfigDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_texconfig_DATA)'; test -n "$(texconfigdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(texconfigdir)'; $(am__uninstall_files_from_dir) -install-dist_web2cDATA: $(dist_web2c_DATA) - @$(NORMAL_INSTALL) - @list='$(dist_web2c_DATA)'; test -n "$(web2cdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(web2cdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(web2cdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(web2cdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(web2cdir)" || exit $$?; \ - done - -uninstall-dist_web2cDATA: - @$(NORMAL_UNINSTALL) - @list='$(dist_web2c_DATA)'; test -n "$(web2cdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(web2cdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: @@ -581,19 +216,6 @@ cscope cscopelist: distdir: $(DISTFILES) - @list='$(MANS)'; if test -n "$$list"; then \ - list=`for p in $$list; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ - if test -n "$$list" && \ - grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ - echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \ - grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ - echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ - echo " typically 'make maintainer-clean' will remove them" >&2; \ - exit 1; \ - else :; fi; \ - else :; fi $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -751,11 +373,8 @@ distcleancheck: distclean exit 1; } >&2 check-am: all-am check: check-am -all-am: Makefile $(SCRIPTS) $(MANS) $(DATA) +all-am: Makefile installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(texconfigdir)" "$(DESTDIR)$(texmfdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(texconfigdir)" "$(DESTDIR)$(web2cdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -778,7 +397,6 @@ install-strip: mostlyclean-generic: clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -808,18 +426,14 @@ info: info-am info-am: -install-data-am: install-dist_texconfigDATA \ - install-dist_texconfigSCRIPTS install-dist_texmfSCRIPTS \ - install-dist_web2cDATA install-man - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-data-am: + install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-dist_binSCRIPTS install-nodist_binSCRIPTS - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-exec-am: + install-html: install-html-am install-html-am: @@ -828,7 +442,7 @@ install-info: install-info-am install-info-am: -install-man: install-man1 install-man5 +install-man: install-pdf: install-pdf-am @@ -858,115 +472,23 @@ ps: ps-am ps-am: -uninstall-am: uninstall-dist_binSCRIPTS uninstall-dist_texconfigDATA \ - uninstall-dist_texconfigSCRIPTS uninstall-dist_texmfSCRIPTS \ - uninstall-dist_web2cDATA uninstall-man \ - uninstall-nodist_binSCRIPTS - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) uninstall-hook -uninstall-man: uninstall-man1 uninstall-man5 +uninstall-am: -.MAKE: install-am install-data-am install-exec-am install-strip \ - uninstall-am +.MAKE: install-am install-strip .PHONY: all all-am am--refresh check check-am clean clean-generic dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ - install-data-am install-data-hook install-dist_binSCRIPTS \ - install-dist_texconfigDATA install-dist_texconfigSCRIPTS \ - install-dist_texmfSCRIPTS install-dist_web2cDATA install-dvi \ - install-dvi-am install-exec install-exec-am install-exec-hook \ - install-html install-html-am install-info install-info-am \ - install-man install-man1 install-man5 \ - install-nodist_binSCRIPTS install-pdf install-pdf-am \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ - pdf-am ps ps-am uninstall uninstall-am \ - uninstall-dist_binSCRIPTS uninstall-dist_texconfigDATA \ - uninstall-dist_texconfigSCRIPTS uninstall-dist_texmfSCRIPTS \ - uninstall-dist_web2cDATA uninstall-hook uninstall-man \ - uninstall-man1 uninstall-man5 uninstall-nodist_binSCRIPTS - -.PHONY: install-lua-links install-perl-links install-shell-links \ - install-links uninstall-links -@WIN32_TRUE@@WIN32_WRAP_TRUE@$(wrappers): $(runscript) -@WIN32_TRUE@@WIN32_WRAP_TRUE@ $(LN_S) $(runscript) $@ - -install-lua-links: -@WIN32_FALSE@ $(MAKE) $(AM_MAKEFLAGS) TYPE=lua EXT=lua install-links - -install-perl-links: -@WIN32_FALSE@ $(MAKE) $(AM_MAKEFLAGS) TYPE=perl EXT=pl install-links - -install-shell-links: -@WIN32_FALSE@ $(MAKE) $(AM_MAKEFLAGS) TYPE=shell EXT=sh install-links - -# 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 -z "$$REL"; then \ - echo 'unable to compute relative path for linked $(TYPE) scripts' >&2; \ - exit 1; \ - fi; \ - cd $(DESTDIR)$(bindir) && \ - for f in $($(TYPE)_scripts); do \ - rm -f $$f; \ - echo "creating link '$$f' -> '$$REL/$(scriptsdir)/$$f.$(EXT)'"; \ - $(LN_S) $$REL/$(scriptsdir)/$$f.$(EXT) $$f || exit 1; \ - done - -uninstall-links: -@WIN32_FALSE@ @for f in $(all_scripts); do \ -@WIN32_FALSE@ echo "rm -f '$(DESTDIR)$(bindir)/$$f'"; \ -@WIN32_FALSE@ rm -f "$(DESTDIR)$(bindir)/$$f"; \ -@WIN32_FALSE@ done -.PHONY: install-bin-links uninstall-bin-links - -install-bin-links: -@WIN32_FALSE@ @cd $(DESTDIR)$(bindir) && \ -@WIN32_FALSE@ for s in $(bin_links); do \ -@WIN32_FALSE@ link=`echo $$s | sed 's,.*:,,'`; \ -@WIN32_FALSE@ file=`echo $$s | sed 's,:.*,,'`; \ -@WIN32_FALSE@ rm -f $$link; \ -@WIN32_FALSE@ echo "creating link '$$link' -> '$$file'"; \ -@WIN32_FALSE@ $(LN_S) $$file $$link || exit 1; \ -@WIN32_FALSE@ done - -uninstall-bin-links: -@WIN32_FALSE@ @for s in $(bin_links); do \ -@WIN32_FALSE@ link=`echo $$s | sed 's,.*:,,'`; \ -@WIN32_FALSE@ rm -f $(DESTDIR)$(bindir)/$$link; \ -@WIN32_FALSE@ done -.PHONY: install-man1-links uninstall-man1-links - -install-man1-links: - @cd $(DESTDIR)$(man1dir) && \ - for s in $(man1_links); do \ - link=`echo $$s | sed 's,.*:,,'`; \ - file=`echo $$s | sed 's,:.*,,'`; \ - rm -f $$link.1; \ - echo "creating link '$$link.1' -> '$$file.1'"; \ - echo ".so man1/$$file.1" >$$link.1; \ - done - -uninstall-man1-links: - @for s in $(man1_links); do \ - link=`echo $$s | sed 's,.*:,,'`; \ - rm -f $(DESTDIR)$(man1dir)/$$link.1; \ - done - -install-exec-hook: install-bin-links - -install-data-hook: install-perl-links install-shell-links install-man1-links - -uninstall-hook: uninstall-bin-links uninstall-links uninstall-man1-links + pdf-am ps ps-am uninstall uninstall-am -.PHONY: run-texlinks -run-texlinks: -@WIN32_FALSE@ PATH="$(DESTDIR)$(bindir):$(PATH)"; export PATH; $(run_texlinks) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/Build/source/texk/tetex/aclocal.m4 b/Build/source/texk/tetex/aclocal.m4 index 31fb1531754..62d7c70171d 100644 --- a/Build/source/texk/tetex/aclocal.m4 +++ b/Build/source/texk/tetex/aclocal.m4 @@ -147,273 +147,6 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2012 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 17 - -# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], - [$1], [CXX], [depcc="$CXX" am_compiler_list=], - [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], - [$1], [UPC], [depcc="$UPC" am_compiler_list=], - [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES. -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE([dependency-tracking], [dnl -AS_HELP_STRING( - [--enable-dependency-tracking], - [do not reject slow dependency extractors]) -AS_HELP_STRING( - [--disable-dependency-tracking], - [speeds up one-time build])]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999-2012 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 6 - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Autoconf 2.62 quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) - # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2012 Free Software Foundation, Inc. @@ -653,58 +386,6 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001-2012 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 5 - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2012 Free Software Foundation, Inc. @@ -1011,4 +692,3 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([../../m4/kpse-win32.m4]) diff --git a/Build/source/texk/tetex/configure b/Build/source/texk/tetex/configure index 947b0e830cf..9a7d5f1a65d 100755 --- a/Build/source/texk/tetex/configure +++ b/Build/source/texk/tetex/configure @@ -584,33 +584,10 @@ PACKAGE_STRING='teTeX for TeX Live 3.0' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' -ac_unique_file="texconfig" -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS +ac_unique_file="README.texdoctk" +ac_subst_vars='LTLIBOBJS LIBOBJS -WIN32_WRAP_FALSE -WIN32_WRAP_TRUE -WIN32_FALSE -WIN32_TRUE LN_S -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -am__nodep -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__quote -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE @@ -679,16 +656,10 @@ ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode -enable_dependency_tracking ' ac_precious_vars='build_alias host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS' +target_alias' # Initialize some variables set by options. @@ -1307,22 +1278,6 @@ Optional Features: --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer - --enable-dependency-tracking - do not reject slow dependency extractors - --disable-dependency-tracking - speeds up one-time build - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a - nonstandard directory <lib dir> - LIBS libraries to pass to the linker, e.g. -l<library> - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if - you have headers in a nonstandard directory <include dir> - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. Report bugs to <tex-k@tug.org>. _ACEOF @@ -1400,44 +1355,6 @@ fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -2340,986 +2257,6 @@ fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdio.h> -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } @@ -3364,70 +2301,6 @@ $as_echo "no" >&6; } fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for native WIN32 or MINGW32" >&5 -$as_echo_n "checking for native WIN32 or MINGW32... " >&6; } -if ${kpse_cv_have_win32+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef WIN32 - choke me -#endif -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __MINGW32__ - choke me -#endif -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - kpse_cv_have_win32=mingw32 -else - kpse_cv_have_win32=native -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - kpse_cv_have_win32=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $kpse_cv_have_win32" >&5 -$as_echo "$kpse_cv_have_win32" >&6; } - - if test "x$kpse_cv_have_win32" != xno; then - WIN32_TRUE= - WIN32_FALSE='#' -else - WIN32_TRUE='#' - WIN32_FALSE= -fi - - if test -r $srcdir/../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" @@ -3584,34 +2457,11 @@ $as_echo_n "checking that generated files are newer than configure... " >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -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 @@ -4032,7 +2882,6 @@ esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" -config_commands="$ac_config_commands" _ACEOF @@ -4057,9 +2906,6 @@ Usage: $0 [OPTION]... [TAG]... Configuration files: $config_files -Configuration commands: -$config_commands - Report bugs to <tex-k@tug.org>." _ACEOF @@ -4171,11 +3017,6 @@ _ASBOX _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 @@ -4184,7 +3025,6 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 for ac_config_target in $ac_config_targets do case $ac_config_target in - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; @@ -4198,7 +3038,6 @@ done # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -4387,7 +3226,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" -eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +eval set X " :F $CONFIG_FILES " shift for ac_tag do @@ -4608,108 +3447,9 @@ which seems to be undefined. Please make sure it is defined" >&2;} ;; - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} - ;; - esac done # for ac_tag diff --git a/Build/source/texk/tetex/configure.ac b/Build/source/texk/tetex/configure.ac index 4562c108782..29c8d1bb837 100644 --- a/Build/source/texk/tetex/configure.ac +++ b/Build/source/texk/tetex/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. dnl -dnl Copyright (C) 2009, 2010 Peter Breitenlohner <tex-live@tug.org> +dnl Copyright (C) 2009-2012 Peter Breitenlohner <tex-live@tug.org> dnl dnl This file is free software; the copyright holder dnl gives unlimited permission to copy and/or distribute it, @@ -8,23 +8,17 @@ dnl with or without modifications, as long as this notice is preserved. dnl AC_INIT([teTeX for TeX Live], [3.0], [tex-k@tug.org]) AC_PREREQ([2.65]) -AC_CONFIG_SRCDIR([texconfig]) +AC_CONFIG_SRCDIR([README.texdoctk]) AC_CONFIG_AUX_DIR([../../build-aux]) AC_CONFIG_MACRO_DIR([../../m4]) AM_INIT_AUTOMAKE([foreign]) AM_MAINTAINER_MODE -AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET -KPSE_CHECK_WIN32 -AM_CONDITIONAL([WIN32], [test "x$kpse_cv_have_win32" != xno]) -AM_CONDITIONAL([WIN32_WRAP], - [test -r $srcdir/../texlive/w32_wrapper/runscript.exe]) - AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/Build/source/texk/texlive/linked_scripts/ChangeLog b/Build/source/texk/texlive/linked_scripts/ChangeLog index 03fb5409e55..fdb39a77964 100644 --- a/Build/source/texk/texlive/linked_scripts/ChangeLog +++ b/Build/source/texk/texlive/linked_scripts/ChangeLog @@ -1,3 +1,9 @@ +2012-08-08 Peter Breitenlohner <peb@mppmu.mpg.de> + + * fmtutil*, tcfmgr*, texconfig*, texlinks* (new): Moved from + ../../tetex/ to ./tetex/. + * Makefile.am: Moved run-texlinks rule from /../tetex/ to here. + 2012-08-07 Peter Breitenlohner <peb@mppmu.mpg.de> * updmap.help2man, tetex/all*, tetex/dvi2fax*, tetex/dvired*, diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.am b/Build/source/texk/texlive/linked_scripts/Makefile.am index bb1a82b9cc6..911a98b2fac 100644 --- a/Build/source/texk/texlive/linked_scripts/Makefile.am +++ b/Build/source/texk/texlive/linked_scripts/Makefile.am @@ -39,8 +39,14 @@ texmf_scriptsdir = $(datarootdir)/texmf/scripts ## We distinguish shell and other (perl, lua, python, ruby, ...) scripts. ## Some shell scripts are, however, listed under *_other_scripts because ## they are correctly handled by ../w32_wrapper/runscript.exe. -texmf_shell_scripts = +texmf_shell_scripts = \ + tetex/fmtutil.sh \ + tetex/texconfig.sh \ + tetex/texconfig-dialog.sh \ + tetex/texconfig-sys.sh \ + tetex/texlinks.sh texmf_other_scripts = \ + tetex/fmtutil-sys.sh \ texlive/rungs.tlu \ texlive/tlmgr.pl nobase_dist_texmf_scripts_SCRIPTS = \ @@ -163,6 +169,7 @@ bin_links = \ if !WIN32 bin_links += \ allcm:allec \ + fmtutil:mktexfmt \ kpsetool:kpsexpand \ kpsetool:kpsepath \ lua2dox_lua:lua2dox_filter @@ -176,6 +183,8 @@ dist_man_MANS = \ tetex/dvi2fax.1 \ tetex/dvired.1 \ tetex/e2pall.1 \ + tetex/fmtutil.1 \ + tetex/fmtutil.cnf.5 \ tetex/fontinst.1 \ tetex/kpsetool.1 \ tetex/kpsewhere.1 \ @@ -183,18 +192,31 @@ dist_man_MANS = \ tetex/pslatex.1 \ tetex/rubibtex.1 \ tetex/rumakeindex.1 \ + tetex/texconfig.1 \ tetex/texdoctk.1 \ + tetex/texlinks.1 \ tetex/updmap.1 \ tetex/updmap.cfg.5 \ thumbpdf/thumbpdf.1 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 = tetex/tcfmgr +dist_texconfig_DATA = tetex/tcfmgr.map + +web2cdir = $(datarootdir)/texmf/web2c +dist_web2c_DATA = tetex/fmtutil.cnf + # The idea is to install the scripts themselves in texmf*/scripts, and # have bin/arch/foo be a symlink to, say, # ../../texmf-dist/scripts/foo/foo.pl. That way we save a bit of disk @@ -299,12 +321,30 @@ if !WIN32 endif !WIN32 ## Generate the updmap man page using help2man plus a bit of -## handwritten material. But don't actually update updmap.man, +## 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 tetex/updmap.pl +xupdmap.1: tetex/updmap.help2man tetex/updmap.pl help2man --include=$< --source="TeX Live" --no-info \ $(srcdir)/tetex/updmap.pl >/tmp/$@ -EXTRA_DIST += updmap.help2man +EXTRA_DIST += tetex/updmap.help2man + +## +web2cdir = $(datarootdir)/texmf/web2c + +.PHONY: run-texlinks +## This target is invoked by the top-level make, +## 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/linked_scripts/Makefile.in b/Build/source/texk/texlive/linked_scripts/Makefile.in index cec18178b8f..8b9ce5e8991 100644 --- a/Build/source/texk/texlive/linked_scripts/Makefile.in +++ b/Build/source/texk/texlive/linked_scripts/Makefile.in @@ -14,6 +14,7 @@ @SET_MAKE@ + VPATH = @srcdir@ am__make_dryrun = \ { \ @@ -50,11 +51,13 @@ PRE_UNINSTALL = : POST_UNINSTALL = : @WIN32_FALSE@am__append_1 = \ @WIN32_FALSE@ allcm:allec \ +@WIN32_FALSE@ fmtutil:mktexfmt \ @WIN32_FALSE@ kpsetool:kpsexpand \ @WIN32_FALSE@ kpsetool:kpsepath \ @WIN32_FALSE@ lua2dox_lua:lua2dox_filter -DIST_COMMON = README $(dist_man_MANS) \ +DIST_COMMON = README $(dist_man_MANS) $(dist_texconfig_DATA) \ + $(dist_texconfig_SCRIPTS) $(dist_web2c_DATA) \ $(nobase_dist_texmf_dist_scripts_SCRIPTS) \ $(nobase_dist_texmf_scripts_SCRIPTS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/../am/man1_links.am \ @@ -95,11 +98,13 @@ am__uninstall_files_from_dir = { \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(bindir)" \ +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(texconfigdir)" \ "$(DESTDIR)$(texmf_dist_scriptsdir)" \ "$(DESTDIR)$(texmf_scriptsdir)" "$(DESTDIR)$(man1dir)" \ - "$(DESTDIR)$(man5dir)" -SCRIPTS = $(bin_SCRIPTS) $(nobase_dist_texmf_dist_scripts_SCRIPTS) \ + "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(texconfigdir)" \ + "$(DESTDIR)$(web2cdir)" +SCRIPTS = $(bin_SCRIPTS) $(dist_texconfig_SCRIPTS) \ + $(nobase_dist_texmf_dist_scripts_SCRIPTS) \ $(nobase_dist_texmf_scripts_SCRIPTS) SOURCES = DIST_SOURCES = @@ -112,6 +117,7 @@ man1dir = $(mandir)/man1 man5dir = $(mandir)/man5 NROFF = nroff MANS = $(dist_man_MANS) +DATA = $(dist_texconfig_DATA) $(dist_web2c_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -220,7 +226,8 @@ DISTCLEANFILES = scripts-list # # We support native builds, multiplatform or not, as well as distro builds. # -EXTRA_DIST = scripts.lst ../../../build-aux/relpath updmap.help2man +EXTRA_DIST = scripts.lst ../../../build-aux/relpath \ + tetex/updmap.help2man bin_SCRIPTS = # Copies of these scripts exist here for the sake of avoiding @@ -228,8 +235,15 @@ bin_SCRIPTS = # The instances in texmf* are the masters (except when it is CTAN). # texmf_scriptsdir = $(datarootdir)/texmf/scripts -texmf_shell_scripts = +texmf_shell_scripts = \ + tetex/fmtutil.sh \ + tetex/texconfig.sh \ + tetex/texconfig-dialog.sh \ + tetex/texconfig-sys.sh \ + tetex/texlinks.sh + texmf_other_scripts = \ + tetex/fmtutil-sys.sh \ texlive/rungs.tlu \ texlive/tlmgr.pl @@ -356,6 +370,8 @@ dist_man_MANS = \ tetex/dvi2fax.1 \ tetex/dvired.1 \ tetex/e2pall.1 \ + tetex/fmtutil.1 \ + tetex/fmtutil.cnf.5 \ tetex/fontinst.1 \ tetex/kpsetool.1 \ tetex/kpsewhere.1 \ @@ -363,19 +379,33 @@ dist_man_MANS = \ tetex/pslatex.1 \ tetex/rubibtex.1 \ tetex/rumakeindex.1 \ + tetex/texconfig.1 \ tetex/texdoctk.1 \ + tetex/texlinks.1 \ tetex/updmap.1 \ tetex/updmap.cfg.5 \ thumbpdf/thumbpdf.1 man1_links = \ + fmtutil:fmtutil-sys \ kpsetool:kpsexpand \ kpsetool:kpsepath \ + fmtutil:mktexfmt \ + texconfig:texconfig-sys \ updmap:updmap-sys +texconfigdir = $(datarootdir)/texmf/texconfig +dist_texconfig_SCRIPTS = tetex/tcfmgr +dist_texconfig_DATA = tetex/tcfmgr.map +web2cdir = $(datarootdir)/texmf/web2c +dist_web2c_DATA = tetex/fmtutil.cnf relpath = $(SHELL) $(top_srcdir)/../../build-aux/relpath runscript = $(top_srcdir)/w32_wrapper/runscript.exe @WIN32_TRUE@WINEXT = $(EXEEXT) +run_texlinks = $(DESTDIR)$(bindir)/texlinks -v \ + -f $(DESTDIR)$(web2cdir)/fmtutil.cnf \ + -e "$(EXEEXT)" $(DESTDIR)$(bindir) + all: all-am .SUFFIXES: @@ -445,6 +475,41 @@ uninstall-binSCRIPTS: files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) +install-dist_texconfigSCRIPTS: $(dist_texconfig_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(dist_texconfig_SCRIPTS)'; test -n "$(texconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(texconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(texconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(texconfigdir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(texconfigdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-dist_texconfigSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(dist_texconfig_SCRIPTS)'; test -n "$(texconfigdir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(texconfigdir)'; $(am__uninstall_files_from_dir) install-nobase_dist_texmf_dist_scriptsSCRIPTS: $(nobase_dist_texmf_dist_scripts_SCRIPTS) @$(NORMAL_INSTALL) @list='$(nobase_dist_texmf_dist_scripts_SCRIPTS)'; test -n "$(texmf_dist_scriptsdir)" || list=; \ @@ -615,6 +680,48 @@ uninstall-man5: } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) +install-dist_texconfigDATA: $(dist_texconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_texconfig_DATA)'; test -n "$(texconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(texconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(texconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(texconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(texconfigdir)" || exit $$?; \ + done + +uninstall-dist_texconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_texconfig_DATA)'; test -n "$(texconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(texconfigdir)'; $(am__uninstall_files_from_dir) +install-dist_web2cDATA: $(dist_web2c_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_web2c_DATA)'; test -n "$(web2cdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(web2cdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(web2cdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(web2cdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(web2cdir)" || exit $$?; \ + done + +uninstall-dist_web2cDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_web2c_DATA)'; test -n "$(web2cdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(web2cdir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: @@ -669,9 +776,9 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(SCRIPTS) $(MANS) all-local +all-am: Makefile $(SCRIPTS) $(MANS) $(DATA) all-local installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(texmf_dist_scriptsdir)" "$(DESTDIR)$(texmf_scriptsdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(texconfigdir)" "$(DESTDIR)$(texmf_dist_scriptsdir)" "$(DESTDIR)$(texmf_scriptsdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(texconfigdir)" "$(DESTDIR)$(web2cdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -725,8 +832,9 @@ info: info-am info-am: -install-data-am: install-man \ - install-nobase_dist_texmf_dist_scriptsSCRIPTS \ +install-data-am: install-dist_texconfigDATA \ + install-dist_texconfigSCRIPTS install-dist_web2cDATA \ + install-man install-nobase_dist_texmf_dist_scriptsSCRIPTS \ install-nobase_dist_texmf_scriptsSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook @@ -772,8 +880,9 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binSCRIPTS uninstall-man \ - uninstall-nobase_dist_texmf_dist_scriptsSCRIPTS \ +uninstall-am: uninstall-binSCRIPTS uninstall-dist_texconfigDATA \ + uninstall-dist_texconfigSCRIPTS uninstall-dist_web2cDATA \ + uninstall-man uninstall-nobase_dist_texmf_dist_scriptsSCRIPTS \ uninstall-nobase_dist_texmf_scriptsSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook @@ -784,17 +893,20 @@ uninstall-man: uninstall-man1 uninstall-man5 .PHONY: all all-am all-local check check-am clean clean-generic \ distclean distclean-generic distdir dvi dvi-am html html-am \ info info-am install install-am install-binSCRIPTS \ - install-data install-data-am install-data-hook install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-man1 install-man5 \ + install-data install-data-am install-data-hook \ + install-dist_texconfigDATA install-dist_texconfigSCRIPTS \ + install-dist_web2cDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-man1 install-man5 \ install-nobase_dist_texmf_dist_scriptsSCRIPTS \ install-nobase_dist_texmf_scriptsSCRIPTS install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-binSCRIPTS \ - uninstall-hook uninstall-man uninstall-man1 uninstall-man5 \ + uninstall-dist_texconfigDATA uninstall-dist_texconfigSCRIPTS \ + uninstall-dist_web2cDATA uninstall-hook uninstall-man \ + uninstall-man1 uninstall-man5 \ uninstall-nobase_dist_texmf_dist_scriptsSCRIPTS \ uninstall-nobase_dist_texmf_scriptsSCRIPTS @@ -893,10 +1005,14 @@ uninstall-hook: uninstall-man1-links @WIN32_FALSE@ else :; fi .PHONY: xupdmap.1 -xupdmap.1: updmap.help2man tetex/updmap.pl +xupdmap.1: tetex/updmap.help2man tetex/updmap.pl help2man --include=$< --source="TeX Live" --no-info \ $(srcdir)/tetex/updmap.pl >/tmp/$@ +.PHONY: run-texlinks +run-texlinks: +@WIN32_FALSE@ PATH="$(DESTDIR)$(bindir):$(PATH)"; export PATH; $(run_texlinks) + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/Build/source/texk/texlive/linked_scripts/scripts.lst b/Build/source/texk/texlive/linked_scripts/scripts.lst index 787fa6b1ef4..ec6dca1810f 100644 --- a/Build/source/texk/texlive/linked_scripts/scripts.lst +++ b/Build/source/texk/texlive/linked_scripts/scripts.lst @@ -1,4 +1,10 @@ texmf_scripts=' +tetex/fmtutil.sh +tetex/texconfig.sh +tetex/texconfig-dialog.sh +tetex/texconfig-sys.sh +tetex/texlinks.sh +tetex/fmtutil-sys.sh texlive/rungs.tlu texlive/tlmgr.pl ' diff --git a/Build/source/texk/tetex/fmtutil-sys b/Build/source/texk/texlive/linked_scripts/tetex/fmtutil-sys.sh index bfb52f94e1f..bfb52f94e1f 100755 --- a/Build/source/texk/tetex/fmtutil-sys +++ b/Build/source/texk/texlive/linked_scripts/tetex/fmtutil-sys.sh diff --git a/Build/source/texk/tetex/fmtutil.man b/Build/source/texk/texlive/linked_scripts/tetex/fmtutil.1 index 39ed57bf8b5..39ed57bf8b5 100644 --- a/Build/source/texk/tetex/fmtutil.man +++ b/Build/source/texk/texlive/linked_scripts/tetex/fmtutil.1 diff --git a/Build/source/texk/tetex/fmtutil.cnf b/Build/source/texk/texlive/linked_scripts/tetex/fmtutil.cnf index 8e1ab82149f..8e1ab82149f 100644 --- a/Build/source/texk/tetex/fmtutil.cnf +++ b/Build/source/texk/texlive/linked_scripts/tetex/fmtutil.cnf diff --git a/Build/source/texk/tetex/fmtutil.cnf.5 b/Build/source/texk/texlive/linked_scripts/tetex/fmtutil.cnf.5 index 4efedcf590c..4efedcf590c 100644 --- a/Build/source/texk/tetex/fmtutil.cnf.5 +++ b/Build/source/texk/texlive/linked_scripts/tetex/fmtutil.cnf.5 diff --git a/Build/source/texk/tetex/fmtutil b/Build/source/texk/texlive/linked_scripts/tetex/fmtutil.sh index b9f97aa8998..b9f97aa8998 100755 --- a/Build/source/texk/tetex/fmtutil +++ b/Build/source/texk/texlive/linked_scripts/tetex/fmtutil.sh diff --git a/Build/source/texk/tetex/tcfmgr b/Build/source/texk/texlive/linked_scripts/tetex/tcfmgr index e79be96f873..e79be96f873 100755 --- a/Build/source/texk/tetex/tcfmgr +++ b/Build/source/texk/texlive/linked_scripts/tetex/tcfmgr diff --git a/Build/source/texk/tetex/tcfmgr.map b/Build/source/texk/texlive/linked_scripts/tetex/tcfmgr.map index a5c6f35cb3d..a5c6f35cb3d 100644 --- a/Build/source/texk/tetex/tcfmgr.map +++ b/Build/source/texk/texlive/linked_scripts/tetex/tcfmgr.map diff --git a/Build/source/texk/tetex/texconfig-dialog b/Build/source/texk/texlive/linked_scripts/tetex/texconfig-dialog.sh index bdf7ba202bc..bdf7ba202bc 100755 --- a/Build/source/texk/tetex/texconfig-dialog +++ b/Build/source/texk/texlive/linked_scripts/tetex/texconfig-dialog.sh diff --git a/Build/source/texk/tetex/texconfig-sys b/Build/source/texk/texlive/linked_scripts/tetex/texconfig-sys.sh index dd58513a6ea..dd58513a6ea 100755 --- a/Build/source/texk/tetex/texconfig-sys +++ b/Build/source/texk/texlive/linked_scripts/tetex/texconfig-sys.sh diff --git a/Build/source/texk/tetex/texconfig.man b/Build/source/texk/texlive/linked_scripts/tetex/texconfig.1 index 8087f1e6dd1..8087f1e6dd1 100644 --- a/Build/source/texk/tetex/texconfig.man +++ b/Build/source/texk/texlive/linked_scripts/tetex/texconfig.1 diff --git a/Build/source/texk/tetex/texconfig b/Build/source/texk/texlive/linked_scripts/tetex/texconfig.sh index c9cc73c8305..c9cc73c8305 100755 --- a/Build/source/texk/tetex/texconfig +++ b/Build/source/texk/texlive/linked_scripts/tetex/texconfig.sh diff --git a/Build/source/texk/tetex/texlinks.man b/Build/source/texk/texlive/linked_scripts/tetex/texlinks.1 index 75e7effcb15..75e7effcb15 100644 --- a/Build/source/texk/tetex/texlinks.man +++ b/Build/source/texk/texlive/linked_scripts/tetex/texlinks.1 diff --git a/Build/source/texk/tetex/texlinks b/Build/source/texk/texlive/linked_scripts/tetex/texlinks.sh index c6fd2880aae..c6fd2880aae 100755 --- a/Build/source/texk/tetex/texlinks +++ b/Build/source/texk/texlive/linked_scripts/tetex/texlinks.sh diff --git a/Build/source/texk/texlive/linked_scripts/updmap.help2man b/Build/source/texk/texlive/linked_scripts/tetex/updmap.help2man index 4864c2d74f4..4864c2d74f4 100644 --- a/Build/source/texk/texlive/linked_scripts/updmap.help2man +++ b/Build/source/texk/texlive/linked_scripts/tetex/updmap.help2man diff --git a/Master/bin/amd64-freebsd/fmtutil b/Master/bin/amd64-freebsd/fmtutil deleted file mode 100755 index 06ef11380b4..00000000000 --- a/Master/bin/amd64-freebsd/fmtutil +++ /dev/null @@ -1,1017 +0,0 @@ -#!/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" to avoid interaction. -# Sun Mar 21 19:44:36 CET 2004: support aleph -# Thu Dec 25 22:11:53 CET 2003: add version string -# Thu Dec 25 12:56:14 CET 2003: new listcfg_loop lists only supported formats -# Sun Dec 21 10:25:37 CET 2003 "mktexfmt pdflatex" did not work (if called -# as mktexfmt, an extention was mandatory) -# Mon Sep 15 13:07:31 CEST 2003 add tmpdir to TEXINPUTS -# Sun Aug 3 11:09:46 CEST 2003 special case for mptopdf -# Sun Apr 20 10:27:09 CEST 2003 allow " " as well as tab in config file -# Wed Feb 19 21:14:52 CET 2003 add eomega support -# Sat Feb 15 22:01:35 CET 2003 let mf-nowin work without mf -# Wed Dec 25 09:47:44 CET 2002 bugfix for localized pool files -# Fri Oct 25 02:29:06 CEST 2002: now more careful about find_hyphenfile() -# Tue Oct 22 22:46:48 CEST 2002: -jobname, oft extension -# Fri Oct 4 22:33:17 CEST 2002: add more cli stuff: enablefmt -# disablefmt listcfg -# Sun Jul 7 21:28:37 CEST 2002: look at log file for possible problems, -# and issue a warning -# Tue Jun 4 21:52:57 CEST 2002: trap / cleanup code from updmap -# Tue Jun 4 19:32:44 CEST 2002: be smarter about stdout / stderr -# Tue Apr 9 22:46:34 CEST 2002: pass -progname=mpost for metafun -# Tue Apr 2 00:37:39 CEST 2002: added mktexfmt functionality -# Tue Jun 5 14:45:57 CEST 2001: added support for mf / mpost -############################################################################### - -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+"$@"}'='"$@"' - -progname=fmtutil -argv0=$0 -version='$Id: fmtutil 25899 2012-04-09 23:09:26Z karl $' - -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 -$version -Usage: fmtutil [OPTION]... CMD [ARG]... -Usage: mktexfmt FORMAT.fmt|BASE.base|MEM.mem|FMTNAME.EXT - -Rebuild and manage TeX formats, Metafont bases and MetaPost mems. - -If the command name ends in mktexfmt, only one format can be created. -The only options supported are --help and --version, and the command -line must consist of either a format name, with its extension, or a -plain name that is passed as the argument to --byfmt (see below). The -full name of the generated file (if any) is written to stdout, and -nothing else. - -If not operating in mktexfmt mode, the command line can be more general, -and multiple formats can be generated, as follows. - -Optional behavior: - --cnffile FILE read FILE instead of fmtutil.cnf. - --fmtdir DIRECTORY - --no-engine-subdir don't use engine-specific subdir of the fmtdir - --no-error-if-no-format exit successfully if no format is selected - --quiet be silent - --test (not implemented, just for compatibility) - --dolinks (not implemented, just for compatibility) - --force (not implemented, just for compatibility) - -Valid commands for fmtutil: - --all recreate all format files - --missing create all missing format files - --refresh recreate only existing format files - --byengine ENGINENAME (re)create formats using ENGINENAME - --byfmt FORMATNAME (re)create format for FORMATNAME - --byhyphen HYPHENFILE (re)create formats that depend on HYPHENFILE - --enablefmt FORMATNAME enable formatname in config file - --disablefmt FORMATNAME disable formatname in config file - --listcfg list (enabled and disabled) configurations, - filtered to available formats - --catcfg output the content of the config file - --showhyphen FORMATNAME print name of hyphenfile for format FORMATNAME - --edit no-op in TeX Live - --version show version info - --help show this message - -The default config file is named fmtutil.cnf, and -running kpsewhich fmtutil.cnf should show the active file. -The command kpsewhich --engine=/ --all foo.fmt should show the -locations of any and all foo.fmt files. - -For more information about fmt generation in TeX Live, try -tlmgr --help or see http://tug.org/texlive/doc/tlmgr.html. -The \`generate' action in tlmgr does the work. - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -eof - cleanup 0 -} - -versionfunc() -{ - cat <<eof -$progname version $version -eof - cleanup 0 -} - -############################################################################### -# 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'" -} - -############################################################################### -# 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() -{ - file=$1; pat=$2; line=$3 - - if grep "$pat" "$file" >/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 <<eof - -############################################################################### -$progname: Warning! Some warnings have been issued. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`warning' messages: -$log_warning_msg -eof - } >&2 - fi - - if $has_errors; then - { - cat <<eof - -############################################################################### -$progname: Error! Not all formats have been built successfully. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`failed' messages: -$log_failure_msg -eof - } >&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 - - if test $use_engine_dir; then - fulldestdir="$destdir/$texengine" - else - fulldestdir="$destdir" - fi - mkdir -p "$fulldestdir" - if test -f "$fmtfile"; then - grep '^! ' $format.log >/dev/null 2>&1 && - log_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 - # - destfile=$fulldestdir/$fmtfile - if mv "$fmtfile" "$destfile" </dev/null; then - verboseMsg "$progname: $destfile installed." - # - # As a special special case, we create mplib-luatex.mem for use by - # the mplib embedded in luatex if it doesn't already exist. (We - # never update it if it does exist.) - # - # This is used by the luamplib package. This way, an expert user - # who wants to try a new version of luatex (hence with a new - # version of mplib) can manually update mplib-luatex.mem without - # having to tamper with mpost itself. - # - if test "x$format" = xmpost && test "x$engine" = xmpost; then - mplib_mem_name=mplib-luatex.mem - mplib_mem_file=$fulldestdir/$mplib_mem_name - if test \! -f $mplib_mem_file; then - verboseMsg "$progname: copying $destfile to $mplib_mem_file" - if cp "$destfile" "$mplib_mem_file" </dev/null; then - mktexupd "$fulldestdir" "$mplib_mem_name" - else - log_warning "cp $destfile $mplib_mem_file failed." - fi - else - verboseMsg "$progname: $mplib_mem_file already exists, not updating." - fi - fi - # - # Echo the (main) output filename for our caller. - $mktexfmtMode && $mktexfmtFirst \ - && echo "$destfile" && mktexfmtFirst=false - # - mktexupd "$fulldestdir" "$fmtfile" - fi - else - log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed" - fi -} - -############################################################################### -# recreate_loop() -# for each line in config file: check match-condition and recreate format -# if there is a match -############################################################################### -recreate_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line || continue - check_match || continue - run_initex - done -} - -############################################################################### -# listcfg_loop() -# prints all format definitions in config files (enabled and disabled ones) -# for supported formats (i.e. for those which have an existing ini file) -############################################################################### -listcfg_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#$/d; /^#[^!]/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line && echo "$line" - done -} - -############################################################################### -# check_match() -# recreate all formats -############################################################################### -check_match() -{ - $need_find_hyphenfile && \ - this_hyphenfile="`find_hyphenfile "$format" "$hyphenation"`" - - eval $match_cmd && setmatch true -} - -############################################################################### -# recreate_by_fmt(fmtname) -# recreate all versions of fmtname -############################################################################### -recreate_by_fmt() -{ - fmtname=$1 - match_cmd="test x\$format = x$fmtname" - recreate_loop -} - -############################################################################### -# create_missing() -# create all missing format files -############################################################################### -create_missing() -{ - # match_cmd='test ! -f $destdir/$fmtfile' - match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_existing() -# recreate only existing format files -############################################################################### -recreate_existing() -{ - match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_all() -# recreate all formats -############################################################################### -recreate_all() -{ - match_cmd=true - recreate_loop -} - -############################################################################### -# recreate_by_hyphenfile(hyphenfile) -# recreate all formats that depend on hyphenfile -############################################################################### -recreate_by_hyphenfile() -{ - hyphenfile=$1 - - case $hyphenfile in - /*) - : - ;; - ./*) - hyphenfile="$KPSE_DOT/"`echo "$hyphenfile" | sed 's@..@@'` - ;; - *) - hyphenfile="$KPSE_DOT/$hyphenfile" - ;; - esac - need_find_hyphenfile=true - match_cmd="echo \"\$this_hyphenfile\" | grep $hyphenfile >/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/Master/bin/amd64-freebsd/fmtutil-sys b/Master/bin/amd64-freebsd/fmtutil-sys deleted file mode 100755 index bfb52f94e1f..00000000000 --- a/Master/bin/amd64-freebsd/fmtutil-sys +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/Master/bin/amd64-freebsd/texconfig b/Master/bin/amd64-freebsd/texconfig deleted file mode 100755 index c9cc73c8305..00000000000 --- a/Master/bin/amd64-freebsd/texconfig +++ /dev/null @@ -1,1432 +0,0 @@ -#!/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' </dev/null \ - | awk '$1 == "XDPI" || $1 == "YDPI" { print $3 }' - ) -} - -############################################################################### -# checkElemInList(elem, list) -# check if element exists in list -############################################################################### -checkElemInList() -{ - checkElemInListElem=$1; shift - checkElemInListFound=false - for checkElemInListIter - do - case "x$checkElemInListElem" in - x$checkElemInListIter) - checkElemInListFound=true - break - ;; - esac - done - case $checkElemInListFound in - true) (exit 0); return 0;; - esac - (exit 1); return 1 -} - - -# show version information from the distribution, if we have any. -showDistVersionInfo() -{ - # TeX Live file. - test -f $MT_TEXMFMAIN/../release-texlive.txt \ - && sed 1q $MT_TEXMFMAIN/../release-texlive.txt - - # no harm in continuing to look for the teTeX files. - test -f $MT_TEXMFMAIN/release-tetex-src.txt \ - && "teTeX-src release: `cat $MT_TEXMFMAIN/release-tetex-src.txt`" - test -f $MT_TEXMFDIST/release-tetex-texmf.txt \ - && "teTeX-texmf release: `cat $MT_TEXMFDIST/release-tetex-texmf.txt`" -} - -# -############################################################################### -# tcBatch(args) -# handle batch mode -############################################################################### -tcBatch() -{ - help="texconfig supports adjusting and updating many aspects of -the TeX installation. - -Usage: $progname conf (show configuration information) - $progname dvipdfmx paper PAPER (dvipdfmx paper size) - $progname dvipdfm paper PAPER (dvipdfm paper size) - $progname dvips [OPTION...] (dvips options) - $progname faq (show teTeX faq) - $progname findprog PROG... (show locations of PROGs, a la which) - $progname font vardir DIR - $progname font ro - $progname font rw - $progname formats (edit fmtutil.cnf) - $progname help (or --help; show this help) - $progname hyphen FORMAT (edit hyphenation config for FORMAT) - $progname init [FORMAT]... (rebuild FORMATs, or all formats - plus run texlinks and updmap) - $progname mode MODE (set Metafont MODE) - $progname paper PAPER (set default paper size to PAPER) - $progname pdftex [OPTION]... (pdftex options) - $progname rehash (rebuild ls-R files with mktexlsr) - $progname version (or --version; show version info) - $progname xdvi paper PAPER (xdvi paper size) - -Get more help with: - $progname dvipdfmx - $progname dvipdfm - $progname dvips - $progname font - $progname hyphen - $progname mode - $progname paper - $progname pdftex - $progname xdvi - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -" - - case $1 in - # texconfig conf - conf|confall) - setupTexmfmain - setupTexmfdist - echo '=========================== version information ==========================' - showDistVersionInfo - echo - echo '==================== binaries found by searching $PATH ===================' - echo "PATH=$PATH" - echoLocateBinary kpsewhich updmap fmtutil texconfig tex pdftex mktexpk dvips dvipdfm - echo - echo '=========================== active config files ==========================' - echoLocateCfgfile texmf.cnf updmap.cfg fmtutil.cnf config.ps mktex.cnf XDvi pdftexconfig.tex config | sort -k 2 - echo - echo '============================= font map files =============================' - for m in psfonts.map pdftex.map ps2pk.map dvipdfm.map; do - echo "$m: `kpsewhich $m`" - done - echo - echo '=========================== kpathsea variables ===========================' - echoShowKpseVariable TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS - - echo - echo '==== kpathsea variables from environment only (ok if no output here) ====' - echoShowVariable $envVars - ;; - - # texconfig dvipdfm - dvipdfm) - help="Usage: $progname dvipdfm paper PAPER - -Valid PAPER settings: - letter legal ledger tabloid a4 a3" - case $2 in - # texconfig dvipdfm 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 config '^p' "p $3";; - "") echo "$help" >&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 <unknown> - *) - 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 <unknown> - *) - 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 <<EOM -texconfig formats is no longer supported, because manual edits of -fmtutil.cnf will be overwritten by the new TeX Live package manager, -tlmgr, which regenerates that file as needed upon package changes. -Thus, to add or remove formats, the recommended method is to use tlmgr -to add or remove the appropriate package. - -If you need to make manual additions, you can edit the file -fmtutil-local.cnf under TEXMFLOCAL. Further information with -tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - setupTmpDir - echo "$progname: analyzing old configuration..." >&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 <<EOM -texconfig hyphen is no longer supported, because manual edits of -language.dat (or language.def) will be overwritten by the new TeX Live -package manager, tlmgr, which regenerates those configuration files as -needed upon package changes. Thus, to add or remove hyphenation -patterns, the recommended method is to use tlmgr to add or remove the -appropriate package. - -If you need to make manual additions, you can edit the files -language-local.dat and language-local.def under TEXMFLOCAL. Further -information with tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - tcBatchHyphenFormat=$2 - formatsForHyphen=`getFormatsForHyphen` - formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'` - help="Usage: $progname hyphen FORMAT - -Valid FORMATs are: -$formatsForHyphenFmt" - case $tcBatchHyphenFormat in - "") - echo "$help" >&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/Master/bin/amd64-freebsd/texconfig-dialog b/Master/bin/amd64-freebsd/texconfig-dialog deleted file mode 100755 index e1868d91574..00000000000 --- a/Master/bin/amd64-freebsd/texconfig-dialog +++ /dev/null @@ -1,486 +0,0 @@ -#!/bin/sh - -# TeX-Config version 3.0 -# Thomas Esser, te@dbs.uni-hannover.de. Public domain. - -# 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+"$@"}'='"$@"' - -# the version string -version='$Id: texconfig-dialog 23826 2011-09-05 17:59:15Z karl $' - -: ${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/Master/bin/amd64-freebsd/texconfig-sys b/Master/bin/amd64-freebsd/texconfig-sys deleted file mode 100755 index ff549003ad2..00000000000 --- a/Master/bin/amd64-freebsd/texconfig-sys +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $Id: texconfig-sys 20962 2011-01-07 11:45:38Z peter $ - -# 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/Master/bin/amd64-freebsd/texlinks b/Master/bin/amd64-freebsd/texlinks deleted file mode 100755 index 09b3488d263..00000000000 --- a/Master/bin/amd64-freebsd/texlinks +++ /dev/null @@ -1,335 +0,0 @@ -#!/bin/sh -# $Id: texlinks 18035 2010-04-28 17:41:52Z mpg $ - -# 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 <vext01@gmail.com> -# 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: texlinks 18035 2010-04-28 17:41:52Z mpg $' -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: <http://tug.org/texlive/> -' - -############################################################################### -# 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/Master/bin/amd64-kfreebsd/fmtutil b/Master/bin/amd64-kfreebsd/fmtutil deleted file mode 100755 index 06ef11380b4..00000000000 --- a/Master/bin/amd64-kfreebsd/fmtutil +++ /dev/null @@ -1,1017 +0,0 @@ -#!/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" to avoid interaction. -# Sun Mar 21 19:44:36 CET 2004: support aleph -# Thu Dec 25 22:11:53 CET 2003: add version string -# Thu Dec 25 12:56:14 CET 2003: new listcfg_loop lists only supported formats -# Sun Dec 21 10:25:37 CET 2003 "mktexfmt pdflatex" did not work (if called -# as mktexfmt, an extention was mandatory) -# Mon Sep 15 13:07:31 CEST 2003 add tmpdir to TEXINPUTS -# Sun Aug 3 11:09:46 CEST 2003 special case for mptopdf -# Sun Apr 20 10:27:09 CEST 2003 allow " " as well as tab in config file -# Wed Feb 19 21:14:52 CET 2003 add eomega support -# Sat Feb 15 22:01:35 CET 2003 let mf-nowin work without mf -# Wed Dec 25 09:47:44 CET 2002 bugfix for localized pool files -# Fri Oct 25 02:29:06 CEST 2002: now more careful about find_hyphenfile() -# Tue Oct 22 22:46:48 CEST 2002: -jobname, oft extension -# Fri Oct 4 22:33:17 CEST 2002: add more cli stuff: enablefmt -# disablefmt listcfg -# Sun Jul 7 21:28:37 CEST 2002: look at log file for possible problems, -# and issue a warning -# Tue Jun 4 21:52:57 CEST 2002: trap / cleanup code from updmap -# Tue Jun 4 19:32:44 CEST 2002: be smarter about stdout / stderr -# Tue Apr 9 22:46:34 CEST 2002: pass -progname=mpost for metafun -# Tue Apr 2 00:37:39 CEST 2002: added mktexfmt functionality -# Tue Jun 5 14:45:57 CEST 2001: added support for mf / mpost -############################################################################### - -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+"$@"}'='"$@"' - -progname=fmtutil -argv0=$0 -version='$Id: fmtutil 25899 2012-04-09 23:09:26Z karl $' - -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 -$version -Usage: fmtutil [OPTION]... CMD [ARG]... -Usage: mktexfmt FORMAT.fmt|BASE.base|MEM.mem|FMTNAME.EXT - -Rebuild and manage TeX formats, Metafont bases and MetaPost mems. - -If the command name ends in mktexfmt, only one format can be created. -The only options supported are --help and --version, and the command -line must consist of either a format name, with its extension, or a -plain name that is passed as the argument to --byfmt (see below). The -full name of the generated file (if any) is written to stdout, and -nothing else. - -If not operating in mktexfmt mode, the command line can be more general, -and multiple formats can be generated, as follows. - -Optional behavior: - --cnffile FILE read FILE instead of fmtutil.cnf. - --fmtdir DIRECTORY - --no-engine-subdir don't use engine-specific subdir of the fmtdir - --no-error-if-no-format exit successfully if no format is selected - --quiet be silent - --test (not implemented, just for compatibility) - --dolinks (not implemented, just for compatibility) - --force (not implemented, just for compatibility) - -Valid commands for fmtutil: - --all recreate all format files - --missing create all missing format files - --refresh recreate only existing format files - --byengine ENGINENAME (re)create formats using ENGINENAME - --byfmt FORMATNAME (re)create format for FORMATNAME - --byhyphen HYPHENFILE (re)create formats that depend on HYPHENFILE - --enablefmt FORMATNAME enable formatname in config file - --disablefmt FORMATNAME disable formatname in config file - --listcfg list (enabled and disabled) configurations, - filtered to available formats - --catcfg output the content of the config file - --showhyphen FORMATNAME print name of hyphenfile for format FORMATNAME - --edit no-op in TeX Live - --version show version info - --help show this message - -The default config file is named fmtutil.cnf, and -running kpsewhich fmtutil.cnf should show the active file. -The command kpsewhich --engine=/ --all foo.fmt should show the -locations of any and all foo.fmt files. - -For more information about fmt generation in TeX Live, try -tlmgr --help or see http://tug.org/texlive/doc/tlmgr.html. -The \`generate' action in tlmgr does the work. - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -eof - cleanup 0 -} - -versionfunc() -{ - cat <<eof -$progname version $version -eof - cleanup 0 -} - -############################################################################### -# 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'" -} - -############################################################################### -# 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() -{ - file=$1; pat=$2; line=$3 - - if grep "$pat" "$file" >/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 <<eof - -############################################################################### -$progname: Warning! Some warnings have been issued. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`warning' messages: -$log_warning_msg -eof - } >&2 - fi - - if $has_errors; then - { - cat <<eof - -############################################################################### -$progname: Error! Not all formats have been built successfully. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`failed' messages: -$log_failure_msg -eof - } >&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 - - if test $use_engine_dir; then - fulldestdir="$destdir/$texengine" - else - fulldestdir="$destdir" - fi - mkdir -p "$fulldestdir" - if test -f "$fmtfile"; then - grep '^! ' $format.log >/dev/null 2>&1 && - log_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 - # - destfile=$fulldestdir/$fmtfile - if mv "$fmtfile" "$destfile" </dev/null; then - verboseMsg "$progname: $destfile installed." - # - # As a special special case, we create mplib-luatex.mem for use by - # the mplib embedded in luatex if it doesn't already exist. (We - # never update it if it does exist.) - # - # This is used by the luamplib package. This way, an expert user - # who wants to try a new version of luatex (hence with a new - # version of mplib) can manually update mplib-luatex.mem without - # having to tamper with mpost itself. - # - if test "x$format" = xmpost && test "x$engine" = xmpost; then - mplib_mem_name=mplib-luatex.mem - mplib_mem_file=$fulldestdir/$mplib_mem_name - if test \! -f $mplib_mem_file; then - verboseMsg "$progname: copying $destfile to $mplib_mem_file" - if cp "$destfile" "$mplib_mem_file" </dev/null; then - mktexupd "$fulldestdir" "$mplib_mem_name" - else - log_warning "cp $destfile $mplib_mem_file failed." - fi - else - verboseMsg "$progname: $mplib_mem_file already exists, not updating." - fi - fi - # - # Echo the (main) output filename for our caller. - $mktexfmtMode && $mktexfmtFirst \ - && echo "$destfile" && mktexfmtFirst=false - # - mktexupd "$fulldestdir" "$fmtfile" - fi - else - log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed" - fi -} - -############################################################################### -# recreate_loop() -# for each line in config file: check match-condition and recreate format -# if there is a match -############################################################################### -recreate_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line || continue - check_match || continue - run_initex - done -} - -############################################################################### -# listcfg_loop() -# prints all format definitions in config files (enabled and disabled ones) -# for supported formats (i.e. for those which have an existing ini file) -############################################################################### -listcfg_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#$/d; /^#[^!]/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line && echo "$line" - done -} - -############################################################################### -# check_match() -# recreate all formats -############################################################################### -check_match() -{ - $need_find_hyphenfile && \ - this_hyphenfile="`find_hyphenfile "$format" "$hyphenation"`" - - eval $match_cmd && setmatch true -} - -############################################################################### -# recreate_by_fmt(fmtname) -# recreate all versions of fmtname -############################################################################### -recreate_by_fmt() -{ - fmtname=$1 - match_cmd="test x\$format = x$fmtname" - recreate_loop -} - -############################################################################### -# create_missing() -# create all missing format files -############################################################################### -create_missing() -{ - # match_cmd='test ! -f $destdir/$fmtfile' - match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_existing() -# recreate only existing format files -############################################################################### -recreate_existing() -{ - match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_all() -# recreate all formats -############################################################################### -recreate_all() -{ - match_cmd=true - recreate_loop -} - -############################################################################### -# recreate_by_hyphenfile(hyphenfile) -# recreate all formats that depend on hyphenfile -############################################################################### -recreate_by_hyphenfile() -{ - hyphenfile=$1 - - case $hyphenfile in - /*) - : - ;; - ./*) - hyphenfile="$KPSE_DOT/"`echo "$hyphenfile" | sed 's@..@@'` - ;; - *) - hyphenfile="$KPSE_DOT/$hyphenfile" - ;; - esac - need_find_hyphenfile=true - match_cmd="echo \"\$this_hyphenfile\" | grep $hyphenfile >/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/Master/bin/amd64-kfreebsd/fmtutil-sys b/Master/bin/amd64-kfreebsd/fmtutil-sys deleted file mode 100755 index bfb52f94e1f..00000000000 --- a/Master/bin/amd64-kfreebsd/fmtutil-sys +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/Master/bin/amd64-kfreebsd/texconfig b/Master/bin/amd64-kfreebsd/texconfig deleted file mode 100755 index c9cc73c8305..00000000000 --- a/Master/bin/amd64-kfreebsd/texconfig +++ /dev/null @@ -1,1432 +0,0 @@ -#!/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' </dev/null \ - | awk '$1 == "XDPI" || $1 == "YDPI" { print $3 }' - ) -} - -############################################################################### -# checkElemInList(elem, list) -# check if element exists in list -############################################################################### -checkElemInList() -{ - checkElemInListElem=$1; shift - checkElemInListFound=false - for checkElemInListIter - do - case "x$checkElemInListElem" in - x$checkElemInListIter) - checkElemInListFound=true - break - ;; - esac - done - case $checkElemInListFound in - true) (exit 0); return 0;; - esac - (exit 1); return 1 -} - - -# show version information from the distribution, if we have any. -showDistVersionInfo() -{ - # TeX Live file. - test -f $MT_TEXMFMAIN/../release-texlive.txt \ - && sed 1q $MT_TEXMFMAIN/../release-texlive.txt - - # no harm in continuing to look for the teTeX files. - test -f $MT_TEXMFMAIN/release-tetex-src.txt \ - && "teTeX-src release: `cat $MT_TEXMFMAIN/release-tetex-src.txt`" - test -f $MT_TEXMFDIST/release-tetex-texmf.txt \ - && "teTeX-texmf release: `cat $MT_TEXMFDIST/release-tetex-texmf.txt`" -} - -# -############################################################################### -# tcBatch(args) -# handle batch mode -############################################################################### -tcBatch() -{ - help="texconfig supports adjusting and updating many aspects of -the TeX installation. - -Usage: $progname conf (show configuration information) - $progname dvipdfmx paper PAPER (dvipdfmx paper size) - $progname dvipdfm paper PAPER (dvipdfm paper size) - $progname dvips [OPTION...] (dvips options) - $progname faq (show teTeX faq) - $progname findprog PROG... (show locations of PROGs, a la which) - $progname font vardir DIR - $progname font ro - $progname font rw - $progname formats (edit fmtutil.cnf) - $progname help (or --help; show this help) - $progname hyphen FORMAT (edit hyphenation config for FORMAT) - $progname init [FORMAT]... (rebuild FORMATs, or all formats - plus run texlinks and updmap) - $progname mode MODE (set Metafont MODE) - $progname paper PAPER (set default paper size to PAPER) - $progname pdftex [OPTION]... (pdftex options) - $progname rehash (rebuild ls-R files with mktexlsr) - $progname version (or --version; show version info) - $progname xdvi paper PAPER (xdvi paper size) - -Get more help with: - $progname dvipdfmx - $progname dvipdfm - $progname dvips - $progname font - $progname hyphen - $progname mode - $progname paper - $progname pdftex - $progname xdvi - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -" - - case $1 in - # texconfig conf - conf|confall) - setupTexmfmain - setupTexmfdist - echo '=========================== version information ==========================' - showDistVersionInfo - echo - echo '==================== binaries found by searching $PATH ===================' - echo "PATH=$PATH" - echoLocateBinary kpsewhich updmap fmtutil texconfig tex pdftex mktexpk dvips dvipdfm - echo - echo '=========================== active config files ==========================' - echoLocateCfgfile texmf.cnf updmap.cfg fmtutil.cnf config.ps mktex.cnf XDvi pdftexconfig.tex config | sort -k 2 - echo - echo '============================= font map files =============================' - for m in psfonts.map pdftex.map ps2pk.map dvipdfm.map; do - echo "$m: `kpsewhich $m`" - done - echo - echo '=========================== kpathsea variables ===========================' - echoShowKpseVariable TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS - - echo - echo '==== kpathsea variables from environment only (ok if no output here) ====' - echoShowVariable $envVars - ;; - - # texconfig dvipdfm - dvipdfm) - help="Usage: $progname dvipdfm paper PAPER - -Valid PAPER settings: - letter legal ledger tabloid a4 a3" - case $2 in - # texconfig dvipdfm 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 config '^p' "p $3";; - "") echo "$help" >&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 <unknown> - *) - 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 <unknown> - *) - 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 <<EOM -texconfig formats is no longer supported, because manual edits of -fmtutil.cnf will be overwritten by the new TeX Live package manager, -tlmgr, which regenerates that file as needed upon package changes. -Thus, to add or remove formats, the recommended method is to use tlmgr -to add or remove the appropriate package. - -If you need to make manual additions, you can edit the file -fmtutil-local.cnf under TEXMFLOCAL. Further information with -tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - setupTmpDir - echo "$progname: analyzing old configuration..." >&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 <<EOM -texconfig hyphen is no longer supported, because manual edits of -language.dat (or language.def) will be overwritten by the new TeX Live -package manager, tlmgr, which regenerates those configuration files as -needed upon package changes. Thus, to add or remove hyphenation -patterns, the recommended method is to use tlmgr to add or remove the -appropriate package. - -If you need to make manual additions, you can edit the files -language-local.dat and language-local.def under TEXMFLOCAL. Further -information with tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - tcBatchHyphenFormat=$2 - formatsForHyphen=`getFormatsForHyphen` - formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'` - help="Usage: $progname hyphen FORMAT - -Valid FORMATs are: -$formatsForHyphenFmt" - case $tcBatchHyphenFormat in - "") - echo "$help" >&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/Master/bin/amd64-kfreebsd/texconfig-dialog b/Master/bin/amd64-kfreebsd/texconfig-dialog deleted file mode 100755 index e1868d91574..00000000000 --- a/Master/bin/amd64-kfreebsd/texconfig-dialog +++ /dev/null @@ -1,486 +0,0 @@ -#!/bin/sh - -# TeX-Config version 3.0 -# Thomas Esser, te@dbs.uni-hannover.de. Public domain. - -# 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+"$@"}'='"$@"' - -# the version string -version='$Id: texconfig-dialog 23826 2011-09-05 17:59:15Z karl $' - -: ${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/Master/bin/amd64-kfreebsd/texconfig-sys b/Master/bin/amd64-kfreebsd/texconfig-sys deleted file mode 100755 index ff549003ad2..00000000000 --- a/Master/bin/amd64-kfreebsd/texconfig-sys +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $Id: texconfig-sys 20962 2011-01-07 11:45:38Z peter $ - -# 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/Master/bin/amd64-kfreebsd/texlinks b/Master/bin/amd64-kfreebsd/texlinks deleted file mode 100755 index 09b3488d263..00000000000 --- a/Master/bin/amd64-kfreebsd/texlinks +++ /dev/null @@ -1,335 +0,0 @@ -#!/bin/sh -# $Id: texlinks 18035 2010-04-28 17:41:52Z mpg $ - -# 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 <vext01@gmail.com> -# 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: texlinks 18035 2010-04-28 17:41:52Z mpg $' -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: <http://tug.org/texlive/> -' - -############################################################################### -# 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/Master/bin/armel-linux/fmtutil b/Master/bin/armel-linux/fmtutil deleted file mode 100755 index 06ef11380b4..00000000000 --- a/Master/bin/armel-linux/fmtutil +++ /dev/null @@ -1,1017 +0,0 @@ -#!/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" to avoid interaction. -# Sun Mar 21 19:44:36 CET 2004: support aleph -# Thu Dec 25 22:11:53 CET 2003: add version string -# Thu Dec 25 12:56:14 CET 2003: new listcfg_loop lists only supported formats -# Sun Dec 21 10:25:37 CET 2003 "mktexfmt pdflatex" did not work (if called -# as mktexfmt, an extention was mandatory) -# Mon Sep 15 13:07:31 CEST 2003 add tmpdir to TEXINPUTS -# Sun Aug 3 11:09:46 CEST 2003 special case for mptopdf -# Sun Apr 20 10:27:09 CEST 2003 allow " " as well as tab in config file -# Wed Feb 19 21:14:52 CET 2003 add eomega support -# Sat Feb 15 22:01:35 CET 2003 let mf-nowin work without mf -# Wed Dec 25 09:47:44 CET 2002 bugfix for localized pool files -# Fri Oct 25 02:29:06 CEST 2002: now more careful about find_hyphenfile() -# Tue Oct 22 22:46:48 CEST 2002: -jobname, oft extension -# Fri Oct 4 22:33:17 CEST 2002: add more cli stuff: enablefmt -# disablefmt listcfg -# Sun Jul 7 21:28:37 CEST 2002: look at log file for possible problems, -# and issue a warning -# Tue Jun 4 21:52:57 CEST 2002: trap / cleanup code from updmap -# Tue Jun 4 19:32:44 CEST 2002: be smarter about stdout / stderr -# Tue Apr 9 22:46:34 CEST 2002: pass -progname=mpost for metafun -# Tue Apr 2 00:37:39 CEST 2002: added mktexfmt functionality -# Tue Jun 5 14:45:57 CEST 2001: added support for mf / mpost -############################################################################### - -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+"$@"}'='"$@"' - -progname=fmtutil -argv0=$0 -version='$Id: fmtutil 25899 2012-04-09 23:09:26Z karl $' - -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 -$version -Usage: fmtutil [OPTION]... CMD [ARG]... -Usage: mktexfmt FORMAT.fmt|BASE.base|MEM.mem|FMTNAME.EXT - -Rebuild and manage TeX formats, Metafont bases and MetaPost mems. - -If the command name ends in mktexfmt, only one format can be created. -The only options supported are --help and --version, and the command -line must consist of either a format name, with its extension, or a -plain name that is passed as the argument to --byfmt (see below). The -full name of the generated file (if any) is written to stdout, and -nothing else. - -If not operating in mktexfmt mode, the command line can be more general, -and multiple formats can be generated, as follows. - -Optional behavior: - --cnffile FILE read FILE instead of fmtutil.cnf. - --fmtdir DIRECTORY - --no-engine-subdir don't use engine-specific subdir of the fmtdir - --no-error-if-no-format exit successfully if no format is selected - --quiet be silent - --test (not implemented, just for compatibility) - --dolinks (not implemented, just for compatibility) - --force (not implemented, just for compatibility) - -Valid commands for fmtutil: - --all recreate all format files - --missing create all missing format files - --refresh recreate only existing format files - --byengine ENGINENAME (re)create formats using ENGINENAME - --byfmt FORMATNAME (re)create format for FORMATNAME - --byhyphen HYPHENFILE (re)create formats that depend on HYPHENFILE - --enablefmt FORMATNAME enable formatname in config file - --disablefmt FORMATNAME disable formatname in config file - --listcfg list (enabled and disabled) configurations, - filtered to available formats - --catcfg output the content of the config file - --showhyphen FORMATNAME print name of hyphenfile for format FORMATNAME - --edit no-op in TeX Live - --version show version info - --help show this message - -The default config file is named fmtutil.cnf, and -running kpsewhich fmtutil.cnf should show the active file. -The command kpsewhich --engine=/ --all foo.fmt should show the -locations of any and all foo.fmt files. - -For more information about fmt generation in TeX Live, try -tlmgr --help or see http://tug.org/texlive/doc/tlmgr.html. -The \`generate' action in tlmgr does the work. - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -eof - cleanup 0 -} - -versionfunc() -{ - cat <<eof -$progname version $version -eof - cleanup 0 -} - -############################################################################### -# 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'" -} - -############################################################################### -# 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() -{ - file=$1; pat=$2; line=$3 - - if grep "$pat" "$file" >/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 <<eof - -############################################################################### -$progname: Warning! Some warnings have been issued. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`warning' messages: -$log_warning_msg -eof - } >&2 - fi - - if $has_errors; then - { - cat <<eof - -############################################################################### -$progname: Error! Not all formats have been built successfully. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`failed' messages: -$log_failure_msg -eof - } >&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 - - if test $use_engine_dir; then - fulldestdir="$destdir/$texengine" - else - fulldestdir="$destdir" - fi - mkdir -p "$fulldestdir" - if test -f "$fmtfile"; then - grep '^! ' $format.log >/dev/null 2>&1 && - log_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 - # - destfile=$fulldestdir/$fmtfile - if mv "$fmtfile" "$destfile" </dev/null; then - verboseMsg "$progname: $destfile installed." - # - # As a special special case, we create mplib-luatex.mem for use by - # the mplib embedded in luatex if it doesn't already exist. (We - # never update it if it does exist.) - # - # This is used by the luamplib package. This way, an expert user - # who wants to try a new version of luatex (hence with a new - # version of mplib) can manually update mplib-luatex.mem without - # having to tamper with mpost itself. - # - if test "x$format" = xmpost && test "x$engine" = xmpost; then - mplib_mem_name=mplib-luatex.mem - mplib_mem_file=$fulldestdir/$mplib_mem_name - if test \! -f $mplib_mem_file; then - verboseMsg "$progname: copying $destfile to $mplib_mem_file" - if cp "$destfile" "$mplib_mem_file" </dev/null; then - mktexupd "$fulldestdir" "$mplib_mem_name" - else - log_warning "cp $destfile $mplib_mem_file failed." - fi - else - verboseMsg "$progname: $mplib_mem_file already exists, not updating." - fi - fi - # - # Echo the (main) output filename for our caller. - $mktexfmtMode && $mktexfmtFirst \ - && echo "$destfile" && mktexfmtFirst=false - # - mktexupd "$fulldestdir" "$fmtfile" - fi - else - log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed" - fi -} - -############################################################################### -# recreate_loop() -# for each line in config file: check match-condition and recreate format -# if there is a match -############################################################################### -recreate_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line || continue - check_match || continue - run_initex - done -} - -############################################################################### -# listcfg_loop() -# prints all format definitions in config files (enabled and disabled ones) -# for supported formats (i.e. for those which have an existing ini file) -############################################################################### -listcfg_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#$/d; /^#[^!]/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line && echo "$line" - done -} - -############################################################################### -# check_match() -# recreate all formats -############################################################################### -check_match() -{ - $need_find_hyphenfile && \ - this_hyphenfile="`find_hyphenfile "$format" "$hyphenation"`" - - eval $match_cmd && setmatch true -} - -############################################################################### -# recreate_by_fmt(fmtname) -# recreate all versions of fmtname -############################################################################### -recreate_by_fmt() -{ - fmtname=$1 - match_cmd="test x\$format = x$fmtname" - recreate_loop -} - -############################################################################### -# create_missing() -# create all missing format files -############################################################################### -create_missing() -{ - # match_cmd='test ! -f $destdir/$fmtfile' - match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_existing() -# recreate only existing format files -############################################################################### -recreate_existing() -{ - match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_all() -# recreate all formats -############################################################################### -recreate_all() -{ - match_cmd=true - recreate_loop -} - -############################################################################### -# recreate_by_hyphenfile(hyphenfile) -# recreate all formats that depend on hyphenfile -############################################################################### -recreate_by_hyphenfile() -{ - hyphenfile=$1 - - case $hyphenfile in - /*) - : - ;; - ./*) - hyphenfile="$KPSE_DOT/"`echo "$hyphenfile" | sed 's@..@@'` - ;; - *) - hyphenfile="$KPSE_DOT/$hyphenfile" - ;; - esac - need_find_hyphenfile=true - match_cmd="echo \"\$this_hyphenfile\" | grep $hyphenfile >/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/Master/bin/armel-linux/fmtutil-sys b/Master/bin/armel-linux/fmtutil-sys deleted file mode 100755 index bfb52f94e1f..00000000000 --- a/Master/bin/armel-linux/fmtutil-sys +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/Master/bin/armel-linux/texconfig b/Master/bin/armel-linux/texconfig deleted file mode 100755 index c9cc73c8305..00000000000 --- a/Master/bin/armel-linux/texconfig +++ /dev/null @@ -1,1432 +0,0 @@ -#!/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' </dev/null \ - | awk '$1 == "XDPI" || $1 == "YDPI" { print $3 }' - ) -} - -############################################################################### -# checkElemInList(elem, list) -# check if element exists in list -############################################################################### -checkElemInList() -{ - checkElemInListElem=$1; shift - checkElemInListFound=false - for checkElemInListIter - do - case "x$checkElemInListElem" in - x$checkElemInListIter) - checkElemInListFound=true - break - ;; - esac - done - case $checkElemInListFound in - true) (exit 0); return 0;; - esac - (exit 1); return 1 -} - - -# show version information from the distribution, if we have any. -showDistVersionInfo() -{ - # TeX Live file. - test -f $MT_TEXMFMAIN/../release-texlive.txt \ - && sed 1q $MT_TEXMFMAIN/../release-texlive.txt - - # no harm in continuing to look for the teTeX files. - test -f $MT_TEXMFMAIN/release-tetex-src.txt \ - && "teTeX-src release: `cat $MT_TEXMFMAIN/release-tetex-src.txt`" - test -f $MT_TEXMFDIST/release-tetex-texmf.txt \ - && "teTeX-texmf release: `cat $MT_TEXMFDIST/release-tetex-texmf.txt`" -} - -# -############################################################################### -# tcBatch(args) -# handle batch mode -############################################################################### -tcBatch() -{ - help="texconfig supports adjusting and updating many aspects of -the TeX installation. - -Usage: $progname conf (show configuration information) - $progname dvipdfmx paper PAPER (dvipdfmx paper size) - $progname dvipdfm paper PAPER (dvipdfm paper size) - $progname dvips [OPTION...] (dvips options) - $progname faq (show teTeX faq) - $progname findprog PROG... (show locations of PROGs, a la which) - $progname font vardir DIR - $progname font ro - $progname font rw - $progname formats (edit fmtutil.cnf) - $progname help (or --help; show this help) - $progname hyphen FORMAT (edit hyphenation config for FORMAT) - $progname init [FORMAT]... (rebuild FORMATs, or all formats - plus run texlinks and updmap) - $progname mode MODE (set Metafont MODE) - $progname paper PAPER (set default paper size to PAPER) - $progname pdftex [OPTION]... (pdftex options) - $progname rehash (rebuild ls-R files with mktexlsr) - $progname version (or --version; show version info) - $progname xdvi paper PAPER (xdvi paper size) - -Get more help with: - $progname dvipdfmx - $progname dvipdfm - $progname dvips - $progname font - $progname hyphen - $progname mode - $progname paper - $progname pdftex - $progname xdvi - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -" - - case $1 in - # texconfig conf - conf|confall) - setupTexmfmain - setupTexmfdist - echo '=========================== version information ==========================' - showDistVersionInfo - echo - echo '==================== binaries found by searching $PATH ===================' - echo "PATH=$PATH" - echoLocateBinary kpsewhich updmap fmtutil texconfig tex pdftex mktexpk dvips dvipdfm - echo - echo '=========================== active config files ==========================' - echoLocateCfgfile texmf.cnf updmap.cfg fmtutil.cnf config.ps mktex.cnf XDvi pdftexconfig.tex config | sort -k 2 - echo - echo '============================= font map files =============================' - for m in psfonts.map pdftex.map ps2pk.map dvipdfm.map; do - echo "$m: `kpsewhich $m`" - done - echo - echo '=========================== kpathsea variables ===========================' - echoShowKpseVariable TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS - - echo - echo '==== kpathsea variables from environment only (ok if no output here) ====' - echoShowVariable $envVars - ;; - - # texconfig dvipdfm - dvipdfm) - help="Usage: $progname dvipdfm paper PAPER - -Valid PAPER settings: - letter legal ledger tabloid a4 a3" - case $2 in - # texconfig dvipdfm 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 config '^p' "p $3";; - "") echo "$help" >&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 <unknown> - *) - 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 <unknown> - *) - 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 <<EOM -texconfig formats is no longer supported, because manual edits of -fmtutil.cnf will be overwritten by the new TeX Live package manager, -tlmgr, which regenerates that file as needed upon package changes. -Thus, to add or remove formats, the recommended method is to use tlmgr -to add or remove the appropriate package. - -If you need to make manual additions, you can edit the file -fmtutil-local.cnf under TEXMFLOCAL. Further information with -tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - setupTmpDir - echo "$progname: analyzing old configuration..." >&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 <<EOM -texconfig hyphen is no longer supported, because manual edits of -language.dat (or language.def) will be overwritten by the new TeX Live -package manager, tlmgr, which regenerates those configuration files as -needed upon package changes. Thus, to add or remove hyphenation -patterns, the recommended method is to use tlmgr to add or remove the -appropriate package. - -If you need to make manual additions, you can edit the files -language-local.dat and language-local.def under TEXMFLOCAL. Further -information with tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - tcBatchHyphenFormat=$2 - formatsForHyphen=`getFormatsForHyphen` - formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'` - help="Usage: $progname hyphen FORMAT - -Valid FORMATs are: -$formatsForHyphenFmt" - case $tcBatchHyphenFormat in - "") - echo "$help" >&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/Master/bin/armel-linux/texconfig-dialog b/Master/bin/armel-linux/texconfig-dialog deleted file mode 100755 index e1868d91574..00000000000 --- a/Master/bin/armel-linux/texconfig-dialog +++ /dev/null @@ -1,486 +0,0 @@ -#!/bin/sh - -# TeX-Config version 3.0 -# Thomas Esser, te@dbs.uni-hannover.de. Public domain. - -# 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+"$@"}'='"$@"' - -# the version string -version='$Id: texconfig-dialog 23826 2011-09-05 17:59:15Z karl $' - -: ${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/Master/bin/armel-linux/texconfig-sys b/Master/bin/armel-linux/texconfig-sys deleted file mode 100755 index ff549003ad2..00000000000 --- a/Master/bin/armel-linux/texconfig-sys +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $Id: texconfig-sys 20962 2011-01-07 11:45:38Z peter $ - -# 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/Master/bin/armel-linux/texlinks b/Master/bin/armel-linux/texlinks deleted file mode 100755 index 09b3488d263..00000000000 --- a/Master/bin/armel-linux/texlinks +++ /dev/null @@ -1,335 +0,0 @@ -#!/bin/sh -# $Id: texlinks 18035 2010-04-28 17:41:52Z mpg $ - -# 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 <vext01@gmail.com> -# 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: texlinks 18035 2010-04-28 17:41:52Z mpg $' -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: <http://tug.org/texlive/> -' - -############################################################################### -# 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/Master/bin/i386-cygwin/fmtutil b/Master/bin/i386-cygwin/fmtutil deleted file mode 100755 index 06ef11380b4..00000000000 --- a/Master/bin/i386-cygwin/fmtutil +++ /dev/null @@ -1,1017 +0,0 @@ -#!/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" to avoid interaction. -# Sun Mar 21 19:44:36 CET 2004: support aleph -# Thu Dec 25 22:11:53 CET 2003: add version string -# Thu Dec 25 12:56:14 CET 2003: new listcfg_loop lists only supported formats -# Sun Dec 21 10:25:37 CET 2003 "mktexfmt pdflatex" did not work (if called -# as mktexfmt, an extention was mandatory) -# Mon Sep 15 13:07:31 CEST 2003 add tmpdir to TEXINPUTS -# Sun Aug 3 11:09:46 CEST 2003 special case for mptopdf -# Sun Apr 20 10:27:09 CEST 2003 allow " " as well as tab in config file -# Wed Feb 19 21:14:52 CET 2003 add eomega support -# Sat Feb 15 22:01:35 CET 2003 let mf-nowin work without mf -# Wed Dec 25 09:47:44 CET 2002 bugfix for localized pool files -# Fri Oct 25 02:29:06 CEST 2002: now more careful about find_hyphenfile() -# Tue Oct 22 22:46:48 CEST 2002: -jobname, oft extension -# Fri Oct 4 22:33:17 CEST 2002: add more cli stuff: enablefmt -# disablefmt listcfg -# Sun Jul 7 21:28:37 CEST 2002: look at log file for possible problems, -# and issue a warning -# Tue Jun 4 21:52:57 CEST 2002: trap / cleanup code from updmap -# Tue Jun 4 19:32:44 CEST 2002: be smarter about stdout / stderr -# Tue Apr 9 22:46:34 CEST 2002: pass -progname=mpost for metafun -# Tue Apr 2 00:37:39 CEST 2002: added mktexfmt functionality -# Tue Jun 5 14:45:57 CEST 2001: added support for mf / mpost -############################################################################### - -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+"$@"}'='"$@"' - -progname=fmtutil -argv0=$0 -version='$Id: fmtutil 25899 2012-04-09 23:09:26Z karl $' - -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 -$version -Usage: fmtutil [OPTION]... CMD [ARG]... -Usage: mktexfmt FORMAT.fmt|BASE.base|MEM.mem|FMTNAME.EXT - -Rebuild and manage TeX formats, Metafont bases and MetaPost mems. - -If the command name ends in mktexfmt, only one format can be created. -The only options supported are --help and --version, and the command -line must consist of either a format name, with its extension, or a -plain name that is passed as the argument to --byfmt (see below). The -full name of the generated file (if any) is written to stdout, and -nothing else. - -If not operating in mktexfmt mode, the command line can be more general, -and multiple formats can be generated, as follows. - -Optional behavior: - --cnffile FILE read FILE instead of fmtutil.cnf. - --fmtdir DIRECTORY - --no-engine-subdir don't use engine-specific subdir of the fmtdir - --no-error-if-no-format exit successfully if no format is selected - --quiet be silent - --test (not implemented, just for compatibility) - --dolinks (not implemented, just for compatibility) - --force (not implemented, just for compatibility) - -Valid commands for fmtutil: - --all recreate all format files - --missing create all missing format files - --refresh recreate only existing format files - --byengine ENGINENAME (re)create formats using ENGINENAME - --byfmt FORMATNAME (re)create format for FORMATNAME - --byhyphen HYPHENFILE (re)create formats that depend on HYPHENFILE - --enablefmt FORMATNAME enable formatname in config file - --disablefmt FORMATNAME disable formatname in config file - --listcfg list (enabled and disabled) configurations, - filtered to available formats - --catcfg output the content of the config file - --showhyphen FORMATNAME print name of hyphenfile for format FORMATNAME - --edit no-op in TeX Live - --version show version info - --help show this message - -The default config file is named fmtutil.cnf, and -running kpsewhich fmtutil.cnf should show the active file. -The command kpsewhich --engine=/ --all foo.fmt should show the -locations of any and all foo.fmt files. - -For more information about fmt generation in TeX Live, try -tlmgr --help or see http://tug.org/texlive/doc/tlmgr.html. -The \`generate' action in tlmgr does the work. - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -eof - cleanup 0 -} - -versionfunc() -{ - cat <<eof -$progname version $version -eof - cleanup 0 -} - -############################################################################### -# 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'" -} - -############################################################################### -# 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() -{ - file=$1; pat=$2; line=$3 - - if grep "$pat" "$file" >/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 <<eof - -############################################################################### -$progname: Warning! Some warnings have been issued. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`warning' messages: -$log_warning_msg -eof - } >&2 - fi - - if $has_errors; then - { - cat <<eof - -############################################################################### -$progname: Error! Not all formats have been built successfully. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`failed' messages: -$log_failure_msg -eof - } >&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 - - if test $use_engine_dir; then - fulldestdir="$destdir/$texengine" - else - fulldestdir="$destdir" - fi - mkdir -p "$fulldestdir" - if test -f "$fmtfile"; then - grep '^! ' $format.log >/dev/null 2>&1 && - log_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 - # - destfile=$fulldestdir/$fmtfile - if mv "$fmtfile" "$destfile" </dev/null; then - verboseMsg "$progname: $destfile installed." - # - # As a special special case, we create mplib-luatex.mem for use by - # the mplib embedded in luatex if it doesn't already exist. (We - # never update it if it does exist.) - # - # This is used by the luamplib package. This way, an expert user - # who wants to try a new version of luatex (hence with a new - # version of mplib) can manually update mplib-luatex.mem without - # having to tamper with mpost itself. - # - if test "x$format" = xmpost && test "x$engine" = xmpost; then - mplib_mem_name=mplib-luatex.mem - mplib_mem_file=$fulldestdir/$mplib_mem_name - if test \! -f $mplib_mem_file; then - verboseMsg "$progname: copying $destfile to $mplib_mem_file" - if cp "$destfile" "$mplib_mem_file" </dev/null; then - mktexupd "$fulldestdir" "$mplib_mem_name" - else - log_warning "cp $destfile $mplib_mem_file failed." - fi - else - verboseMsg "$progname: $mplib_mem_file already exists, not updating." - fi - fi - # - # Echo the (main) output filename for our caller. - $mktexfmtMode && $mktexfmtFirst \ - && echo "$destfile" && mktexfmtFirst=false - # - mktexupd "$fulldestdir" "$fmtfile" - fi - else - log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed" - fi -} - -############################################################################### -# recreate_loop() -# for each line in config file: check match-condition and recreate format -# if there is a match -############################################################################### -recreate_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line || continue - check_match || continue - run_initex - done -} - -############################################################################### -# listcfg_loop() -# prints all format definitions in config files (enabled and disabled ones) -# for supported formats (i.e. for those which have an existing ini file) -############################################################################### -listcfg_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#$/d; /^#[^!]/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line && echo "$line" - done -} - -############################################################################### -# check_match() -# recreate all formats -############################################################################### -check_match() -{ - $need_find_hyphenfile && \ - this_hyphenfile="`find_hyphenfile "$format" "$hyphenation"`" - - eval $match_cmd && setmatch true -} - -############################################################################### -# recreate_by_fmt(fmtname) -# recreate all versions of fmtname -############################################################################### -recreate_by_fmt() -{ - fmtname=$1 - match_cmd="test x\$format = x$fmtname" - recreate_loop -} - -############################################################################### -# create_missing() -# create all missing format files -############################################################################### -create_missing() -{ - # match_cmd='test ! -f $destdir/$fmtfile' - match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_existing() -# recreate only existing format files -############################################################################### -recreate_existing() -{ - match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_all() -# recreate all formats -############################################################################### -recreate_all() -{ - match_cmd=true - recreate_loop -} - -############################################################################### -# recreate_by_hyphenfile(hyphenfile) -# recreate all formats that depend on hyphenfile -############################################################################### -recreate_by_hyphenfile() -{ - hyphenfile=$1 - - case $hyphenfile in - /*) - : - ;; - ./*) - hyphenfile="$KPSE_DOT/"`echo "$hyphenfile" | sed 's@..@@'` - ;; - *) - hyphenfile="$KPSE_DOT/$hyphenfile" - ;; - esac - need_find_hyphenfile=true - match_cmd="echo \"\$this_hyphenfile\" | grep $hyphenfile >/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/Master/bin/i386-cygwin/fmtutil-sys b/Master/bin/i386-cygwin/fmtutil-sys deleted file mode 100755 index bfb52f94e1f..00000000000 --- a/Master/bin/i386-cygwin/fmtutil-sys +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/Master/bin/i386-cygwin/texconfig b/Master/bin/i386-cygwin/texconfig deleted file mode 100755 index c9cc73c8305..00000000000 --- a/Master/bin/i386-cygwin/texconfig +++ /dev/null @@ -1,1432 +0,0 @@ -#!/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' </dev/null \ - | awk '$1 == "XDPI" || $1 == "YDPI" { print $3 }' - ) -} - -############################################################################### -# checkElemInList(elem, list) -# check if element exists in list -############################################################################### -checkElemInList() -{ - checkElemInListElem=$1; shift - checkElemInListFound=false - for checkElemInListIter - do - case "x$checkElemInListElem" in - x$checkElemInListIter) - checkElemInListFound=true - break - ;; - esac - done - case $checkElemInListFound in - true) (exit 0); return 0;; - esac - (exit 1); return 1 -} - - -# show version information from the distribution, if we have any. -showDistVersionInfo() -{ - # TeX Live file. - test -f $MT_TEXMFMAIN/../release-texlive.txt \ - && sed 1q $MT_TEXMFMAIN/../release-texlive.txt - - # no harm in continuing to look for the teTeX files. - test -f $MT_TEXMFMAIN/release-tetex-src.txt \ - && "teTeX-src release: `cat $MT_TEXMFMAIN/release-tetex-src.txt`" - test -f $MT_TEXMFDIST/release-tetex-texmf.txt \ - && "teTeX-texmf release: `cat $MT_TEXMFDIST/release-tetex-texmf.txt`" -} - -# -############################################################################### -# tcBatch(args) -# handle batch mode -############################################################################### -tcBatch() -{ - help="texconfig supports adjusting and updating many aspects of -the TeX installation. - -Usage: $progname conf (show configuration information) - $progname dvipdfmx paper PAPER (dvipdfmx paper size) - $progname dvipdfm paper PAPER (dvipdfm paper size) - $progname dvips [OPTION...] (dvips options) - $progname faq (show teTeX faq) - $progname findprog PROG... (show locations of PROGs, a la which) - $progname font vardir DIR - $progname font ro - $progname font rw - $progname formats (edit fmtutil.cnf) - $progname help (or --help; show this help) - $progname hyphen FORMAT (edit hyphenation config for FORMAT) - $progname init [FORMAT]... (rebuild FORMATs, or all formats - plus run texlinks and updmap) - $progname mode MODE (set Metafont MODE) - $progname paper PAPER (set default paper size to PAPER) - $progname pdftex [OPTION]... (pdftex options) - $progname rehash (rebuild ls-R files with mktexlsr) - $progname version (or --version; show version info) - $progname xdvi paper PAPER (xdvi paper size) - -Get more help with: - $progname dvipdfmx - $progname dvipdfm - $progname dvips - $progname font - $progname hyphen - $progname mode - $progname paper - $progname pdftex - $progname xdvi - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -" - - case $1 in - # texconfig conf - conf|confall) - setupTexmfmain - setupTexmfdist - echo '=========================== version information ==========================' - showDistVersionInfo - echo - echo '==================== binaries found by searching $PATH ===================' - echo "PATH=$PATH" - echoLocateBinary kpsewhich updmap fmtutil texconfig tex pdftex mktexpk dvips dvipdfm - echo - echo '=========================== active config files ==========================' - echoLocateCfgfile texmf.cnf updmap.cfg fmtutil.cnf config.ps mktex.cnf XDvi pdftexconfig.tex config | sort -k 2 - echo - echo '============================= font map files =============================' - for m in psfonts.map pdftex.map ps2pk.map dvipdfm.map; do - echo "$m: `kpsewhich $m`" - done - echo - echo '=========================== kpathsea variables ===========================' - echoShowKpseVariable TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS - - echo - echo '==== kpathsea variables from environment only (ok if no output here) ====' - echoShowVariable $envVars - ;; - - # texconfig dvipdfm - dvipdfm) - help="Usage: $progname dvipdfm paper PAPER - -Valid PAPER settings: - letter legal ledger tabloid a4 a3" - case $2 in - # texconfig dvipdfm 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 config '^p' "p $3";; - "") echo "$help" >&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 <unknown> - *) - 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 <unknown> - *) - 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 <<EOM -texconfig formats is no longer supported, because manual edits of -fmtutil.cnf will be overwritten by the new TeX Live package manager, -tlmgr, which regenerates that file as needed upon package changes. -Thus, to add or remove formats, the recommended method is to use tlmgr -to add or remove the appropriate package. - -If you need to make manual additions, you can edit the file -fmtutil-local.cnf under TEXMFLOCAL. Further information with -tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - setupTmpDir - echo "$progname: analyzing old configuration..." >&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 <<EOM -texconfig hyphen is no longer supported, because manual edits of -language.dat (or language.def) will be overwritten by the new TeX Live -package manager, tlmgr, which regenerates those configuration files as -needed upon package changes. Thus, to add or remove hyphenation -patterns, the recommended method is to use tlmgr to add or remove the -appropriate package. - -If you need to make manual additions, you can edit the files -language-local.dat and language-local.def under TEXMFLOCAL. Further -information with tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - tcBatchHyphenFormat=$2 - formatsForHyphen=`getFormatsForHyphen` - formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'` - help="Usage: $progname hyphen FORMAT - -Valid FORMATs are: -$formatsForHyphenFmt" - case $tcBatchHyphenFormat in - "") - echo "$help" >&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/Master/bin/i386-cygwin/texconfig-dialog b/Master/bin/i386-cygwin/texconfig-dialog deleted file mode 100755 index e1868d91574..00000000000 --- a/Master/bin/i386-cygwin/texconfig-dialog +++ /dev/null @@ -1,486 +0,0 @@ -#!/bin/sh - -# TeX-Config version 3.0 -# Thomas Esser, te@dbs.uni-hannover.de. Public domain. - -# 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+"$@"}'='"$@"' - -# the version string -version='$Id: texconfig-dialog 23826 2011-09-05 17:59:15Z karl $' - -: ${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/Master/bin/i386-cygwin/texconfig-sys b/Master/bin/i386-cygwin/texconfig-sys deleted file mode 100755 index ff549003ad2..00000000000 --- a/Master/bin/i386-cygwin/texconfig-sys +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $Id: texconfig-sys 20962 2011-01-07 11:45:38Z peter $ - -# 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/Master/bin/i386-cygwin/texlinks b/Master/bin/i386-cygwin/texlinks deleted file mode 100755 index 09b3488d263..00000000000 --- a/Master/bin/i386-cygwin/texlinks +++ /dev/null @@ -1,335 +0,0 @@ -#!/bin/sh -# $Id: texlinks 18035 2010-04-28 17:41:52Z mpg $ - -# 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 <vext01@gmail.com> -# 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: texlinks 18035 2010-04-28 17:41:52Z mpg $' -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: <http://tug.org/texlive/> -' - -############################################################################### -# 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/Master/bin/i386-freebsd/fmtutil b/Master/bin/i386-freebsd/fmtutil deleted file mode 100755 index 06ef11380b4..00000000000 --- a/Master/bin/i386-freebsd/fmtutil +++ /dev/null @@ -1,1017 +0,0 @@ -#!/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" to avoid interaction. -# Sun Mar 21 19:44:36 CET 2004: support aleph -# Thu Dec 25 22:11:53 CET 2003: add version string -# Thu Dec 25 12:56:14 CET 2003: new listcfg_loop lists only supported formats -# Sun Dec 21 10:25:37 CET 2003 "mktexfmt pdflatex" did not work (if called -# as mktexfmt, an extention was mandatory) -# Mon Sep 15 13:07:31 CEST 2003 add tmpdir to TEXINPUTS -# Sun Aug 3 11:09:46 CEST 2003 special case for mptopdf -# Sun Apr 20 10:27:09 CEST 2003 allow " " as well as tab in config file -# Wed Feb 19 21:14:52 CET 2003 add eomega support -# Sat Feb 15 22:01:35 CET 2003 let mf-nowin work without mf -# Wed Dec 25 09:47:44 CET 2002 bugfix for localized pool files -# Fri Oct 25 02:29:06 CEST 2002: now more careful about find_hyphenfile() -# Tue Oct 22 22:46:48 CEST 2002: -jobname, oft extension -# Fri Oct 4 22:33:17 CEST 2002: add more cli stuff: enablefmt -# disablefmt listcfg -# Sun Jul 7 21:28:37 CEST 2002: look at log file for possible problems, -# and issue a warning -# Tue Jun 4 21:52:57 CEST 2002: trap / cleanup code from updmap -# Tue Jun 4 19:32:44 CEST 2002: be smarter about stdout / stderr -# Tue Apr 9 22:46:34 CEST 2002: pass -progname=mpost for metafun -# Tue Apr 2 00:37:39 CEST 2002: added mktexfmt functionality -# Tue Jun 5 14:45:57 CEST 2001: added support for mf / mpost -############################################################################### - -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+"$@"}'='"$@"' - -progname=fmtutil -argv0=$0 -version='$Id: fmtutil 25899 2012-04-09 23:09:26Z karl $' - -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 -$version -Usage: fmtutil [OPTION]... CMD [ARG]... -Usage: mktexfmt FORMAT.fmt|BASE.base|MEM.mem|FMTNAME.EXT - -Rebuild and manage TeX formats, Metafont bases and MetaPost mems. - -If the command name ends in mktexfmt, only one format can be created. -The only options supported are --help and --version, and the command -line must consist of either a format name, with its extension, or a -plain name that is passed as the argument to --byfmt (see below). The -full name of the generated file (if any) is written to stdout, and -nothing else. - -If not operating in mktexfmt mode, the command line can be more general, -and multiple formats can be generated, as follows. - -Optional behavior: - --cnffile FILE read FILE instead of fmtutil.cnf. - --fmtdir DIRECTORY - --no-engine-subdir don't use engine-specific subdir of the fmtdir - --no-error-if-no-format exit successfully if no format is selected - --quiet be silent - --test (not implemented, just for compatibility) - --dolinks (not implemented, just for compatibility) - --force (not implemented, just for compatibility) - -Valid commands for fmtutil: - --all recreate all format files - --missing create all missing format files - --refresh recreate only existing format files - --byengine ENGINENAME (re)create formats using ENGINENAME - --byfmt FORMATNAME (re)create format for FORMATNAME - --byhyphen HYPHENFILE (re)create formats that depend on HYPHENFILE - --enablefmt FORMATNAME enable formatname in config file - --disablefmt FORMATNAME disable formatname in config file - --listcfg list (enabled and disabled) configurations, - filtered to available formats - --catcfg output the content of the config file - --showhyphen FORMATNAME print name of hyphenfile for format FORMATNAME - --edit no-op in TeX Live - --version show version info - --help show this message - -The default config file is named fmtutil.cnf, and -running kpsewhich fmtutil.cnf should show the active file. -The command kpsewhich --engine=/ --all foo.fmt should show the -locations of any and all foo.fmt files. - -For more information about fmt generation in TeX Live, try -tlmgr --help or see http://tug.org/texlive/doc/tlmgr.html. -The \`generate' action in tlmgr does the work. - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -eof - cleanup 0 -} - -versionfunc() -{ - cat <<eof -$progname version $version -eof - cleanup 0 -} - -############################################################################### -# 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'" -} - -############################################################################### -# 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() -{ - file=$1; pat=$2; line=$3 - - if grep "$pat" "$file" >/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 <<eof - -############################################################################### -$progname: Warning! Some warnings have been issued. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`warning' messages: -$log_warning_msg -eof - } >&2 - fi - - if $has_errors; then - { - cat <<eof - -############################################################################### -$progname: Error! Not all formats have been built successfully. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`failed' messages: -$log_failure_msg -eof - } >&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 - - if test $use_engine_dir; then - fulldestdir="$destdir/$texengine" - else - fulldestdir="$destdir" - fi - mkdir -p "$fulldestdir" - if test -f "$fmtfile"; then - grep '^! ' $format.log >/dev/null 2>&1 && - log_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 - # - destfile=$fulldestdir/$fmtfile - if mv "$fmtfile" "$destfile" </dev/null; then - verboseMsg "$progname: $destfile installed." - # - # As a special special case, we create mplib-luatex.mem for use by - # the mplib embedded in luatex if it doesn't already exist. (We - # never update it if it does exist.) - # - # This is used by the luamplib package. This way, an expert user - # who wants to try a new version of luatex (hence with a new - # version of mplib) can manually update mplib-luatex.mem without - # having to tamper with mpost itself. - # - if test "x$format" = xmpost && test "x$engine" = xmpost; then - mplib_mem_name=mplib-luatex.mem - mplib_mem_file=$fulldestdir/$mplib_mem_name - if test \! -f $mplib_mem_file; then - verboseMsg "$progname: copying $destfile to $mplib_mem_file" - if cp "$destfile" "$mplib_mem_file" </dev/null; then - mktexupd "$fulldestdir" "$mplib_mem_name" - else - log_warning "cp $destfile $mplib_mem_file failed." - fi - else - verboseMsg "$progname: $mplib_mem_file already exists, not updating." - fi - fi - # - # Echo the (main) output filename for our caller. - $mktexfmtMode && $mktexfmtFirst \ - && echo "$destfile" && mktexfmtFirst=false - # - mktexupd "$fulldestdir" "$fmtfile" - fi - else - log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed" - fi -} - -############################################################################### -# recreate_loop() -# for each line in config file: check match-condition and recreate format -# if there is a match -############################################################################### -recreate_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line || continue - check_match || continue - run_initex - done -} - -############################################################################### -# listcfg_loop() -# prints all format definitions in config files (enabled and disabled ones) -# for supported formats (i.e. for those which have an existing ini file) -############################################################################### -listcfg_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#$/d; /^#[^!]/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line && echo "$line" - done -} - -############################################################################### -# check_match() -# recreate all formats -############################################################################### -check_match() -{ - $need_find_hyphenfile && \ - this_hyphenfile="`find_hyphenfile "$format" "$hyphenation"`" - - eval $match_cmd && setmatch true -} - -############################################################################### -# recreate_by_fmt(fmtname) -# recreate all versions of fmtname -############################################################################### -recreate_by_fmt() -{ - fmtname=$1 - match_cmd="test x\$format = x$fmtname" - recreate_loop -} - -############################################################################### -# create_missing() -# create all missing format files -############################################################################### -create_missing() -{ - # match_cmd='test ! -f $destdir/$fmtfile' - match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_existing() -# recreate only existing format files -############################################################################### -recreate_existing() -{ - match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_all() -# recreate all formats -############################################################################### -recreate_all() -{ - match_cmd=true - recreate_loop -} - -############################################################################### -# recreate_by_hyphenfile(hyphenfile) -# recreate all formats that depend on hyphenfile -############################################################################### -recreate_by_hyphenfile() -{ - hyphenfile=$1 - - case $hyphenfile in - /*) - : - ;; - ./*) - hyphenfile="$KPSE_DOT/"`echo "$hyphenfile" | sed 's@..@@'` - ;; - *) - hyphenfile="$KPSE_DOT/$hyphenfile" - ;; - esac - need_find_hyphenfile=true - match_cmd="echo \"\$this_hyphenfile\" | grep $hyphenfile >/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/Master/bin/i386-freebsd/fmtutil-sys b/Master/bin/i386-freebsd/fmtutil-sys deleted file mode 100755 index bfb52f94e1f..00000000000 --- a/Master/bin/i386-freebsd/fmtutil-sys +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/Master/bin/i386-freebsd/texconfig b/Master/bin/i386-freebsd/texconfig deleted file mode 100755 index c9cc73c8305..00000000000 --- a/Master/bin/i386-freebsd/texconfig +++ /dev/null @@ -1,1432 +0,0 @@ -#!/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' </dev/null \ - | awk '$1 == "XDPI" || $1 == "YDPI" { print $3 }' - ) -} - -############################################################################### -# checkElemInList(elem, list) -# check if element exists in list -############################################################################### -checkElemInList() -{ - checkElemInListElem=$1; shift - checkElemInListFound=false - for checkElemInListIter - do - case "x$checkElemInListElem" in - x$checkElemInListIter) - checkElemInListFound=true - break - ;; - esac - done - case $checkElemInListFound in - true) (exit 0); return 0;; - esac - (exit 1); return 1 -} - - -# show version information from the distribution, if we have any. -showDistVersionInfo() -{ - # TeX Live file. - test -f $MT_TEXMFMAIN/../release-texlive.txt \ - && sed 1q $MT_TEXMFMAIN/../release-texlive.txt - - # no harm in continuing to look for the teTeX files. - test -f $MT_TEXMFMAIN/release-tetex-src.txt \ - && "teTeX-src release: `cat $MT_TEXMFMAIN/release-tetex-src.txt`" - test -f $MT_TEXMFDIST/release-tetex-texmf.txt \ - && "teTeX-texmf release: `cat $MT_TEXMFDIST/release-tetex-texmf.txt`" -} - -# -############################################################################### -# tcBatch(args) -# handle batch mode -############################################################################### -tcBatch() -{ - help="texconfig supports adjusting and updating many aspects of -the TeX installation. - -Usage: $progname conf (show configuration information) - $progname dvipdfmx paper PAPER (dvipdfmx paper size) - $progname dvipdfm paper PAPER (dvipdfm paper size) - $progname dvips [OPTION...] (dvips options) - $progname faq (show teTeX faq) - $progname findprog PROG... (show locations of PROGs, a la which) - $progname font vardir DIR - $progname font ro - $progname font rw - $progname formats (edit fmtutil.cnf) - $progname help (or --help; show this help) - $progname hyphen FORMAT (edit hyphenation config for FORMAT) - $progname init [FORMAT]... (rebuild FORMATs, or all formats - plus run texlinks and updmap) - $progname mode MODE (set Metafont MODE) - $progname paper PAPER (set default paper size to PAPER) - $progname pdftex [OPTION]... (pdftex options) - $progname rehash (rebuild ls-R files with mktexlsr) - $progname version (or --version; show version info) - $progname xdvi paper PAPER (xdvi paper size) - -Get more help with: - $progname dvipdfmx - $progname dvipdfm - $progname dvips - $progname font - $progname hyphen - $progname mode - $progname paper - $progname pdftex - $progname xdvi - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -" - - case $1 in - # texconfig conf - conf|confall) - setupTexmfmain - setupTexmfdist - echo '=========================== version information ==========================' - showDistVersionInfo - echo - echo '==================== binaries found by searching $PATH ===================' - echo "PATH=$PATH" - echoLocateBinary kpsewhich updmap fmtutil texconfig tex pdftex mktexpk dvips dvipdfm - echo - echo '=========================== active config files ==========================' - echoLocateCfgfile texmf.cnf updmap.cfg fmtutil.cnf config.ps mktex.cnf XDvi pdftexconfig.tex config | sort -k 2 - echo - echo '============================= font map files =============================' - for m in psfonts.map pdftex.map ps2pk.map dvipdfm.map; do - echo "$m: `kpsewhich $m`" - done - echo - echo '=========================== kpathsea variables ===========================' - echoShowKpseVariable TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS - - echo - echo '==== kpathsea variables from environment only (ok if no output here) ====' - echoShowVariable $envVars - ;; - - # texconfig dvipdfm - dvipdfm) - help="Usage: $progname dvipdfm paper PAPER - -Valid PAPER settings: - letter legal ledger tabloid a4 a3" - case $2 in - # texconfig dvipdfm 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 config '^p' "p $3";; - "") echo "$help" >&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 <unknown> - *) - 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 <unknown> - *) - 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 <<EOM -texconfig formats is no longer supported, because manual edits of -fmtutil.cnf will be overwritten by the new TeX Live package manager, -tlmgr, which regenerates that file as needed upon package changes. -Thus, to add or remove formats, the recommended method is to use tlmgr -to add or remove the appropriate package. - -If you need to make manual additions, you can edit the file -fmtutil-local.cnf under TEXMFLOCAL. Further information with -tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - setupTmpDir - echo "$progname: analyzing old configuration..." >&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 <<EOM -texconfig hyphen is no longer supported, because manual edits of -language.dat (or language.def) will be overwritten by the new TeX Live -package manager, tlmgr, which regenerates those configuration files as -needed upon package changes. Thus, to add or remove hyphenation -patterns, the recommended method is to use tlmgr to add or remove the -appropriate package. - -If you need to make manual additions, you can edit the files -language-local.dat and language-local.def under TEXMFLOCAL. Further -information with tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - tcBatchHyphenFormat=$2 - formatsForHyphen=`getFormatsForHyphen` - formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'` - help="Usage: $progname hyphen FORMAT - -Valid FORMATs are: -$formatsForHyphenFmt" - case $tcBatchHyphenFormat in - "") - echo "$help" >&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/Master/bin/i386-freebsd/texconfig-dialog b/Master/bin/i386-freebsd/texconfig-dialog deleted file mode 100755 index e1868d91574..00000000000 --- a/Master/bin/i386-freebsd/texconfig-dialog +++ /dev/null @@ -1,486 +0,0 @@ -#!/bin/sh - -# TeX-Config version 3.0 -# Thomas Esser, te@dbs.uni-hannover.de. Public domain. - -# 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+"$@"}'='"$@"' - -# the version string -version='$Id: texconfig-dialog 23826 2011-09-05 17:59:15Z karl $' - -: ${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/Master/bin/i386-freebsd/texconfig-sys b/Master/bin/i386-freebsd/texconfig-sys deleted file mode 100755 index ff549003ad2..00000000000 --- a/Master/bin/i386-freebsd/texconfig-sys +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $Id: texconfig-sys 20962 2011-01-07 11:45:38Z peter $ - -# 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/Master/bin/i386-freebsd/texlinks b/Master/bin/i386-freebsd/texlinks deleted file mode 100755 index 09b3488d263..00000000000 --- a/Master/bin/i386-freebsd/texlinks +++ /dev/null @@ -1,335 +0,0 @@ -#!/bin/sh -# $Id: texlinks 18035 2010-04-28 17:41:52Z mpg $ - -# 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 <vext01@gmail.com> -# 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: texlinks 18035 2010-04-28 17:41:52Z mpg $' -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: <http://tug.org/texlive/> -' - -############################################################################### -# 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/Master/bin/i386-kfreebsd/fmtutil b/Master/bin/i386-kfreebsd/fmtutil deleted file mode 100755 index 06ef11380b4..00000000000 --- a/Master/bin/i386-kfreebsd/fmtutil +++ /dev/null @@ -1,1017 +0,0 @@ -#!/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" to avoid interaction. -# Sun Mar 21 19:44:36 CET 2004: support aleph -# Thu Dec 25 22:11:53 CET 2003: add version string -# Thu Dec 25 12:56:14 CET 2003: new listcfg_loop lists only supported formats -# Sun Dec 21 10:25:37 CET 2003 "mktexfmt pdflatex" did not work (if called -# as mktexfmt, an extention was mandatory) -# Mon Sep 15 13:07:31 CEST 2003 add tmpdir to TEXINPUTS -# Sun Aug 3 11:09:46 CEST 2003 special case for mptopdf -# Sun Apr 20 10:27:09 CEST 2003 allow " " as well as tab in config file -# Wed Feb 19 21:14:52 CET 2003 add eomega support -# Sat Feb 15 22:01:35 CET 2003 let mf-nowin work without mf -# Wed Dec 25 09:47:44 CET 2002 bugfix for localized pool files -# Fri Oct 25 02:29:06 CEST 2002: now more careful about find_hyphenfile() -# Tue Oct 22 22:46:48 CEST 2002: -jobname, oft extension -# Fri Oct 4 22:33:17 CEST 2002: add more cli stuff: enablefmt -# disablefmt listcfg -# Sun Jul 7 21:28:37 CEST 2002: look at log file for possible problems, -# and issue a warning -# Tue Jun 4 21:52:57 CEST 2002: trap / cleanup code from updmap -# Tue Jun 4 19:32:44 CEST 2002: be smarter about stdout / stderr -# Tue Apr 9 22:46:34 CEST 2002: pass -progname=mpost for metafun -# Tue Apr 2 00:37:39 CEST 2002: added mktexfmt functionality -# Tue Jun 5 14:45:57 CEST 2001: added support for mf / mpost -############################################################################### - -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+"$@"}'='"$@"' - -progname=fmtutil -argv0=$0 -version='$Id: fmtutil 25899 2012-04-09 23:09:26Z karl $' - -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 -$version -Usage: fmtutil [OPTION]... CMD [ARG]... -Usage: mktexfmt FORMAT.fmt|BASE.base|MEM.mem|FMTNAME.EXT - -Rebuild and manage TeX formats, Metafont bases and MetaPost mems. - -If the command name ends in mktexfmt, only one format can be created. -The only options supported are --help and --version, and the command -line must consist of either a format name, with its extension, or a -plain name that is passed as the argument to --byfmt (see below). The -full name of the generated file (if any) is written to stdout, and -nothing else. - -If not operating in mktexfmt mode, the command line can be more general, -and multiple formats can be generated, as follows. - -Optional behavior: - --cnffile FILE read FILE instead of fmtutil.cnf. - --fmtdir DIRECTORY - --no-engine-subdir don't use engine-specific subdir of the fmtdir - --no-error-if-no-format exit successfully if no format is selected - --quiet be silent - --test (not implemented, just for compatibility) - --dolinks (not implemented, just for compatibility) - --force (not implemented, just for compatibility) - -Valid commands for fmtutil: - --all recreate all format files - --missing create all missing format files - --refresh recreate only existing format files - --byengine ENGINENAME (re)create formats using ENGINENAME - --byfmt FORMATNAME (re)create format for FORMATNAME - --byhyphen HYPHENFILE (re)create formats that depend on HYPHENFILE - --enablefmt FORMATNAME enable formatname in config file - --disablefmt FORMATNAME disable formatname in config file - --listcfg list (enabled and disabled) configurations, - filtered to available formats - --catcfg output the content of the config file - --showhyphen FORMATNAME print name of hyphenfile for format FORMATNAME - --edit no-op in TeX Live - --version show version info - --help show this message - -The default config file is named fmtutil.cnf, and -running kpsewhich fmtutil.cnf should show the active file. -The command kpsewhich --engine=/ --all foo.fmt should show the -locations of any and all foo.fmt files. - -For more information about fmt generation in TeX Live, try -tlmgr --help or see http://tug.org/texlive/doc/tlmgr.html. -The \`generate' action in tlmgr does the work. - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -eof - cleanup 0 -} - -versionfunc() -{ - cat <<eof -$progname version $version -eof - cleanup 0 -} - -############################################################################### -# 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'" -} - -############################################################################### -# 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() -{ - file=$1; pat=$2; line=$3 - - if grep "$pat" "$file" >/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 <<eof - -############################################################################### -$progname: Warning! Some warnings have been issued. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`warning' messages: -$log_warning_msg -eof - } >&2 - fi - - if $has_errors; then - { - cat <<eof - -############################################################################### -$progname: Error! Not all formats have been built successfully. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`failed' messages: -$log_failure_msg -eof - } >&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 - - if test $use_engine_dir; then - fulldestdir="$destdir/$texengine" - else - fulldestdir="$destdir" - fi - mkdir -p "$fulldestdir" - if test -f "$fmtfile"; then - grep '^! ' $format.log >/dev/null 2>&1 && - log_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 - # - destfile=$fulldestdir/$fmtfile - if mv "$fmtfile" "$destfile" </dev/null; then - verboseMsg "$progname: $destfile installed." - # - # As a special special case, we create mplib-luatex.mem for use by - # the mplib embedded in luatex if it doesn't already exist. (We - # never update it if it does exist.) - # - # This is used by the luamplib package. This way, an expert user - # who wants to try a new version of luatex (hence with a new - # version of mplib) can manually update mplib-luatex.mem without - # having to tamper with mpost itself. - # - if test "x$format" = xmpost && test "x$engine" = xmpost; then - mplib_mem_name=mplib-luatex.mem - mplib_mem_file=$fulldestdir/$mplib_mem_name - if test \! -f $mplib_mem_file; then - verboseMsg "$progname: copying $destfile to $mplib_mem_file" - if cp "$destfile" "$mplib_mem_file" </dev/null; then - mktexupd "$fulldestdir" "$mplib_mem_name" - else - log_warning "cp $destfile $mplib_mem_file failed." - fi - else - verboseMsg "$progname: $mplib_mem_file already exists, not updating." - fi - fi - # - # Echo the (main) output filename for our caller. - $mktexfmtMode && $mktexfmtFirst \ - && echo "$destfile" && mktexfmtFirst=false - # - mktexupd "$fulldestdir" "$fmtfile" - fi - else - log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed" - fi -} - -############################################################################### -# recreate_loop() -# for each line in config file: check match-condition and recreate format -# if there is a match -############################################################################### -recreate_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line || continue - check_match || continue - run_initex - done -} - -############################################################################### -# listcfg_loop() -# prints all format definitions in config files (enabled and disabled ones) -# for supported formats (i.e. for those which have an existing ini file) -############################################################################### -listcfg_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#$/d; /^#[^!]/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line && echo "$line" - done -} - -############################################################################### -# check_match() -# recreate all formats -############################################################################### -check_match() -{ - $need_find_hyphenfile && \ - this_hyphenfile="`find_hyphenfile "$format" "$hyphenation"`" - - eval $match_cmd && setmatch true -} - -############################################################################### -# recreate_by_fmt(fmtname) -# recreate all versions of fmtname -############################################################################### -recreate_by_fmt() -{ - fmtname=$1 - match_cmd="test x\$format = x$fmtname" - recreate_loop -} - -############################################################################### -# create_missing() -# create all missing format files -############################################################################### -create_missing() -{ - # match_cmd='test ! -f $destdir/$fmtfile' - match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_existing() -# recreate only existing format files -############################################################################### -recreate_existing() -{ - match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_all() -# recreate all formats -############################################################################### -recreate_all() -{ - match_cmd=true - recreate_loop -} - -############################################################################### -# recreate_by_hyphenfile(hyphenfile) -# recreate all formats that depend on hyphenfile -############################################################################### -recreate_by_hyphenfile() -{ - hyphenfile=$1 - - case $hyphenfile in - /*) - : - ;; - ./*) - hyphenfile="$KPSE_DOT/"`echo "$hyphenfile" | sed 's@..@@'` - ;; - *) - hyphenfile="$KPSE_DOT/$hyphenfile" - ;; - esac - need_find_hyphenfile=true - match_cmd="echo \"\$this_hyphenfile\" | grep $hyphenfile >/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/Master/bin/i386-kfreebsd/fmtutil-sys b/Master/bin/i386-kfreebsd/fmtutil-sys deleted file mode 100755 index bfb52f94e1f..00000000000 --- a/Master/bin/i386-kfreebsd/fmtutil-sys +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/Master/bin/i386-kfreebsd/texconfig b/Master/bin/i386-kfreebsd/texconfig deleted file mode 100755 index c9cc73c8305..00000000000 --- a/Master/bin/i386-kfreebsd/texconfig +++ /dev/null @@ -1,1432 +0,0 @@ -#!/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' </dev/null \ - | awk '$1 == "XDPI" || $1 == "YDPI" { print $3 }' - ) -} - -############################################################################### -# checkElemInList(elem, list) -# check if element exists in list -############################################################################### -checkElemInList() -{ - checkElemInListElem=$1; shift - checkElemInListFound=false - for checkElemInListIter - do - case "x$checkElemInListElem" in - x$checkElemInListIter) - checkElemInListFound=true - break - ;; - esac - done - case $checkElemInListFound in - true) (exit 0); return 0;; - esac - (exit 1); return 1 -} - - -# show version information from the distribution, if we have any. -showDistVersionInfo() -{ - # TeX Live file. - test -f $MT_TEXMFMAIN/../release-texlive.txt \ - && sed 1q $MT_TEXMFMAIN/../release-texlive.txt - - # no harm in continuing to look for the teTeX files. - test -f $MT_TEXMFMAIN/release-tetex-src.txt \ - && "teTeX-src release: `cat $MT_TEXMFMAIN/release-tetex-src.txt`" - test -f $MT_TEXMFDIST/release-tetex-texmf.txt \ - && "teTeX-texmf release: `cat $MT_TEXMFDIST/release-tetex-texmf.txt`" -} - -# -############################################################################### -# tcBatch(args) -# handle batch mode -############################################################################### -tcBatch() -{ - help="texconfig supports adjusting and updating many aspects of -the TeX installation. - -Usage: $progname conf (show configuration information) - $progname dvipdfmx paper PAPER (dvipdfmx paper size) - $progname dvipdfm paper PAPER (dvipdfm paper size) - $progname dvips [OPTION...] (dvips options) - $progname faq (show teTeX faq) - $progname findprog PROG... (show locations of PROGs, a la which) - $progname font vardir DIR - $progname font ro - $progname font rw - $progname formats (edit fmtutil.cnf) - $progname help (or --help; show this help) - $progname hyphen FORMAT (edit hyphenation config for FORMAT) - $progname init [FORMAT]... (rebuild FORMATs, or all formats - plus run texlinks and updmap) - $progname mode MODE (set Metafont MODE) - $progname paper PAPER (set default paper size to PAPER) - $progname pdftex [OPTION]... (pdftex options) - $progname rehash (rebuild ls-R files with mktexlsr) - $progname version (or --version; show version info) - $progname xdvi paper PAPER (xdvi paper size) - -Get more help with: - $progname dvipdfmx - $progname dvipdfm - $progname dvips - $progname font - $progname hyphen - $progname mode - $progname paper - $progname pdftex - $progname xdvi - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -" - - case $1 in - # texconfig conf - conf|confall) - setupTexmfmain - setupTexmfdist - echo '=========================== version information ==========================' - showDistVersionInfo - echo - echo '==================== binaries found by searching $PATH ===================' - echo "PATH=$PATH" - echoLocateBinary kpsewhich updmap fmtutil texconfig tex pdftex mktexpk dvips dvipdfm - echo - echo '=========================== active config files ==========================' - echoLocateCfgfile texmf.cnf updmap.cfg fmtutil.cnf config.ps mktex.cnf XDvi pdftexconfig.tex config | sort -k 2 - echo - echo '============================= font map files =============================' - for m in psfonts.map pdftex.map ps2pk.map dvipdfm.map; do - echo "$m: `kpsewhich $m`" - done - echo - echo '=========================== kpathsea variables ===========================' - echoShowKpseVariable TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS - - echo - echo '==== kpathsea variables from environment only (ok if no output here) ====' - echoShowVariable $envVars - ;; - - # texconfig dvipdfm - dvipdfm) - help="Usage: $progname dvipdfm paper PAPER - -Valid PAPER settings: - letter legal ledger tabloid a4 a3" - case $2 in - # texconfig dvipdfm 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 config '^p' "p $3";; - "") echo "$help" >&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 <unknown> - *) - 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 <unknown> - *) - 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 <<EOM -texconfig formats is no longer supported, because manual edits of -fmtutil.cnf will be overwritten by the new TeX Live package manager, -tlmgr, which regenerates that file as needed upon package changes. -Thus, to add or remove formats, the recommended method is to use tlmgr -to add or remove the appropriate package. - -If you need to make manual additions, you can edit the file -fmtutil-local.cnf under TEXMFLOCAL. Further information with -tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - setupTmpDir - echo "$progname: analyzing old configuration..." >&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 <<EOM -texconfig hyphen is no longer supported, because manual edits of -language.dat (or language.def) will be overwritten by the new TeX Live -package manager, tlmgr, which regenerates those configuration files as -needed upon package changes. Thus, to add or remove hyphenation -patterns, the recommended method is to use tlmgr to add or remove the -appropriate package. - -If you need to make manual additions, you can edit the files -language-local.dat and language-local.def under TEXMFLOCAL. Further -information with tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - tcBatchHyphenFormat=$2 - formatsForHyphen=`getFormatsForHyphen` - formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'` - help="Usage: $progname hyphen FORMAT - -Valid FORMATs are: -$formatsForHyphenFmt" - case $tcBatchHyphenFormat in - "") - echo "$help" >&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/Master/bin/i386-kfreebsd/texconfig-dialog b/Master/bin/i386-kfreebsd/texconfig-dialog deleted file mode 100755 index e1868d91574..00000000000 --- a/Master/bin/i386-kfreebsd/texconfig-dialog +++ /dev/null @@ -1,486 +0,0 @@ -#!/bin/sh - -# TeX-Config version 3.0 -# Thomas Esser, te@dbs.uni-hannover.de. Public domain. - -# 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+"$@"}'='"$@"' - -# the version string -version='$Id: texconfig-dialog 23826 2011-09-05 17:59:15Z karl $' - -: ${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/Master/bin/i386-kfreebsd/texconfig-sys b/Master/bin/i386-kfreebsd/texconfig-sys deleted file mode 100755 index ff549003ad2..00000000000 --- a/Master/bin/i386-kfreebsd/texconfig-sys +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $Id: texconfig-sys 20962 2011-01-07 11:45:38Z peter $ - -# 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/Master/bin/i386-kfreebsd/texlinks b/Master/bin/i386-kfreebsd/texlinks deleted file mode 100755 index 09b3488d263..00000000000 --- a/Master/bin/i386-kfreebsd/texlinks +++ /dev/null @@ -1,335 +0,0 @@ -#!/bin/sh -# $Id: texlinks 18035 2010-04-28 17:41:52Z mpg $ - -# 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 <vext01@gmail.com> -# 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: texlinks 18035 2010-04-28 17:41:52Z mpg $' -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: <http://tug.org/texlive/> -' - -############################################################################### -# 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/Master/bin/i386-linux/fmtutil b/Master/bin/i386-linux/fmtutil deleted file mode 100755 index 06ef11380b4..00000000000 --- a/Master/bin/i386-linux/fmtutil +++ /dev/null @@ -1,1017 +0,0 @@ -#!/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" to avoid interaction. -# Sun Mar 21 19:44:36 CET 2004: support aleph -# Thu Dec 25 22:11:53 CET 2003: add version string -# Thu Dec 25 12:56:14 CET 2003: new listcfg_loop lists only supported formats -# Sun Dec 21 10:25:37 CET 2003 "mktexfmt pdflatex" did not work (if called -# as mktexfmt, an extention was mandatory) -# Mon Sep 15 13:07:31 CEST 2003 add tmpdir to TEXINPUTS -# Sun Aug 3 11:09:46 CEST 2003 special case for mptopdf -# Sun Apr 20 10:27:09 CEST 2003 allow " " as well as tab in config file -# Wed Feb 19 21:14:52 CET 2003 add eomega support -# Sat Feb 15 22:01:35 CET 2003 let mf-nowin work without mf -# Wed Dec 25 09:47:44 CET 2002 bugfix for localized pool files -# Fri Oct 25 02:29:06 CEST 2002: now more careful about find_hyphenfile() -# Tue Oct 22 22:46:48 CEST 2002: -jobname, oft extension -# Fri Oct 4 22:33:17 CEST 2002: add more cli stuff: enablefmt -# disablefmt listcfg -# Sun Jul 7 21:28:37 CEST 2002: look at log file for possible problems, -# and issue a warning -# Tue Jun 4 21:52:57 CEST 2002: trap / cleanup code from updmap -# Tue Jun 4 19:32:44 CEST 2002: be smarter about stdout / stderr -# Tue Apr 9 22:46:34 CEST 2002: pass -progname=mpost for metafun -# Tue Apr 2 00:37:39 CEST 2002: added mktexfmt functionality -# Tue Jun 5 14:45:57 CEST 2001: added support for mf / mpost -############################################################################### - -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+"$@"}'='"$@"' - -progname=fmtutil -argv0=$0 -version='$Id: fmtutil 25899 2012-04-09 23:09:26Z karl $' - -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 -$version -Usage: fmtutil [OPTION]... CMD [ARG]... -Usage: mktexfmt FORMAT.fmt|BASE.base|MEM.mem|FMTNAME.EXT - -Rebuild and manage TeX formats, Metafont bases and MetaPost mems. - -If the command name ends in mktexfmt, only one format can be created. -The only options supported are --help and --version, and the command -line must consist of either a format name, with its extension, or a -plain name that is passed as the argument to --byfmt (see below). The -full name of the generated file (if any) is written to stdout, and -nothing else. - -If not operating in mktexfmt mode, the command line can be more general, -and multiple formats can be generated, as follows. - -Optional behavior: - --cnffile FILE read FILE instead of fmtutil.cnf. - --fmtdir DIRECTORY - --no-engine-subdir don't use engine-specific subdir of the fmtdir - --no-error-if-no-format exit successfully if no format is selected - --quiet be silent - --test (not implemented, just for compatibility) - --dolinks (not implemented, just for compatibility) - --force (not implemented, just for compatibility) - -Valid commands for fmtutil: - --all recreate all format files - --missing create all missing format files - --refresh recreate only existing format files - --byengine ENGINENAME (re)create formats using ENGINENAME - --byfmt FORMATNAME (re)create format for FORMATNAME - --byhyphen HYPHENFILE (re)create formats that depend on HYPHENFILE - --enablefmt FORMATNAME enable formatname in config file - --disablefmt FORMATNAME disable formatname in config file - --listcfg list (enabled and disabled) configurations, - filtered to available formats - --catcfg output the content of the config file - --showhyphen FORMATNAME print name of hyphenfile for format FORMATNAME - --edit no-op in TeX Live - --version show version info - --help show this message - -The default config file is named fmtutil.cnf, and -running kpsewhich fmtutil.cnf should show the active file. -The command kpsewhich --engine=/ --all foo.fmt should show the -locations of any and all foo.fmt files. - -For more information about fmt generation in TeX Live, try -tlmgr --help or see http://tug.org/texlive/doc/tlmgr.html. -The \`generate' action in tlmgr does the work. - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -eof - cleanup 0 -} - -versionfunc() -{ - cat <<eof -$progname version $version -eof - cleanup 0 -} - -############################################################################### -# 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'" -} - -############################################################################### -# 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() -{ - file=$1; pat=$2; line=$3 - - if grep "$pat" "$file" >/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 <<eof - -############################################################################### -$progname: Warning! Some warnings have been issued. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`warning' messages: -$log_warning_msg -eof - } >&2 - fi - - if $has_errors; then - { - cat <<eof - -############################################################################### -$progname: Error! Not all formats have been built successfully. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`failed' messages: -$log_failure_msg -eof - } >&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 - - if test $use_engine_dir; then - fulldestdir="$destdir/$texengine" - else - fulldestdir="$destdir" - fi - mkdir -p "$fulldestdir" - if test -f "$fmtfile"; then - grep '^! ' $format.log >/dev/null 2>&1 && - log_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 - # - destfile=$fulldestdir/$fmtfile - if mv "$fmtfile" "$destfile" </dev/null; then - verboseMsg "$progname: $destfile installed." - # - # As a special special case, we create mplib-luatex.mem for use by - # the mplib embedded in luatex if it doesn't already exist. (We - # never update it if it does exist.) - # - # This is used by the luamplib package. This way, an expert user - # who wants to try a new version of luatex (hence with a new - # version of mplib) can manually update mplib-luatex.mem without - # having to tamper with mpost itself. - # - if test "x$format" = xmpost && test "x$engine" = xmpost; then - mplib_mem_name=mplib-luatex.mem - mplib_mem_file=$fulldestdir/$mplib_mem_name - if test \! -f $mplib_mem_file; then - verboseMsg "$progname: copying $destfile to $mplib_mem_file" - if cp "$destfile" "$mplib_mem_file" </dev/null; then - mktexupd "$fulldestdir" "$mplib_mem_name" - else - log_warning "cp $destfile $mplib_mem_file failed." - fi - else - verboseMsg "$progname: $mplib_mem_file already exists, not updating." - fi - fi - # - # Echo the (main) output filename for our caller. - $mktexfmtMode && $mktexfmtFirst \ - && echo "$destfile" && mktexfmtFirst=false - # - mktexupd "$fulldestdir" "$fmtfile" - fi - else - log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed" - fi -} - -############################################################################### -# recreate_loop() -# for each line in config file: check match-condition and recreate format -# if there is a match -############################################################################### -recreate_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line || continue - check_match || continue - run_initex - done -} - -############################################################################### -# listcfg_loop() -# prints all format definitions in config files (enabled and disabled ones) -# for supported formats (i.e. for those which have an existing ini file) -############################################################################### -listcfg_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#$/d; /^#[^!]/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line && echo "$line" - done -} - -############################################################################### -# check_match() -# recreate all formats -############################################################################### -check_match() -{ - $need_find_hyphenfile && \ - this_hyphenfile="`find_hyphenfile "$format" "$hyphenation"`" - - eval $match_cmd && setmatch true -} - -############################################################################### -# recreate_by_fmt(fmtname) -# recreate all versions of fmtname -############################################################################### -recreate_by_fmt() -{ - fmtname=$1 - match_cmd="test x\$format = x$fmtname" - recreate_loop -} - -############################################################################### -# create_missing() -# create all missing format files -############################################################################### -create_missing() -{ - # match_cmd='test ! -f $destdir/$fmtfile' - match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_existing() -# recreate only existing format files -############################################################################### -recreate_existing() -{ - match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_all() -# recreate all formats -############################################################################### -recreate_all() -{ - match_cmd=true - recreate_loop -} - -############################################################################### -# recreate_by_hyphenfile(hyphenfile) -# recreate all formats that depend on hyphenfile -############################################################################### -recreate_by_hyphenfile() -{ - hyphenfile=$1 - - case $hyphenfile in - /*) - : - ;; - ./*) - hyphenfile="$KPSE_DOT/"`echo "$hyphenfile" | sed 's@..@@'` - ;; - *) - hyphenfile="$KPSE_DOT/$hyphenfile" - ;; - esac - need_find_hyphenfile=true - match_cmd="echo \"\$this_hyphenfile\" | grep $hyphenfile >/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/Master/bin/i386-linux/fmtutil-sys b/Master/bin/i386-linux/fmtutil-sys deleted file mode 100755 index bfb52f94e1f..00000000000 --- a/Master/bin/i386-linux/fmtutil-sys +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/Master/bin/i386-linux/texconfig b/Master/bin/i386-linux/texconfig deleted file mode 100755 index c9cc73c8305..00000000000 --- a/Master/bin/i386-linux/texconfig +++ /dev/null @@ -1,1432 +0,0 @@ -#!/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' </dev/null \ - | awk '$1 == "XDPI" || $1 == "YDPI" { print $3 }' - ) -} - -############################################################################### -# checkElemInList(elem, list) -# check if element exists in list -############################################################################### -checkElemInList() -{ - checkElemInListElem=$1; shift - checkElemInListFound=false - for checkElemInListIter - do - case "x$checkElemInListElem" in - x$checkElemInListIter) - checkElemInListFound=true - break - ;; - esac - done - case $checkElemInListFound in - true) (exit 0); return 0;; - esac - (exit 1); return 1 -} - - -# show version information from the distribution, if we have any. -showDistVersionInfo() -{ - # TeX Live file. - test -f $MT_TEXMFMAIN/../release-texlive.txt \ - && sed 1q $MT_TEXMFMAIN/../release-texlive.txt - - # no harm in continuing to look for the teTeX files. - test -f $MT_TEXMFMAIN/release-tetex-src.txt \ - && "teTeX-src release: `cat $MT_TEXMFMAIN/release-tetex-src.txt`" - test -f $MT_TEXMFDIST/release-tetex-texmf.txt \ - && "teTeX-texmf release: `cat $MT_TEXMFDIST/release-tetex-texmf.txt`" -} - -# -############################################################################### -# tcBatch(args) -# handle batch mode -############################################################################### -tcBatch() -{ - help="texconfig supports adjusting and updating many aspects of -the TeX installation. - -Usage: $progname conf (show configuration information) - $progname dvipdfmx paper PAPER (dvipdfmx paper size) - $progname dvipdfm paper PAPER (dvipdfm paper size) - $progname dvips [OPTION...] (dvips options) - $progname faq (show teTeX faq) - $progname findprog PROG... (show locations of PROGs, a la which) - $progname font vardir DIR - $progname font ro - $progname font rw - $progname formats (edit fmtutil.cnf) - $progname help (or --help; show this help) - $progname hyphen FORMAT (edit hyphenation config for FORMAT) - $progname init [FORMAT]... (rebuild FORMATs, or all formats - plus run texlinks and updmap) - $progname mode MODE (set Metafont MODE) - $progname paper PAPER (set default paper size to PAPER) - $progname pdftex [OPTION]... (pdftex options) - $progname rehash (rebuild ls-R files with mktexlsr) - $progname version (or --version; show version info) - $progname xdvi paper PAPER (xdvi paper size) - -Get more help with: - $progname dvipdfmx - $progname dvipdfm - $progname dvips - $progname font - $progname hyphen - $progname mode - $progname paper - $progname pdftex - $progname xdvi - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -" - - case $1 in - # texconfig conf - conf|confall) - setupTexmfmain - setupTexmfdist - echo '=========================== version information ==========================' - showDistVersionInfo - echo - echo '==================== binaries found by searching $PATH ===================' - echo "PATH=$PATH" - echoLocateBinary kpsewhich updmap fmtutil texconfig tex pdftex mktexpk dvips dvipdfm - echo - echo '=========================== active config files ==========================' - echoLocateCfgfile texmf.cnf updmap.cfg fmtutil.cnf config.ps mktex.cnf XDvi pdftexconfig.tex config | sort -k 2 - echo - echo '============================= font map files =============================' - for m in psfonts.map pdftex.map ps2pk.map dvipdfm.map; do - echo "$m: `kpsewhich $m`" - done - echo - echo '=========================== kpathsea variables ===========================' - echoShowKpseVariable TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS - - echo - echo '==== kpathsea variables from environment only (ok if no output here) ====' - echoShowVariable $envVars - ;; - - # texconfig dvipdfm - dvipdfm) - help="Usage: $progname dvipdfm paper PAPER - -Valid PAPER settings: - letter legal ledger tabloid a4 a3" - case $2 in - # texconfig dvipdfm 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 config '^p' "p $3";; - "") echo "$help" >&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 <unknown> - *) - 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 <unknown> - *) - 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 <<EOM -texconfig formats is no longer supported, because manual edits of -fmtutil.cnf will be overwritten by the new TeX Live package manager, -tlmgr, which regenerates that file as needed upon package changes. -Thus, to add or remove formats, the recommended method is to use tlmgr -to add or remove the appropriate package. - -If you need to make manual additions, you can edit the file -fmtutil-local.cnf under TEXMFLOCAL. Further information with -tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - setupTmpDir - echo "$progname: analyzing old configuration..." >&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 <<EOM -texconfig hyphen is no longer supported, because manual edits of -language.dat (or language.def) will be overwritten by the new TeX Live -package manager, tlmgr, which regenerates those configuration files as -needed upon package changes. Thus, to add or remove hyphenation -patterns, the recommended method is to use tlmgr to add or remove the -appropriate package. - -If you need to make manual additions, you can edit the files -language-local.dat and language-local.def under TEXMFLOCAL. Further -information with tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - tcBatchHyphenFormat=$2 - formatsForHyphen=`getFormatsForHyphen` - formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'` - help="Usage: $progname hyphen FORMAT - -Valid FORMATs are: -$formatsForHyphenFmt" - case $tcBatchHyphenFormat in - "") - echo "$help" >&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/Master/bin/i386-linux/texconfig-dialog b/Master/bin/i386-linux/texconfig-dialog deleted file mode 100755 index e1868d91574..00000000000 --- a/Master/bin/i386-linux/texconfig-dialog +++ /dev/null @@ -1,486 +0,0 @@ -#!/bin/sh - -# TeX-Config version 3.0 -# Thomas Esser, te@dbs.uni-hannover.de. Public domain. - -# 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+"$@"}'='"$@"' - -# the version string -version='$Id: texconfig-dialog 23826 2011-09-05 17:59:15Z karl $' - -: ${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/Master/bin/i386-linux/texconfig-sys b/Master/bin/i386-linux/texconfig-sys deleted file mode 100755 index ff549003ad2..00000000000 --- a/Master/bin/i386-linux/texconfig-sys +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $Id: texconfig-sys 20962 2011-01-07 11:45:38Z peter $ - -# 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/Master/bin/i386-linux/texlinks b/Master/bin/i386-linux/texlinks deleted file mode 100755 index 09b3488d263..00000000000 --- a/Master/bin/i386-linux/texlinks +++ /dev/null @@ -1,335 +0,0 @@ -#!/bin/sh -# $Id: texlinks 18035 2010-04-28 17:41:52Z mpg $ - -# 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 <vext01@gmail.com> -# 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: texlinks 18035 2010-04-28 17:41:52Z mpg $' -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: <http://tug.org/texlive/> -' - -############################################################################### -# 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/Master/bin/i386-solaris/fmtutil b/Master/bin/i386-solaris/fmtutil deleted file mode 100755 index 06ef11380b4..00000000000 --- a/Master/bin/i386-solaris/fmtutil +++ /dev/null @@ -1,1017 +0,0 @@ -#!/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" to avoid interaction. -# Sun Mar 21 19:44:36 CET 2004: support aleph -# Thu Dec 25 22:11:53 CET 2003: add version string -# Thu Dec 25 12:56:14 CET 2003: new listcfg_loop lists only supported formats -# Sun Dec 21 10:25:37 CET 2003 "mktexfmt pdflatex" did not work (if called -# as mktexfmt, an extention was mandatory) -# Mon Sep 15 13:07:31 CEST 2003 add tmpdir to TEXINPUTS -# Sun Aug 3 11:09:46 CEST 2003 special case for mptopdf -# Sun Apr 20 10:27:09 CEST 2003 allow " " as well as tab in config file -# Wed Feb 19 21:14:52 CET 2003 add eomega support -# Sat Feb 15 22:01:35 CET 2003 let mf-nowin work without mf -# Wed Dec 25 09:47:44 CET 2002 bugfix for localized pool files -# Fri Oct 25 02:29:06 CEST 2002: now more careful about find_hyphenfile() -# Tue Oct 22 22:46:48 CEST 2002: -jobname, oft extension -# Fri Oct 4 22:33:17 CEST 2002: add more cli stuff: enablefmt -# disablefmt listcfg -# Sun Jul 7 21:28:37 CEST 2002: look at log file for possible problems, -# and issue a warning -# Tue Jun 4 21:52:57 CEST 2002: trap / cleanup code from updmap -# Tue Jun 4 19:32:44 CEST 2002: be smarter about stdout / stderr -# Tue Apr 9 22:46:34 CEST 2002: pass -progname=mpost for metafun -# Tue Apr 2 00:37:39 CEST 2002: added mktexfmt functionality -# Tue Jun 5 14:45:57 CEST 2001: added support for mf / mpost -############################################################################### - -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+"$@"}'='"$@"' - -progname=fmtutil -argv0=$0 -version='$Id: fmtutil 25899 2012-04-09 23:09:26Z karl $' - -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 -$version -Usage: fmtutil [OPTION]... CMD [ARG]... -Usage: mktexfmt FORMAT.fmt|BASE.base|MEM.mem|FMTNAME.EXT - -Rebuild and manage TeX formats, Metafont bases and MetaPost mems. - -If the command name ends in mktexfmt, only one format can be created. -The only options supported are --help and --version, and the command -line must consist of either a format name, with its extension, or a -plain name that is passed as the argument to --byfmt (see below). The -full name of the generated file (if any) is written to stdout, and -nothing else. - -If not operating in mktexfmt mode, the command line can be more general, -and multiple formats can be generated, as follows. - -Optional behavior: - --cnffile FILE read FILE instead of fmtutil.cnf. - --fmtdir DIRECTORY - --no-engine-subdir don't use engine-specific subdir of the fmtdir - --no-error-if-no-format exit successfully if no format is selected - --quiet be silent - --test (not implemented, just for compatibility) - --dolinks (not implemented, just for compatibility) - --force (not implemented, just for compatibility) - -Valid commands for fmtutil: - --all recreate all format files - --missing create all missing format files - --refresh recreate only existing format files - --byengine ENGINENAME (re)create formats using ENGINENAME - --byfmt FORMATNAME (re)create format for FORMATNAME - --byhyphen HYPHENFILE (re)create formats that depend on HYPHENFILE - --enablefmt FORMATNAME enable formatname in config file - --disablefmt FORMATNAME disable formatname in config file - --listcfg list (enabled and disabled) configurations, - filtered to available formats - --catcfg output the content of the config file - --showhyphen FORMATNAME print name of hyphenfile for format FORMATNAME - --edit no-op in TeX Live - --version show version info - --help show this message - -The default config file is named fmtutil.cnf, and -running kpsewhich fmtutil.cnf should show the active file. -The command kpsewhich --engine=/ --all foo.fmt should show the -locations of any and all foo.fmt files. - -For more information about fmt generation in TeX Live, try -tlmgr --help or see http://tug.org/texlive/doc/tlmgr.html. -The \`generate' action in tlmgr does the work. - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -eof - cleanup 0 -} - -versionfunc() -{ - cat <<eof -$progname version $version -eof - cleanup 0 -} - -############################################################################### -# 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'" -} - -############################################################################### -# 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() -{ - file=$1; pat=$2; line=$3 - - if grep "$pat" "$file" >/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 <<eof - -############################################################################### -$progname: Warning! Some warnings have been issued. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`warning' messages: -$log_warning_msg -eof - } >&2 - fi - - if $has_errors; then - { - cat <<eof - -############################################################################### -$progname: Error! Not all formats have been built successfully. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`failed' messages: -$log_failure_msg -eof - } >&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 - - if test $use_engine_dir; then - fulldestdir="$destdir/$texengine" - else - fulldestdir="$destdir" - fi - mkdir -p "$fulldestdir" - if test -f "$fmtfile"; then - grep '^! ' $format.log >/dev/null 2>&1 && - log_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 - # - destfile=$fulldestdir/$fmtfile - if mv "$fmtfile" "$destfile" </dev/null; then - verboseMsg "$progname: $destfile installed." - # - # As a special special case, we create mplib-luatex.mem for use by - # the mplib embedded in luatex if it doesn't already exist. (We - # never update it if it does exist.) - # - # This is used by the luamplib package. This way, an expert user - # who wants to try a new version of luatex (hence with a new - # version of mplib) can manually update mplib-luatex.mem without - # having to tamper with mpost itself. - # - if test "x$format" = xmpost && test "x$engine" = xmpost; then - mplib_mem_name=mplib-luatex.mem - mplib_mem_file=$fulldestdir/$mplib_mem_name - if test \! -f $mplib_mem_file; then - verboseMsg "$progname: copying $destfile to $mplib_mem_file" - if cp "$destfile" "$mplib_mem_file" </dev/null; then - mktexupd "$fulldestdir" "$mplib_mem_name" - else - log_warning "cp $destfile $mplib_mem_file failed." - fi - else - verboseMsg "$progname: $mplib_mem_file already exists, not updating." - fi - fi - # - # Echo the (main) output filename for our caller. - $mktexfmtMode && $mktexfmtFirst \ - && echo "$destfile" && mktexfmtFirst=false - # - mktexupd "$fulldestdir" "$fmtfile" - fi - else - log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed" - fi -} - -############################################################################### -# recreate_loop() -# for each line in config file: check match-condition and recreate format -# if there is a match -############################################################################### -recreate_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line || continue - check_match || continue - run_initex - done -} - -############################################################################### -# listcfg_loop() -# prints all format definitions in config files (enabled and disabled ones) -# for supported formats (i.e. for those which have an existing ini file) -############################################################################### -listcfg_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#$/d; /^#[^!]/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line && echo "$line" - done -} - -############################################################################### -# check_match() -# recreate all formats -############################################################################### -check_match() -{ - $need_find_hyphenfile && \ - this_hyphenfile="`find_hyphenfile "$format" "$hyphenation"`" - - eval $match_cmd && setmatch true -} - -############################################################################### -# recreate_by_fmt(fmtname) -# recreate all versions of fmtname -############################################################################### -recreate_by_fmt() -{ - fmtname=$1 - match_cmd="test x\$format = x$fmtname" - recreate_loop -} - -############################################################################### -# create_missing() -# create all missing format files -############################################################################### -create_missing() -{ - # match_cmd='test ! -f $destdir/$fmtfile' - match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_existing() -# recreate only existing format files -############################################################################### -recreate_existing() -{ - match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_all() -# recreate all formats -############################################################################### -recreate_all() -{ - match_cmd=true - recreate_loop -} - -############################################################################### -# recreate_by_hyphenfile(hyphenfile) -# recreate all formats that depend on hyphenfile -############################################################################### -recreate_by_hyphenfile() -{ - hyphenfile=$1 - - case $hyphenfile in - /*) - : - ;; - ./*) - hyphenfile="$KPSE_DOT/"`echo "$hyphenfile" | sed 's@..@@'` - ;; - *) - hyphenfile="$KPSE_DOT/$hyphenfile" - ;; - esac - need_find_hyphenfile=true - match_cmd="echo \"\$this_hyphenfile\" | grep $hyphenfile >/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/Master/bin/i386-solaris/fmtutil-sys b/Master/bin/i386-solaris/fmtutil-sys deleted file mode 100755 index bfb52f94e1f..00000000000 --- a/Master/bin/i386-solaris/fmtutil-sys +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/Master/bin/i386-solaris/texconfig b/Master/bin/i386-solaris/texconfig deleted file mode 100755 index c9cc73c8305..00000000000 --- a/Master/bin/i386-solaris/texconfig +++ /dev/null @@ -1,1432 +0,0 @@ -#!/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' </dev/null \ - | awk '$1 == "XDPI" || $1 == "YDPI" { print $3 }' - ) -} - -############################################################################### -# checkElemInList(elem, list) -# check if element exists in list -############################################################################### -checkElemInList() -{ - checkElemInListElem=$1; shift - checkElemInListFound=false - for checkElemInListIter - do - case "x$checkElemInListElem" in - x$checkElemInListIter) - checkElemInListFound=true - break - ;; - esac - done - case $checkElemInListFound in - true) (exit 0); return 0;; - esac - (exit 1); return 1 -} - - -# show version information from the distribution, if we have any. -showDistVersionInfo() -{ - # TeX Live file. - test -f $MT_TEXMFMAIN/../release-texlive.txt \ - && sed 1q $MT_TEXMFMAIN/../release-texlive.txt - - # no harm in continuing to look for the teTeX files. - test -f $MT_TEXMFMAIN/release-tetex-src.txt \ - && "teTeX-src release: `cat $MT_TEXMFMAIN/release-tetex-src.txt`" - test -f $MT_TEXMFDIST/release-tetex-texmf.txt \ - && "teTeX-texmf release: `cat $MT_TEXMFDIST/release-tetex-texmf.txt`" -} - -# -############################################################################### -# tcBatch(args) -# handle batch mode -############################################################################### -tcBatch() -{ - help="texconfig supports adjusting and updating many aspects of -the TeX installation. - -Usage: $progname conf (show configuration information) - $progname dvipdfmx paper PAPER (dvipdfmx paper size) - $progname dvipdfm paper PAPER (dvipdfm paper size) - $progname dvips [OPTION...] (dvips options) - $progname faq (show teTeX faq) - $progname findprog PROG... (show locations of PROGs, a la which) - $progname font vardir DIR - $progname font ro - $progname font rw - $progname formats (edit fmtutil.cnf) - $progname help (or --help; show this help) - $progname hyphen FORMAT (edit hyphenation config for FORMAT) - $progname init [FORMAT]... (rebuild FORMATs, or all formats - plus run texlinks and updmap) - $progname mode MODE (set Metafont MODE) - $progname paper PAPER (set default paper size to PAPER) - $progname pdftex [OPTION]... (pdftex options) - $progname rehash (rebuild ls-R files with mktexlsr) - $progname version (or --version; show version info) - $progname xdvi paper PAPER (xdvi paper size) - -Get more help with: - $progname dvipdfmx - $progname dvipdfm - $progname dvips - $progname font - $progname hyphen - $progname mode - $progname paper - $progname pdftex - $progname xdvi - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -" - - case $1 in - # texconfig conf - conf|confall) - setupTexmfmain - setupTexmfdist - echo '=========================== version information ==========================' - showDistVersionInfo - echo - echo '==================== binaries found by searching $PATH ===================' - echo "PATH=$PATH" - echoLocateBinary kpsewhich updmap fmtutil texconfig tex pdftex mktexpk dvips dvipdfm - echo - echo '=========================== active config files ==========================' - echoLocateCfgfile texmf.cnf updmap.cfg fmtutil.cnf config.ps mktex.cnf XDvi pdftexconfig.tex config | sort -k 2 - echo - echo '============================= font map files =============================' - for m in psfonts.map pdftex.map ps2pk.map dvipdfm.map; do - echo "$m: `kpsewhich $m`" - done - echo - echo '=========================== kpathsea variables ===========================' - echoShowKpseVariable TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS - - echo - echo '==== kpathsea variables from environment only (ok if no output here) ====' - echoShowVariable $envVars - ;; - - # texconfig dvipdfm - dvipdfm) - help="Usage: $progname dvipdfm paper PAPER - -Valid PAPER settings: - letter legal ledger tabloid a4 a3" - case $2 in - # texconfig dvipdfm 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 config '^p' "p $3";; - "") echo "$help" >&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 <unknown> - *) - 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 <unknown> - *) - 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 <<EOM -texconfig formats is no longer supported, because manual edits of -fmtutil.cnf will be overwritten by the new TeX Live package manager, -tlmgr, which regenerates that file as needed upon package changes. -Thus, to add or remove formats, the recommended method is to use tlmgr -to add or remove the appropriate package. - -If you need to make manual additions, you can edit the file -fmtutil-local.cnf under TEXMFLOCAL. Further information with -tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - setupTmpDir - echo "$progname: analyzing old configuration..." >&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 <<EOM -texconfig hyphen is no longer supported, because manual edits of -language.dat (or language.def) will be overwritten by the new TeX Live -package manager, tlmgr, which regenerates those configuration files as -needed upon package changes. Thus, to add or remove hyphenation -patterns, the recommended method is to use tlmgr to add or remove the -appropriate package. - -If you need to make manual additions, you can edit the files -language-local.dat and language-local.def under TEXMFLOCAL. Further -information with tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - tcBatchHyphenFormat=$2 - formatsForHyphen=`getFormatsForHyphen` - formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'` - help="Usage: $progname hyphen FORMAT - -Valid FORMATs are: -$formatsForHyphenFmt" - case $tcBatchHyphenFormat in - "") - echo "$help" >&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/Master/bin/i386-solaris/texconfig-dialog b/Master/bin/i386-solaris/texconfig-dialog deleted file mode 100755 index e1868d91574..00000000000 --- a/Master/bin/i386-solaris/texconfig-dialog +++ /dev/null @@ -1,486 +0,0 @@ -#!/bin/sh - -# TeX-Config version 3.0 -# Thomas Esser, te@dbs.uni-hannover.de. Public domain. - -# 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+"$@"}'='"$@"' - -# the version string -version='$Id: texconfig-dialog 23826 2011-09-05 17:59:15Z karl $' - -: ${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/Master/bin/i386-solaris/texconfig-sys b/Master/bin/i386-solaris/texconfig-sys deleted file mode 100755 index ff549003ad2..00000000000 --- a/Master/bin/i386-solaris/texconfig-sys +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $Id: texconfig-sys 20962 2011-01-07 11:45:38Z peter $ - -# 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/Master/bin/i386-solaris/texlinks b/Master/bin/i386-solaris/texlinks deleted file mode 100755 index 09b3488d263..00000000000 --- a/Master/bin/i386-solaris/texlinks +++ /dev/null @@ -1,335 +0,0 @@ -#!/bin/sh -# $Id: texlinks 18035 2010-04-28 17:41:52Z mpg $ - -# 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 <vext01@gmail.com> -# 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: texlinks 18035 2010-04-28 17:41:52Z mpg $' -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: <http://tug.org/texlive/> -' - -############################################################################### -# 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/Master/bin/mipsel-linux/fmtutil b/Master/bin/mipsel-linux/fmtutil deleted file mode 100755 index 06ef11380b4..00000000000 --- a/Master/bin/mipsel-linux/fmtutil +++ /dev/null @@ -1,1017 +0,0 @@ -#!/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" to avoid interaction. -# Sun Mar 21 19:44:36 CET 2004: support aleph -# Thu Dec 25 22:11:53 CET 2003: add version string -# Thu Dec 25 12:56:14 CET 2003: new listcfg_loop lists only supported formats -# Sun Dec 21 10:25:37 CET 2003 "mktexfmt pdflatex" did not work (if called -# as mktexfmt, an extention was mandatory) -# Mon Sep 15 13:07:31 CEST 2003 add tmpdir to TEXINPUTS -# Sun Aug 3 11:09:46 CEST 2003 special case for mptopdf -# Sun Apr 20 10:27:09 CEST 2003 allow " " as well as tab in config file -# Wed Feb 19 21:14:52 CET 2003 add eomega support -# Sat Feb 15 22:01:35 CET 2003 let mf-nowin work without mf -# Wed Dec 25 09:47:44 CET 2002 bugfix for localized pool files -# Fri Oct 25 02:29:06 CEST 2002: now more careful about find_hyphenfile() -# Tue Oct 22 22:46:48 CEST 2002: -jobname, oft extension -# Fri Oct 4 22:33:17 CEST 2002: add more cli stuff: enablefmt -# disablefmt listcfg -# Sun Jul 7 21:28:37 CEST 2002: look at log file for possible problems, -# and issue a warning -# Tue Jun 4 21:52:57 CEST 2002: trap / cleanup code from updmap -# Tue Jun 4 19:32:44 CEST 2002: be smarter about stdout / stderr -# Tue Apr 9 22:46:34 CEST 2002: pass -progname=mpost for metafun -# Tue Apr 2 00:37:39 CEST 2002: added mktexfmt functionality -# Tue Jun 5 14:45:57 CEST 2001: added support for mf / mpost -############################################################################### - -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+"$@"}'='"$@"' - -progname=fmtutil -argv0=$0 -version='$Id: fmtutil 25899 2012-04-09 23:09:26Z karl $' - -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 -$version -Usage: fmtutil [OPTION]... CMD [ARG]... -Usage: mktexfmt FORMAT.fmt|BASE.base|MEM.mem|FMTNAME.EXT - -Rebuild and manage TeX formats, Metafont bases and MetaPost mems. - -If the command name ends in mktexfmt, only one format can be created. -The only options supported are --help and --version, and the command -line must consist of either a format name, with its extension, or a -plain name that is passed as the argument to --byfmt (see below). The -full name of the generated file (if any) is written to stdout, and -nothing else. - -If not operating in mktexfmt mode, the command line can be more general, -and multiple formats can be generated, as follows. - -Optional behavior: - --cnffile FILE read FILE instead of fmtutil.cnf. - --fmtdir DIRECTORY - --no-engine-subdir don't use engine-specific subdir of the fmtdir - --no-error-if-no-format exit successfully if no format is selected - --quiet be silent - --test (not implemented, just for compatibility) - --dolinks (not implemented, just for compatibility) - --force (not implemented, just for compatibility) - -Valid commands for fmtutil: - --all recreate all format files - --missing create all missing format files - --refresh recreate only existing format files - --byengine ENGINENAME (re)create formats using ENGINENAME - --byfmt FORMATNAME (re)create format for FORMATNAME - --byhyphen HYPHENFILE (re)create formats that depend on HYPHENFILE - --enablefmt FORMATNAME enable formatname in config file - --disablefmt FORMATNAME disable formatname in config file - --listcfg list (enabled and disabled) configurations, - filtered to available formats - --catcfg output the content of the config file - --showhyphen FORMATNAME print name of hyphenfile for format FORMATNAME - --edit no-op in TeX Live - --version show version info - --help show this message - -The default config file is named fmtutil.cnf, and -running kpsewhich fmtutil.cnf should show the active file. -The command kpsewhich --engine=/ --all foo.fmt should show the -locations of any and all foo.fmt files. - -For more information about fmt generation in TeX Live, try -tlmgr --help or see http://tug.org/texlive/doc/tlmgr.html. -The \`generate' action in tlmgr does the work. - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -eof - cleanup 0 -} - -versionfunc() -{ - cat <<eof -$progname version $version -eof - cleanup 0 -} - -############################################################################### -# 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'" -} - -############################################################################### -# 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() -{ - file=$1; pat=$2; line=$3 - - if grep "$pat" "$file" >/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 <<eof - -############################################################################### -$progname: Warning! Some warnings have been issued. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`warning' messages: -$log_warning_msg -eof - } >&2 - fi - - if $has_errors; then - { - cat <<eof - -############################################################################### -$progname: Error! Not all formats have been built successfully. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`failed' messages: -$log_failure_msg -eof - } >&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 - - if test $use_engine_dir; then - fulldestdir="$destdir/$texengine" - else - fulldestdir="$destdir" - fi - mkdir -p "$fulldestdir" - if test -f "$fmtfile"; then - grep '^! ' $format.log >/dev/null 2>&1 && - log_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 - # - destfile=$fulldestdir/$fmtfile - if mv "$fmtfile" "$destfile" </dev/null; then - verboseMsg "$progname: $destfile installed." - # - # As a special special case, we create mplib-luatex.mem for use by - # the mplib embedded in luatex if it doesn't already exist. (We - # never update it if it does exist.) - # - # This is used by the luamplib package. This way, an expert user - # who wants to try a new version of luatex (hence with a new - # version of mplib) can manually update mplib-luatex.mem without - # having to tamper with mpost itself. - # - if test "x$format" = xmpost && test "x$engine" = xmpost; then - mplib_mem_name=mplib-luatex.mem - mplib_mem_file=$fulldestdir/$mplib_mem_name - if test \! -f $mplib_mem_file; then - verboseMsg "$progname: copying $destfile to $mplib_mem_file" - if cp "$destfile" "$mplib_mem_file" </dev/null; then - mktexupd "$fulldestdir" "$mplib_mem_name" - else - log_warning "cp $destfile $mplib_mem_file failed." - fi - else - verboseMsg "$progname: $mplib_mem_file already exists, not updating." - fi - fi - # - # Echo the (main) output filename for our caller. - $mktexfmtMode && $mktexfmtFirst \ - && echo "$destfile" && mktexfmtFirst=false - # - mktexupd "$fulldestdir" "$fmtfile" - fi - else - log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed" - fi -} - -############################################################################### -# recreate_loop() -# for each line in config file: check match-condition and recreate format -# if there is a match -############################################################################### -recreate_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line || continue - check_match || continue - run_initex - done -} - -############################################################################### -# listcfg_loop() -# prints all format definitions in config files (enabled and disabled ones) -# for supported formats (i.e. for those which have an existing ini file) -############################################################################### -listcfg_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#$/d; /^#[^!]/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line && echo "$line" - done -} - -############################################################################### -# check_match() -# recreate all formats -############################################################################### -check_match() -{ - $need_find_hyphenfile && \ - this_hyphenfile="`find_hyphenfile "$format" "$hyphenation"`" - - eval $match_cmd && setmatch true -} - -############################################################################### -# recreate_by_fmt(fmtname) -# recreate all versions of fmtname -############################################################################### -recreate_by_fmt() -{ - fmtname=$1 - match_cmd="test x\$format = x$fmtname" - recreate_loop -} - -############################################################################### -# create_missing() -# create all missing format files -############################################################################### -create_missing() -{ - # match_cmd='test ! -f $destdir/$fmtfile' - match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_existing() -# recreate only existing format files -############################################################################### -recreate_existing() -{ - match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_all() -# recreate all formats -############################################################################### -recreate_all() -{ - match_cmd=true - recreate_loop -} - -############################################################################### -# recreate_by_hyphenfile(hyphenfile) -# recreate all formats that depend on hyphenfile -############################################################################### -recreate_by_hyphenfile() -{ - hyphenfile=$1 - - case $hyphenfile in - /*) - : - ;; - ./*) - hyphenfile="$KPSE_DOT/"`echo "$hyphenfile" | sed 's@..@@'` - ;; - *) - hyphenfile="$KPSE_DOT/$hyphenfile" - ;; - esac - need_find_hyphenfile=true - match_cmd="echo \"\$this_hyphenfile\" | grep $hyphenfile >/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/Master/bin/mipsel-linux/fmtutil-sys b/Master/bin/mipsel-linux/fmtutil-sys deleted file mode 100755 index bfb52f94e1f..00000000000 --- a/Master/bin/mipsel-linux/fmtutil-sys +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/Master/bin/mipsel-linux/texconfig b/Master/bin/mipsel-linux/texconfig deleted file mode 100755 index c9cc73c8305..00000000000 --- a/Master/bin/mipsel-linux/texconfig +++ /dev/null @@ -1,1432 +0,0 @@ -#!/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' </dev/null \ - | awk '$1 == "XDPI" || $1 == "YDPI" { print $3 }' - ) -} - -############################################################################### -# checkElemInList(elem, list) -# check if element exists in list -############################################################################### -checkElemInList() -{ - checkElemInListElem=$1; shift - checkElemInListFound=false - for checkElemInListIter - do - case "x$checkElemInListElem" in - x$checkElemInListIter) - checkElemInListFound=true - break - ;; - esac - done - case $checkElemInListFound in - true) (exit 0); return 0;; - esac - (exit 1); return 1 -} - - -# show version information from the distribution, if we have any. -showDistVersionInfo() -{ - # TeX Live file. - test -f $MT_TEXMFMAIN/../release-texlive.txt \ - && sed 1q $MT_TEXMFMAIN/../release-texlive.txt - - # no harm in continuing to look for the teTeX files. - test -f $MT_TEXMFMAIN/release-tetex-src.txt \ - && "teTeX-src release: `cat $MT_TEXMFMAIN/release-tetex-src.txt`" - test -f $MT_TEXMFDIST/release-tetex-texmf.txt \ - && "teTeX-texmf release: `cat $MT_TEXMFDIST/release-tetex-texmf.txt`" -} - -# -############################################################################### -# tcBatch(args) -# handle batch mode -############################################################################### -tcBatch() -{ - help="texconfig supports adjusting and updating many aspects of -the TeX installation. - -Usage: $progname conf (show configuration information) - $progname dvipdfmx paper PAPER (dvipdfmx paper size) - $progname dvipdfm paper PAPER (dvipdfm paper size) - $progname dvips [OPTION...] (dvips options) - $progname faq (show teTeX faq) - $progname findprog PROG... (show locations of PROGs, a la which) - $progname font vardir DIR - $progname font ro - $progname font rw - $progname formats (edit fmtutil.cnf) - $progname help (or --help; show this help) - $progname hyphen FORMAT (edit hyphenation config for FORMAT) - $progname init [FORMAT]... (rebuild FORMATs, or all formats - plus run texlinks and updmap) - $progname mode MODE (set Metafont MODE) - $progname paper PAPER (set default paper size to PAPER) - $progname pdftex [OPTION]... (pdftex options) - $progname rehash (rebuild ls-R files with mktexlsr) - $progname version (or --version; show version info) - $progname xdvi paper PAPER (xdvi paper size) - -Get more help with: - $progname dvipdfmx - $progname dvipdfm - $progname dvips - $progname font - $progname hyphen - $progname mode - $progname paper - $progname pdftex - $progname xdvi - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -" - - case $1 in - # texconfig conf - conf|confall) - setupTexmfmain - setupTexmfdist - echo '=========================== version information ==========================' - showDistVersionInfo - echo - echo '==================== binaries found by searching $PATH ===================' - echo "PATH=$PATH" - echoLocateBinary kpsewhich updmap fmtutil texconfig tex pdftex mktexpk dvips dvipdfm - echo - echo '=========================== active config files ==========================' - echoLocateCfgfile texmf.cnf updmap.cfg fmtutil.cnf config.ps mktex.cnf XDvi pdftexconfig.tex config | sort -k 2 - echo - echo '============================= font map files =============================' - for m in psfonts.map pdftex.map ps2pk.map dvipdfm.map; do - echo "$m: `kpsewhich $m`" - done - echo - echo '=========================== kpathsea variables ===========================' - echoShowKpseVariable TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS - - echo - echo '==== kpathsea variables from environment only (ok if no output here) ====' - echoShowVariable $envVars - ;; - - # texconfig dvipdfm - dvipdfm) - help="Usage: $progname dvipdfm paper PAPER - -Valid PAPER settings: - letter legal ledger tabloid a4 a3" - case $2 in - # texconfig dvipdfm 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 config '^p' "p $3";; - "") echo "$help" >&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 <unknown> - *) - 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 <unknown> - *) - 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 <<EOM -texconfig formats is no longer supported, because manual edits of -fmtutil.cnf will be overwritten by the new TeX Live package manager, -tlmgr, which regenerates that file as needed upon package changes. -Thus, to add or remove formats, the recommended method is to use tlmgr -to add or remove the appropriate package. - -If you need to make manual additions, you can edit the file -fmtutil-local.cnf under TEXMFLOCAL. Further information with -tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - setupTmpDir - echo "$progname: analyzing old configuration..." >&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 <<EOM -texconfig hyphen is no longer supported, because manual edits of -language.dat (or language.def) will be overwritten by the new TeX Live -package manager, tlmgr, which regenerates those configuration files as -needed upon package changes. Thus, to add or remove hyphenation -patterns, the recommended method is to use tlmgr to add or remove the -appropriate package. - -If you need to make manual additions, you can edit the files -language-local.dat and language-local.def under TEXMFLOCAL. Further -information with tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - tcBatchHyphenFormat=$2 - formatsForHyphen=`getFormatsForHyphen` - formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'` - help="Usage: $progname hyphen FORMAT - -Valid FORMATs are: -$formatsForHyphenFmt" - case $tcBatchHyphenFormat in - "") - echo "$help" >&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/Master/bin/mipsel-linux/texconfig-dialog b/Master/bin/mipsel-linux/texconfig-dialog deleted file mode 100755 index e1868d91574..00000000000 --- a/Master/bin/mipsel-linux/texconfig-dialog +++ /dev/null @@ -1,486 +0,0 @@ -#!/bin/sh - -# TeX-Config version 3.0 -# Thomas Esser, te@dbs.uni-hannover.de. Public domain. - -# 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+"$@"}'='"$@"' - -# the version string -version='$Id: texconfig-dialog 23826 2011-09-05 17:59:15Z karl $' - -: ${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/Master/bin/mipsel-linux/texconfig-sys b/Master/bin/mipsel-linux/texconfig-sys deleted file mode 100755 index ff549003ad2..00000000000 --- a/Master/bin/mipsel-linux/texconfig-sys +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $Id: texconfig-sys 20962 2011-01-07 11:45:38Z peter $ - -# 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/Master/bin/mipsel-linux/texlinks b/Master/bin/mipsel-linux/texlinks deleted file mode 100755 index 09b3488d263..00000000000 --- a/Master/bin/mipsel-linux/texlinks +++ /dev/null @@ -1,335 +0,0 @@ -#!/bin/sh -# $Id: texlinks 18035 2010-04-28 17:41:52Z mpg $ - -# 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 <vext01@gmail.com> -# 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: texlinks 18035 2010-04-28 17:41:52Z mpg $' -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: <http://tug.org/texlive/> -' - -############################################################################### -# 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/Master/bin/powerpc-aix/fmtutil b/Master/bin/powerpc-aix/fmtutil deleted file mode 100755 index 06ef11380b4..00000000000 --- a/Master/bin/powerpc-aix/fmtutil +++ /dev/null @@ -1,1017 +0,0 @@ -#!/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" to avoid interaction. -# Sun Mar 21 19:44:36 CET 2004: support aleph -# Thu Dec 25 22:11:53 CET 2003: add version string -# Thu Dec 25 12:56:14 CET 2003: new listcfg_loop lists only supported formats -# Sun Dec 21 10:25:37 CET 2003 "mktexfmt pdflatex" did not work (if called -# as mktexfmt, an extention was mandatory) -# Mon Sep 15 13:07:31 CEST 2003 add tmpdir to TEXINPUTS -# Sun Aug 3 11:09:46 CEST 2003 special case for mptopdf -# Sun Apr 20 10:27:09 CEST 2003 allow " " as well as tab in config file -# Wed Feb 19 21:14:52 CET 2003 add eomega support -# Sat Feb 15 22:01:35 CET 2003 let mf-nowin work without mf -# Wed Dec 25 09:47:44 CET 2002 bugfix for localized pool files -# Fri Oct 25 02:29:06 CEST 2002: now more careful about find_hyphenfile() -# Tue Oct 22 22:46:48 CEST 2002: -jobname, oft extension -# Fri Oct 4 22:33:17 CEST 2002: add more cli stuff: enablefmt -# disablefmt listcfg -# Sun Jul 7 21:28:37 CEST 2002: look at log file for possible problems, -# and issue a warning -# Tue Jun 4 21:52:57 CEST 2002: trap / cleanup code from updmap -# Tue Jun 4 19:32:44 CEST 2002: be smarter about stdout / stderr -# Tue Apr 9 22:46:34 CEST 2002: pass -progname=mpost for metafun -# Tue Apr 2 00:37:39 CEST 2002: added mktexfmt functionality -# Tue Jun 5 14:45:57 CEST 2001: added support for mf / mpost -############################################################################### - -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+"$@"}'='"$@"' - -progname=fmtutil -argv0=$0 -version='$Id: fmtutil 25899 2012-04-09 23:09:26Z karl $' - -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 -$version -Usage: fmtutil [OPTION]... CMD [ARG]... -Usage: mktexfmt FORMAT.fmt|BASE.base|MEM.mem|FMTNAME.EXT - -Rebuild and manage TeX formats, Metafont bases and MetaPost mems. - -If the command name ends in mktexfmt, only one format can be created. -The only options supported are --help and --version, and the command -line must consist of either a format name, with its extension, or a -plain name that is passed as the argument to --byfmt (see below). The -full name of the generated file (if any) is written to stdout, and -nothing else. - -If not operating in mktexfmt mode, the command line can be more general, -and multiple formats can be generated, as follows. - -Optional behavior: - --cnffile FILE read FILE instead of fmtutil.cnf. - --fmtdir DIRECTORY - --no-engine-subdir don't use engine-specific subdir of the fmtdir - --no-error-if-no-format exit successfully if no format is selected - --quiet be silent - --test (not implemented, just for compatibility) - --dolinks (not implemented, just for compatibility) - --force (not implemented, just for compatibility) - -Valid commands for fmtutil: - --all recreate all format files - --missing create all missing format files - --refresh recreate only existing format files - --byengine ENGINENAME (re)create formats using ENGINENAME - --byfmt FORMATNAME (re)create format for FORMATNAME - --byhyphen HYPHENFILE (re)create formats that depend on HYPHENFILE - --enablefmt FORMATNAME enable formatname in config file - --disablefmt FORMATNAME disable formatname in config file - --listcfg list (enabled and disabled) configurations, - filtered to available formats - --catcfg output the content of the config file - --showhyphen FORMATNAME print name of hyphenfile for format FORMATNAME - --edit no-op in TeX Live - --version show version info - --help show this message - -The default config file is named fmtutil.cnf, and -running kpsewhich fmtutil.cnf should show the active file. -The command kpsewhich --engine=/ --all foo.fmt should show the -locations of any and all foo.fmt files. - -For more information about fmt generation in TeX Live, try -tlmgr --help or see http://tug.org/texlive/doc/tlmgr.html. -The \`generate' action in tlmgr does the work. - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -eof - cleanup 0 -} - -versionfunc() -{ - cat <<eof -$progname version $version -eof - cleanup 0 -} - -############################################################################### -# 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'" -} - -############################################################################### -# 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() -{ - file=$1; pat=$2; line=$3 - - if grep "$pat" "$file" >/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 <<eof - -############################################################################### -$progname: Warning! Some warnings have been issued. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`warning' messages: -$log_warning_msg -eof - } >&2 - fi - - if $has_errors; then - { - cat <<eof - -############################################################################### -$progname: Error! Not all formats have been built successfully. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`failed' messages: -$log_failure_msg -eof - } >&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 - - if test $use_engine_dir; then - fulldestdir="$destdir/$texengine" - else - fulldestdir="$destdir" - fi - mkdir -p "$fulldestdir" - if test -f "$fmtfile"; then - grep '^! ' $format.log >/dev/null 2>&1 && - log_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 - # - destfile=$fulldestdir/$fmtfile - if mv "$fmtfile" "$destfile" </dev/null; then - verboseMsg "$progname: $destfile installed." - # - # As a special special case, we create mplib-luatex.mem for use by - # the mplib embedded in luatex if it doesn't already exist. (We - # never update it if it does exist.) - # - # This is used by the luamplib package. This way, an expert user - # who wants to try a new version of luatex (hence with a new - # version of mplib) can manually update mplib-luatex.mem without - # having to tamper with mpost itself. - # - if test "x$format" = xmpost && test "x$engine" = xmpost; then - mplib_mem_name=mplib-luatex.mem - mplib_mem_file=$fulldestdir/$mplib_mem_name - if test \! -f $mplib_mem_file; then - verboseMsg "$progname: copying $destfile to $mplib_mem_file" - if cp "$destfile" "$mplib_mem_file" </dev/null; then - mktexupd "$fulldestdir" "$mplib_mem_name" - else - log_warning "cp $destfile $mplib_mem_file failed." - fi - else - verboseMsg "$progname: $mplib_mem_file already exists, not updating." - fi - fi - # - # Echo the (main) output filename for our caller. - $mktexfmtMode && $mktexfmtFirst \ - && echo "$destfile" && mktexfmtFirst=false - # - mktexupd "$fulldestdir" "$fmtfile" - fi - else - log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed" - fi -} - -############################################################################### -# recreate_loop() -# for each line in config file: check match-condition and recreate format -# if there is a match -############################################################################### -recreate_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line || continue - check_match || continue - run_initex - done -} - -############################################################################### -# listcfg_loop() -# prints all format definitions in config files (enabled and disabled ones) -# for supported formats (i.e. for those which have an existing ini file) -############################################################################### -listcfg_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#$/d; /^#[^!]/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line && echo "$line" - done -} - -############################################################################### -# check_match() -# recreate all formats -############################################################################### -check_match() -{ - $need_find_hyphenfile && \ - this_hyphenfile="`find_hyphenfile "$format" "$hyphenation"`" - - eval $match_cmd && setmatch true -} - -############################################################################### -# recreate_by_fmt(fmtname) -# recreate all versions of fmtname -############################################################################### -recreate_by_fmt() -{ - fmtname=$1 - match_cmd="test x\$format = x$fmtname" - recreate_loop -} - -############################################################################### -# create_missing() -# create all missing format files -############################################################################### -create_missing() -{ - # match_cmd='test ! -f $destdir/$fmtfile' - match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_existing() -# recreate only existing format files -############################################################################### -recreate_existing() -{ - match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_all() -# recreate all formats -############################################################################### -recreate_all() -{ - match_cmd=true - recreate_loop -} - -############################################################################### -# recreate_by_hyphenfile(hyphenfile) -# recreate all formats that depend on hyphenfile -############################################################################### -recreate_by_hyphenfile() -{ - hyphenfile=$1 - - case $hyphenfile in - /*) - : - ;; - ./*) - hyphenfile="$KPSE_DOT/"`echo "$hyphenfile" | sed 's@..@@'` - ;; - *) - hyphenfile="$KPSE_DOT/$hyphenfile" - ;; - esac - need_find_hyphenfile=true - match_cmd="echo \"\$this_hyphenfile\" | grep $hyphenfile >/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/Master/bin/powerpc-aix/fmtutil-sys b/Master/bin/powerpc-aix/fmtutil-sys deleted file mode 100755 index bfb52f94e1f..00000000000 --- a/Master/bin/powerpc-aix/fmtutil-sys +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/Master/bin/powerpc-aix/texconfig b/Master/bin/powerpc-aix/texconfig deleted file mode 100755 index c9cc73c8305..00000000000 --- a/Master/bin/powerpc-aix/texconfig +++ /dev/null @@ -1,1432 +0,0 @@ -#!/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' </dev/null \ - | awk '$1 == "XDPI" || $1 == "YDPI" { print $3 }' - ) -} - -############################################################################### -# checkElemInList(elem, list) -# check if element exists in list -############################################################################### -checkElemInList() -{ - checkElemInListElem=$1; shift - checkElemInListFound=false - for checkElemInListIter - do - case "x$checkElemInListElem" in - x$checkElemInListIter) - checkElemInListFound=true - break - ;; - esac - done - case $checkElemInListFound in - true) (exit 0); return 0;; - esac - (exit 1); return 1 -} - - -# show version information from the distribution, if we have any. -showDistVersionInfo() -{ - # TeX Live file. - test -f $MT_TEXMFMAIN/../release-texlive.txt \ - && sed 1q $MT_TEXMFMAIN/../release-texlive.txt - - # no harm in continuing to look for the teTeX files. - test -f $MT_TEXMFMAIN/release-tetex-src.txt \ - && "teTeX-src release: `cat $MT_TEXMFMAIN/release-tetex-src.txt`" - test -f $MT_TEXMFDIST/release-tetex-texmf.txt \ - && "teTeX-texmf release: `cat $MT_TEXMFDIST/release-tetex-texmf.txt`" -} - -# -############################################################################### -# tcBatch(args) -# handle batch mode -############################################################################### -tcBatch() -{ - help="texconfig supports adjusting and updating many aspects of -the TeX installation. - -Usage: $progname conf (show configuration information) - $progname dvipdfmx paper PAPER (dvipdfmx paper size) - $progname dvipdfm paper PAPER (dvipdfm paper size) - $progname dvips [OPTION...] (dvips options) - $progname faq (show teTeX faq) - $progname findprog PROG... (show locations of PROGs, a la which) - $progname font vardir DIR - $progname font ro - $progname font rw - $progname formats (edit fmtutil.cnf) - $progname help (or --help; show this help) - $progname hyphen FORMAT (edit hyphenation config for FORMAT) - $progname init [FORMAT]... (rebuild FORMATs, or all formats - plus run texlinks and updmap) - $progname mode MODE (set Metafont MODE) - $progname paper PAPER (set default paper size to PAPER) - $progname pdftex [OPTION]... (pdftex options) - $progname rehash (rebuild ls-R files with mktexlsr) - $progname version (or --version; show version info) - $progname xdvi paper PAPER (xdvi paper size) - -Get more help with: - $progname dvipdfmx - $progname dvipdfm - $progname dvips - $progname font - $progname hyphen - $progname mode - $progname paper - $progname pdftex - $progname xdvi - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -" - - case $1 in - # texconfig conf - conf|confall) - setupTexmfmain - setupTexmfdist - echo '=========================== version information ==========================' - showDistVersionInfo - echo - echo '==================== binaries found by searching $PATH ===================' - echo "PATH=$PATH" - echoLocateBinary kpsewhich updmap fmtutil texconfig tex pdftex mktexpk dvips dvipdfm - echo - echo '=========================== active config files ==========================' - echoLocateCfgfile texmf.cnf updmap.cfg fmtutil.cnf config.ps mktex.cnf XDvi pdftexconfig.tex config | sort -k 2 - echo - echo '============================= font map files =============================' - for m in psfonts.map pdftex.map ps2pk.map dvipdfm.map; do - echo "$m: `kpsewhich $m`" - done - echo - echo '=========================== kpathsea variables ===========================' - echoShowKpseVariable TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS - - echo - echo '==== kpathsea variables from environment only (ok if no output here) ====' - echoShowVariable $envVars - ;; - - # texconfig dvipdfm - dvipdfm) - help="Usage: $progname dvipdfm paper PAPER - -Valid PAPER settings: - letter legal ledger tabloid a4 a3" - case $2 in - # texconfig dvipdfm 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 config '^p' "p $3";; - "") echo "$help" >&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 <unknown> - *) - 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 <unknown> - *) - 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 <<EOM -texconfig formats is no longer supported, because manual edits of -fmtutil.cnf will be overwritten by the new TeX Live package manager, -tlmgr, which regenerates that file as needed upon package changes. -Thus, to add or remove formats, the recommended method is to use tlmgr -to add or remove the appropriate package. - -If you need to make manual additions, you can edit the file -fmtutil-local.cnf under TEXMFLOCAL. Further information with -tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - setupTmpDir - echo "$progname: analyzing old configuration..." >&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 <<EOM -texconfig hyphen is no longer supported, because manual edits of -language.dat (or language.def) will be overwritten by the new TeX Live -package manager, tlmgr, which regenerates those configuration files as -needed upon package changes. Thus, to add or remove hyphenation -patterns, the recommended method is to use tlmgr to add or remove the -appropriate package. - -If you need to make manual additions, you can edit the files -language-local.dat and language-local.def under TEXMFLOCAL. Further -information with tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - tcBatchHyphenFormat=$2 - formatsForHyphen=`getFormatsForHyphen` - formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'` - help="Usage: $progname hyphen FORMAT - -Valid FORMATs are: -$formatsForHyphenFmt" - case $tcBatchHyphenFormat in - "") - echo "$help" >&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/Master/bin/powerpc-aix/texconfig-dialog b/Master/bin/powerpc-aix/texconfig-dialog deleted file mode 100755 index e1868d91574..00000000000 --- a/Master/bin/powerpc-aix/texconfig-dialog +++ /dev/null @@ -1,486 +0,0 @@ -#!/bin/sh - -# TeX-Config version 3.0 -# Thomas Esser, te@dbs.uni-hannover.de. Public domain. - -# 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+"$@"}'='"$@"' - -# the version string -version='$Id: texconfig-dialog 23826 2011-09-05 17:59:15Z karl $' - -: ${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/Master/bin/powerpc-aix/texconfig-sys b/Master/bin/powerpc-aix/texconfig-sys deleted file mode 100755 index ff549003ad2..00000000000 --- a/Master/bin/powerpc-aix/texconfig-sys +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $Id: texconfig-sys 20962 2011-01-07 11:45:38Z peter $ - -# 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/Master/bin/powerpc-aix/texlinks b/Master/bin/powerpc-aix/texlinks deleted file mode 100755 index 09b3488d263..00000000000 --- a/Master/bin/powerpc-aix/texlinks +++ /dev/null @@ -1,335 +0,0 @@ -#!/bin/sh -# $Id: texlinks 18035 2010-04-28 17:41:52Z mpg $ - -# 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 <vext01@gmail.com> -# 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: texlinks 18035 2010-04-28 17:41:52Z mpg $' -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: <http://tug.org/texlive/> -' - -############################################################################### -# 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/Master/bin/powerpc-linux/fmtutil b/Master/bin/powerpc-linux/fmtutil deleted file mode 100755 index 06ef11380b4..00000000000 --- a/Master/bin/powerpc-linux/fmtutil +++ /dev/null @@ -1,1017 +0,0 @@ -#!/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" to avoid interaction. -# Sun Mar 21 19:44:36 CET 2004: support aleph -# Thu Dec 25 22:11:53 CET 2003: add version string -# Thu Dec 25 12:56:14 CET 2003: new listcfg_loop lists only supported formats -# Sun Dec 21 10:25:37 CET 2003 "mktexfmt pdflatex" did not work (if called -# as mktexfmt, an extention was mandatory) -# Mon Sep 15 13:07:31 CEST 2003 add tmpdir to TEXINPUTS -# Sun Aug 3 11:09:46 CEST 2003 special case for mptopdf -# Sun Apr 20 10:27:09 CEST 2003 allow " " as well as tab in config file -# Wed Feb 19 21:14:52 CET 2003 add eomega support -# Sat Feb 15 22:01:35 CET 2003 let mf-nowin work without mf -# Wed Dec 25 09:47:44 CET 2002 bugfix for localized pool files -# Fri Oct 25 02:29:06 CEST 2002: now more careful about find_hyphenfile() -# Tue Oct 22 22:46:48 CEST 2002: -jobname, oft extension -# Fri Oct 4 22:33:17 CEST 2002: add more cli stuff: enablefmt -# disablefmt listcfg -# Sun Jul 7 21:28:37 CEST 2002: look at log file for possible problems, -# and issue a warning -# Tue Jun 4 21:52:57 CEST 2002: trap / cleanup code from updmap -# Tue Jun 4 19:32:44 CEST 2002: be smarter about stdout / stderr -# Tue Apr 9 22:46:34 CEST 2002: pass -progname=mpost for metafun -# Tue Apr 2 00:37:39 CEST 2002: added mktexfmt functionality -# Tue Jun 5 14:45:57 CEST 2001: added support for mf / mpost -############################################################################### - -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+"$@"}'='"$@"' - -progname=fmtutil -argv0=$0 -version='$Id: fmtutil 25899 2012-04-09 23:09:26Z karl $' - -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 -$version -Usage: fmtutil [OPTION]... CMD [ARG]... -Usage: mktexfmt FORMAT.fmt|BASE.base|MEM.mem|FMTNAME.EXT - -Rebuild and manage TeX formats, Metafont bases and MetaPost mems. - -If the command name ends in mktexfmt, only one format can be created. -The only options supported are --help and --version, and the command -line must consist of either a format name, with its extension, or a -plain name that is passed as the argument to --byfmt (see below). The -full name of the generated file (if any) is written to stdout, and -nothing else. - -If not operating in mktexfmt mode, the command line can be more general, -and multiple formats can be generated, as follows. - -Optional behavior: - --cnffile FILE read FILE instead of fmtutil.cnf. - --fmtdir DIRECTORY - --no-engine-subdir don't use engine-specific subdir of the fmtdir - --no-error-if-no-format exit successfully if no format is selected - --quiet be silent - --test (not implemented, just for compatibility) - --dolinks (not implemented, just for compatibility) - --force (not implemented, just for compatibility) - -Valid commands for fmtutil: - --all recreate all format files - --missing create all missing format files - --refresh recreate only existing format files - --byengine ENGINENAME (re)create formats using ENGINENAME - --byfmt FORMATNAME (re)create format for FORMATNAME - --byhyphen HYPHENFILE (re)create formats that depend on HYPHENFILE - --enablefmt FORMATNAME enable formatname in config file - --disablefmt FORMATNAME disable formatname in config file - --listcfg list (enabled and disabled) configurations, - filtered to available formats - --catcfg output the content of the config file - --showhyphen FORMATNAME print name of hyphenfile for format FORMATNAME - --edit no-op in TeX Live - --version show version info - --help show this message - -The default config file is named fmtutil.cnf, and -running kpsewhich fmtutil.cnf should show the active file. -The command kpsewhich --engine=/ --all foo.fmt should show the -locations of any and all foo.fmt files. - -For more information about fmt generation in TeX Live, try -tlmgr --help or see http://tug.org/texlive/doc/tlmgr.html. -The \`generate' action in tlmgr does the work. - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -eof - cleanup 0 -} - -versionfunc() -{ - cat <<eof -$progname version $version -eof - cleanup 0 -} - -############################################################################### -# 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'" -} - -############################################################################### -# 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() -{ - file=$1; pat=$2; line=$3 - - if grep "$pat" "$file" >/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 <<eof - -############################################################################### -$progname: Warning! Some warnings have been issued. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`warning' messages: -$log_warning_msg -eof - } >&2 - fi - - if $has_errors; then - { - cat <<eof - -############################################################################### -$progname: Error! Not all formats have been built successfully. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`failed' messages: -$log_failure_msg -eof - } >&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 - - if test $use_engine_dir; then - fulldestdir="$destdir/$texengine" - else - fulldestdir="$destdir" - fi - mkdir -p "$fulldestdir" - if test -f "$fmtfile"; then - grep '^! ' $format.log >/dev/null 2>&1 && - log_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 - # - destfile=$fulldestdir/$fmtfile - if mv "$fmtfile" "$destfile" </dev/null; then - verboseMsg "$progname: $destfile installed." - # - # As a special special case, we create mplib-luatex.mem for use by - # the mplib embedded in luatex if it doesn't already exist. (We - # never update it if it does exist.) - # - # This is used by the luamplib package. This way, an expert user - # who wants to try a new version of luatex (hence with a new - # version of mplib) can manually update mplib-luatex.mem without - # having to tamper with mpost itself. - # - if test "x$format" = xmpost && test "x$engine" = xmpost; then - mplib_mem_name=mplib-luatex.mem - mplib_mem_file=$fulldestdir/$mplib_mem_name - if test \! -f $mplib_mem_file; then - verboseMsg "$progname: copying $destfile to $mplib_mem_file" - if cp "$destfile" "$mplib_mem_file" </dev/null; then - mktexupd "$fulldestdir" "$mplib_mem_name" - else - log_warning "cp $destfile $mplib_mem_file failed." - fi - else - verboseMsg "$progname: $mplib_mem_file already exists, not updating." - fi - fi - # - # Echo the (main) output filename for our caller. - $mktexfmtMode && $mktexfmtFirst \ - && echo "$destfile" && mktexfmtFirst=false - # - mktexupd "$fulldestdir" "$fmtfile" - fi - else - log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed" - fi -} - -############################################################################### -# recreate_loop() -# for each line in config file: check match-condition and recreate format -# if there is a match -############################################################################### -recreate_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line || continue - check_match || continue - run_initex - done -} - -############################################################################### -# listcfg_loop() -# prints all format definitions in config files (enabled and disabled ones) -# for supported formats (i.e. for those which have an existing ini file) -############################################################################### -listcfg_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#$/d; /^#[^!]/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line && echo "$line" - done -} - -############################################################################### -# check_match() -# recreate all formats -############################################################################### -check_match() -{ - $need_find_hyphenfile && \ - this_hyphenfile="`find_hyphenfile "$format" "$hyphenation"`" - - eval $match_cmd && setmatch true -} - -############################################################################### -# recreate_by_fmt(fmtname) -# recreate all versions of fmtname -############################################################################### -recreate_by_fmt() -{ - fmtname=$1 - match_cmd="test x\$format = x$fmtname" - recreate_loop -} - -############################################################################### -# create_missing() -# create all missing format files -############################################################################### -create_missing() -{ - # match_cmd='test ! -f $destdir/$fmtfile' - match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_existing() -# recreate only existing format files -############################################################################### -recreate_existing() -{ - match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_all() -# recreate all formats -############################################################################### -recreate_all() -{ - match_cmd=true - recreate_loop -} - -############################################################################### -# recreate_by_hyphenfile(hyphenfile) -# recreate all formats that depend on hyphenfile -############################################################################### -recreate_by_hyphenfile() -{ - hyphenfile=$1 - - case $hyphenfile in - /*) - : - ;; - ./*) - hyphenfile="$KPSE_DOT/"`echo "$hyphenfile" | sed 's@..@@'` - ;; - *) - hyphenfile="$KPSE_DOT/$hyphenfile" - ;; - esac - need_find_hyphenfile=true - match_cmd="echo \"\$this_hyphenfile\" | grep $hyphenfile >/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/Master/bin/powerpc-linux/fmtutil-sys b/Master/bin/powerpc-linux/fmtutil-sys deleted file mode 100755 index bfb52f94e1f..00000000000 --- a/Master/bin/powerpc-linux/fmtutil-sys +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/Master/bin/powerpc-linux/texconfig b/Master/bin/powerpc-linux/texconfig deleted file mode 100755 index c9cc73c8305..00000000000 --- a/Master/bin/powerpc-linux/texconfig +++ /dev/null @@ -1,1432 +0,0 @@ -#!/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' </dev/null \ - | awk '$1 == "XDPI" || $1 == "YDPI" { print $3 }' - ) -} - -############################################################################### -# checkElemInList(elem, list) -# check if element exists in list -############################################################################### -checkElemInList() -{ - checkElemInListElem=$1; shift - checkElemInListFound=false - for checkElemInListIter - do - case "x$checkElemInListElem" in - x$checkElemInListIter) - checkElemInListFound=true - break - ;; - esac - done - case $checkElemInListFound in - true) (exit 0); return 0;; - esac - (exit 1); return 1 -} - - -# show version information from the distribution, if we have any. -showDistVersionInfo() -{ - # TeX Live file. - test -f $MT_TEXMFMAIN/../release-texlive.txt \ - && sed 1q $MT_TEXMFMAIN/../release-texlive.txt - - # no harm in continuing to look for the teTeX files. - test -f $MT_TEXMFMAIN/release-tetex-src.txt \ - && "teTeX-src release: `cat $MT_TEXMFMAIN/release-tetex-src.txt`" - test -f $MT_TEXMFDIST/release-tetex-texmf.txt \ - && "teTeX-texmf release: `cat $MT_TEXMFDIST/release-tetex-texmf.txt`" -} - -# -############################################################################### -# tcBatch(args) -# handle batch mode -############################################################################### -tcBatch() -{ - help="texconfig supports adjusting and updating many aspects of -the TeX installation. - -Usage: $progname conf (show configuration information) - $progname dvipdfmx paper PAPER (dvipdfmx paper size) - $progname dvipdfm paper PAPER (dvipdfm paper size) - $progname dvips [OPTION...] (dvips options) - $progname faq (show teTeX faq) - $progname findprog PROG... (show locations of PROGs, a la which) - $progname font vardir DIR - $progname font ro - $progname font rw - $progname formats (edit fmtutil.cnf) - $progname help (or --help; show this help) - $progname hyphen FORMAT (edit hyphenation config for FORMAT) - $progname init [FORMAT]... (rebuild FORMATs, or all formats - plus run texlinks and updmap) - $progname mode MODE (set Metafont MODE) - $progname paper PAPER (set default paper size to PAPER) - $progname pdftex [OPTION]... (pdftex options) - $progname rehash (rebuild ls-R files with mktexlsr) - $progname version (or --version; show version info) - $progname xdvi paper PAPER (xdvi paper size) - -Get more help with: - $progname dvipdfmx - $progname dvipdfm - $progname dvips - $progname font - $progname hyphen - $progname mode - $progname paper - $progname pdftex - $progname xdvi - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -" - - case $1 in - # texconfig conf - conf|confall) - setupTexmfmain - setupTexmfdist - echo '=========================== version information ==========================' - showDistVersionInfo - echo - echo '==================== binaries found by searching $PATH ===================' - echo "PATH=$PATH" - echoLocateBinary kpsewhich updmap fmtutil texconfig tex pdftex mktexpk dvips dvipdfm - echo - echo '=========================== active config files ==========================' - echoLocateCfgfile texmf.cnf updmap.cfg fmtutil.cnf config.ps mktex.cnf XDvi pdftexconfig.tex config | sort -k 2 - echo - echo '============================= font map files =============================' - for m in psfonts.map pdftex.map ps2pk.map dvipdfm.map; do - echo "$m: `kpsewhich $m`" - done - echo - echo '=========================== kpathsea variables ===========================' - echoShowKpseVariable TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS - - echo - echo '==== kpathsea variables from environment only (ok if no output here) ====' - echoShowVariable $envVars - ;; - - # texconfig dvipdfm - dvipdfm) - help="Usage: $progname dvipdfm paper PAPER - -Valid PAPER settings: - letter legal ledger tabloid a4 a3" - case $2 in - # texconfig dvipdfm 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 config '^p' "p $3";; - "") echo "$help" >&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 <unknown> - *) - 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 <unknown> - *) - 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 <<EOM -texconfig formats is no longer supported, because manual edits of -fmtutil.cnf will be overwritten by the new TeX Live package manager, -tlmgr, which regenerates that file as needed upon package changes. -Thus, to add or remove formats, the recommended method is to use tlmgr -to add or remove the appropriate package. - -If you need to make manual additions, you can edit the file -fmtutil-local.cnf under TEXMFLOCAL. Further information with -tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - setupTmpDir - echo "$progname: analyzing old configuration..." >&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 <<EOM -texconfig hyphen is no longer supported, because manual edits of -language.dat (or language.def) will be overwritten by the new TeX Live -package manager, tlmgr, which regenerates those configuration files as -needed upon package changes. Thus, to add or remove hyphenation -patterns, the recommended method is to use tlmgr to add or remove the -appropriate package. - -If you need to make manual additions, you can edit the files -language-local.dat and language-local.def under TEXMFLOCAL. Further -information with tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - tcBatchHyphenFormat=$2 - formatsForHyphen=`getFormatsForHyphen` - formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'` - help="Usage: $progname hyphen FORMAT - -Valid FORMATs are: -$formatsForHyphenFmt" - case $tcBatchHyphenFormat in - "") - echo "$help" >&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/Master/bin/powerpc-linux/texconfig-dialog b/Master/bin/powerpc-linux/texconfig-dialog deleted file mode 100755 index e1868d91574..00000000000 --- a/Master/bin/powerpc-linux/texconfig-dialog +++ /dev/null @@ -1,486 +0,0 @@ -#!/bin/sh - -# TeX-Config version 3.0 -# Thomas Esser, te@dbs.uni-hannover.de. Public domain. - -# 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+"$@"}'='"$@"' - -# the version string -version='$Id: texconfig-dialog 23826 2011-09-05 17:59:15Z karl $' - -: ${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/Master/bin/powerpc-linux/texconfig-sys b/Master/bin/powerpc-linux/texconfig-sys deleted file mode 100755 index ff549003ad2..00000000000 --- a/Master/bin/powerpc-linux/texconfig-sys +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $Id: texconfig-sys 20962 2011-01-07 11:45:38Z peter $ - -# 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/Master/bin/powerpc-linux/texlinks b/Master/bin/powerpc-linux/texlinks deleted file mode 100755 index 09b3488d263..00000000000 --- a/Master/bin/powerpc-linux/texlinks +++ /dev/null @@ -1,335 +0,0 @@ -#!/bin/sh -# $Id: texlinks 18035 2010-04-28 17:41:52Z mpg $ - -# 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 <vext01@gmail.com> -# 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: texlinks 18035 2010-04-28 17:41:52Z mpg $' -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: <http://tug.org/texlive/> -' - -############################################################################### -# 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/Master/bin/sparc-solaris/fmtutil b/Master/bin/sparc-solaris/fmtutil deleted file mode 100755 index 06ef11380b4..00000000000 --- a/Master/bin/sparc-solaris/fmtutil +++ /dev/null @@ -1,1017 +0,0 @@ -#!/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" to avoid interaction. -# Sun Mar 21 19:44:36 CET 2004: support aleph -# Thu Dec 25 22:11:53 CET 2003: add version string -# Thu Dec 25 12:56:14 CET 2003: new listcfg_loop lists only supported formats -# Sun Dec 21 10:25:37 CET 2003 "mktexfmt pdflatex" did not work (if called -# as mktexfmt, an extention was mandatory) -# Mon Sep 15 13:07:31 CEST 2003 add tmpdir to TEXINPUTS -# Sun Aug 3 11:09:46 CEST 2003 special case for mptopdf -# Sun Apr 20 10:27:09 CEST 2003 allow " " as well as tab in config file -# Wed Feb 19 21:14:52 CET 2003 add eomega support -# Sat Feb 15 22:01:35 CET 2003 let mf-nowin work without mf -# Wed Dec 25 09:47:44 CET 2002 bugfix for localized pool files -# Fri Oct 25 02:29:06 CEST 2002: now more careful about find_hyphenfile() -# Tue Oct 22 22:46:48 CEST 2002: -jobname, oft extension -# Fri Oct 4 22:33:17 CEST 2002: add more cli stuff: enablefmt -# disablefmt listcfg -# Sun Jul 7 21:28:37 CEST 2002: look at log file for possible problems, -# and issue a warning -# Tue Jun 4 21:52:57 CEST 2002: trap / cleanup code from updmap -# Tue Jun 4 19:32:44 CEST 2002: be smarter about stdout / stderr -# Tue Apr 9 22:46:34 CEST 2002: pass -progname=mpost for metafun -# Tue Apr 2 00:37:39 CEST 2002: added mktexfmt functionality -# Tue Jun 5 14:45:57 CEST 2001: added support for mf / mpost -############################################################################### - -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+"$@"}'='"$@"' - -progname=fmtutil -argv0=$0 -version='$Id: fmtutil 25899 2012-04-09 23:09:26Z karl $' - -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 -$version -Usage: fmtutil [OPTION]... CMD [ARG]... -Usage: mktexfmt FORMAT.fmt|BASE.base|MEM.mem|FMTNAME.EXT - -Rebuild and manage TeX formats, Metafont bases and MetaPost mems. - -If the command name ends in mktexfmt, only one format can be created. -The only options supported are --help and --version, and the command -line must consist of either a format name, with its extension, or a -plain name that is passed as the argument to --byfmt (see below). The -full name of the generated file (if any) is written to stdout, and -nothing else. - -If not operating in mktexfmt mode, the command line can be more general, -and multiple formats can be generated, as follows. - -Optional behavior: - --cnffile FILE read FILE instead of fmtutil.cnf. - --fmtdir DIRECTORY - --no-engine-subdir don't use engine-specific subdir of the fmtdir - --no-error-if-no-format exit successfully if no format is selected - --quiet be silent - --test (not implemented, just for compatibility) - --dolinks (not implemented, just for compatibility) - --force (not implemented, just for compatibility) - -Valid commands for fmtutil: - --all recreate all format files - --missing create all missing format files - --refresh recreate only existing format files - --byengine ENGINENAME (re)create formats using ENGINENAME - --byfmt FORMATNAME (re)create format for FORMATNAME - --byhyphen HYPHENFILE (re)create formats that depend on HYPHENFILE - --enablefmt FORMATNAME enable formatname in config file - --disablefmt FORMATNAME disable formatname in config file - --listcfg list (enabled and disabled) configurations, - filtered to available formats - --catcfg output the content of the config file - --showhyphen FORMATNAME print name of hyphenfile for format FORMATNAME - --edit no-op in TeX Live - --version show version info - --help show this message - -The default config file is named fmtutil.cnf, and -running kpsewhich fmtutil.cnf should show the active file. -The command kpsewhich --engine=/ --all foo.fmt should show the -locations of any and all foo.fmt files. - -For more information about fmt generation in TeX Live, try -tlmgr --help or see http://tug.org/texlive/doc/tlmgr.html. -The \`generate' action in tlmgr does the work. - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -eof - cleanup 0 -} - -versionfunc() -{ - cat <<eof -$progname version $version -eof - cleanup 0 -} - -############################################################################### -# 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'" -} - -############################################################################### -# 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() -{ - file=$1; pat=$2; line=$3 - - if grep "$pat" "$file" >/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 <<eof - -############################################################################### -$progname: Warning! Some warnings have been issued. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`warning' messages: -$log_warning_msg -eof - } >&2 - fi - - if $has_errors; then - { - cat <<eof - -############################################################################### -$progname: Error! Not all formats have been built successfully. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`failed' messages: -$log_failure_msg -eof - } >&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 - - if test $use_engine_dir; then - fulldestdir="$destdir/$texengine" - else - fulldestdir="$destdir" - fi - mkdir -p "$fulldestdir" - if test -f "$fmtfile"; then - grep '^! ' $format.log >/dev/null 2>&1 && - log_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 - # - destfile=$fulldestdir/$fmtfile - if mv "$fmtfile" "$destfile" </dev/null; then - verboseMsg "$progname: $destfile installed." - # - # As a special special case, we create mplib-luatex.mem for use by - # the mplib embedded in luatex if it doesn't already exist. (We - # never update it if it does exist.) - # - # This is used by the luamplib package. This way, an expert user - # who wants to try a new version of luatex (hence with a new - # version of mplib) can manually update mplib-luatex.mem without - # having to tamper with mpost itself. - # - if test "x$format" = xmpost && test "x$engine" = xmpost; then - mplib_mem_name=mplib-luatex.mem - mplib_mem_file=$fulldestdir/$mplib_mem_name - if test \! -f $mplib_mem_file; then - verboseMsg "$progname: copying $destfile to $mplib_mem_file" - if cp "$destfile" "$mplib_mem_file" </dev/null; then - mktexupd "$fulldestdir" "$mplib_mem_name" - else - log_warning "cp $destfile $mplib_mem_file failed." - fi - else - verboseMsg "$progname: $mplib_mem_file already exists, not updating." - fi - fi - # - # Echo the (main) output filename for our caller. - $mktexfmtMode && $mktexfmtFirst \ - && echo "$destfile" && mktexfmtFirst=false - # - mktexupd "$fulldestdir" "$fmtfile" - fi - else - log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed" - fi -} - -############################################################################### -# recreate_loop() -# for each line in config file: check match-condition and recreate format -# if there is a match -############################################################################### -recreate_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line || continue - check_match || continue - run_initex - done -} - -############################################################################### -# listcfg_loop() -# prints all format definitions in config files (enabled and disabled ones) -# for supported formats (i.e. for those which have an existing ini file) -############################################################################### -listcfg_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#$/d; /^#[^!]/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line && echo "$line" - done -} - -############################################################################### -# check_match() -# recreate all formats -############################################################################### -check_match() -{ - $need_find_hyphenfile && \ - this_hyphenfile="`find_hyphenfile "$format" "$hyphenation"`" - - eval $match_cmd && setmatch true -} - -############################################################################### -# recreate_by_fmt(fmtname) -# recreate all versions of fmtname -############################################################################### -recreate_by_fmt() -{ - fmtname=$1 - match_cmd="test x\$format = x$fmtname" - recreate_loop -} - -############################################################################### -# create_missing() -# create all missing format files -############################################################################### -create_missing() -{ - # match_cmd='test ! -f $destdir/$fmtfile' - match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_existing() -# recreate only existing format files -############################################################################### -recreate_existing() -{ - match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_all() -# recreate all formats -############################################################################### -recreate_all() -{ - match_cmd=true - recreate_loop -} - -############################################################################### -# recreate_by_hyphenfile(hyphenfile) -# recreate all formats that depend on hyphenfile -############################################################################### -recreate_by_hyphenfile() -{ - hyphenfile=$1 - - case $hyphenfile in - /*) - : - ;; - ./*) - hyphenfile="$KPSE_DOT/"`echo "$hyphenfile" | sed 's@..@@'` - ;; - *) - hyphenfile="$KPSE_DOT/$hyphenfile" - ;; - esac - need_find_hyphenfile=true - match_cmd="echo \"\$this_hyphenfile\" | grep $hyphenfile >/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/Master/bin/sparc-solaris/fmtutil-sys b/Master/bin/sparc-solaris/fmtutil-sys deleted file mode 100755 index bfb52f94e1f..00000000000 --- a/Master/bin/sparc-solaris/fmtutil-sys +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/Master/bin/sparc-solaris/texconfig b/Master/bin/sparc-solaris/texconfig deleted file mode 100755 index c9cc73c8305..00000000000 --- a/Master/bin/sparc-solaris/texconfig +++ /dev/null @@ -1,1432 +0,0 @@ -#!/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' </dev/null \ - | awk '$1 == "XDPI" || $1 == "YDPI" { print $3 }' - ) -} - -############################################################################### -# checkElemInList(elem, list) -# check if element exists in list -############################################################################### -checkElemInList() -{ - checkElemInListElem=$1; shift - checkElemInListFound=false - for checkElemInListIter - do - case "x$checkElemInListElem" in - x$checkElemInListIter) - checkElemInListFound=true - break - ;; - esac - done - case $checkElemInListFound in - true) (exit 0); return 0;; - esac - (exit 1); return 1 -} - - -# show version information from the distribution, if we have any. -showDistVersionInfo() -{ - # TeX Live file. - test -f $MT_TEXMFMAIN/../release-texlive.txt \ - && sed 1q $MT_TEXMFMAIN/../release-texlive.txt - - # no harm in continuing to look for the teTeX files. - test -f $MT_TEXMFMAIN/release-tetex-src.txt \ - && "teTeX-src release: `cat $MT_TEXMFMAIN/release-tetex-src.txt`" - test -f $MT_TEXMFDIST/release-tetex-texmf.txt \ - && "teTeX-texmf release: `cat $MT_TEXMFDIST/release-tetex-texmf.txt`" -} - -# -############################################################################### -# tcBatch(args) -# handle batch mode -############################################################################### -tcBatch() -{ - help="texconfig supports adjusting and updating many aspects of -the TeX installation. - -Usage: $progname conf (show configuration information) - $progname dvipdfmx paper PAPER (dvipdfmx paper size) - $progname dvipdfm paper PAPER (dvipdfm paper size) - $progname dvips [OPTION...] (dvips options) - $progname faq (show teTeX faq) - $progname findprog PROG... (show locations of PROGs, a la which) - $progname font vardir DIR - $progname font ro - $progname font rw - $progname formats (edit fmtutil.cnf) - $progname help (or --help; show this help) - $progname hyphen FORMAT (edit hyphenation config for FORMAT) - $progname init [FORMAT]... (rebuild FORMATs, or all formats - plus run texlinks and updmap) - $progname mode MODE (set Metafont MODE) - $progname paper PAPER (set default paper size to PAPER) - $progname pdftex [OPTION]... (pdftex options) - $progname rehash (rebuild ls-R files with mktexlsr) - $progname version (or --version; show version info) - $progname xdvi paper PAPER (xdvi paper size) - -Get more help with: - $progname dvipdfmx - $progname dvipdfm - $progname dvips - $progname font - $progname hyphen - $progname mode - $progname paper - $progname pdftex - $progname xdvi - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -" - - case $1 in - # texconfig conf - conf|confall) - setupTexmfmain - setupTexmfdist - echo '=========================== version information ==========================' - showDistVersionInfo - echo - echo '==================== binaries found by searching $PATH ===================' - echo "PATH=$PATH" - echoLocateBinary kpsewhich updmap fmtutil texconfig tex pdftex mktexpk dvips dvipdfm - echo - echo '=========================== active config files ==========================' - echoLocateCfgfile texmf.cnf updmap.cfg fmtutil.cnf config.ps mktex.cnf XDvi pdftexconfig.tex config | sort -k 2 - echo - echo '============================= font map files =============================' - for m in psfonts.map pdftex.map ps2pk.map dvipdfm.map; do - echo "$m: `kpsewhich $m`" - done - echo - echo '=========================== kpathsea variables ===========================' - echoShowKpseVariable TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS - - echo - echo '==== kpathsea variables from environment only (ok if no output here) ====' - echoShowVariable $envVars - ;; - - # texconfig dvipdfm - dvipdfm) - help="Usage: $progname dvipdfm paper PAPER - -Valid PAPER settings: - letter legal ledger tabloid a4 a3" - case $2 in - # texconfig dvipdfm 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 config '^p' "p $3";; - "") echo "$help" >&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 <unknown> - *) - 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 <unknown> - *) - 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 <<EOM -texconfig formats is no longer supported, because manual edits of -fmtutil.cnf will be overwritten by the new TeX Live package manager, -tlmgr, which regenerates that file as needed upon package changes. -Thus, to add or remove formats, the recommended method is to use tlmgr -to add or remove the appropriate package. - -If you need to make manual additions, you can edit the file -fmtutil-local.cnf under TEXMFLOCAL. Further information with -tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - setupTmpDir - echo "$progname: analyzing old configuration..." >&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 <<EOM -texconfig hyphen is no longer supported, because manual edits of -language.dat (or language.def) will be overwritten by the new TeX Live -package manager, tlmgr, which regenerates those configuration files as -needed upon package changes. Thus, to add or remove hyphenation -patterns, the recommended method is to use tlmgr to add or remove the -appropriate package. - -If you need to make manual additions, you can edit the files -language-local.dat and language-local.def under TEXMFLOCAL. Further -information with tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - tcBatchHyphenFormat=$2 - formatsForHyphen=`getFormatsForHyphen` - formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'` - help="Usage: $progname hyphen FORMAT - -Valid FORMATs are: -$formatsForHyphenFmt" - case $tcBatchHyphenFormat in - "") - echo "$help" >&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/Master/bin/sparc-solaris/texconfig-dialog b/Master/bin/sparc-solaris/texconfig-dialog deleted file mode 100755 index e1868d91574..00000000000 --- a/Master/bin/sparc-solaris/texconfig-dialog +++ /dev/null @@ -1,486 +0,0 @@ -#!/bin/sh - -# TeX-Config version 3.0 -# Thomas Esser, te@dbs.uni-hannover.de. Public domain. - -# 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+"$@"}'='"$@"' - -# the version string -version='$Id: texconfig-dialog 23826 2011-09-05 17:59:15Z karl $' - -: ${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/Master/bin/sparc-solaris/texconfig-sys b/Master/bin/sparc-solaris/texconfig-sys deleted file mode 100755 index ff549003ad2..00000000000 --- a/Master/bin/sparc-solaris/texconfig-sys +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $Id: texconfig-sys 20962 2011-01-07 11:45:38Z peter $ - -# 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/Master/bin/sparc-solaris/texlinks b/Master/bin/sparc-solaris/texlinks deleted file mode 100755 index 09b3488d263..00000000000 --- a/Master/bin/sparc-solaris/texlinks +++ /dev/null @@ -1,335 +0,0 @@ -#!/bin/sh -# $Id: texlinks 18035 2010-04-28 17:41:52Z mpg $ - -# 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 <vext01@gmail.com> -# 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: texlinks 18035 2010-04-28 17:41:52Z mpg $' -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: <http://tug.org/texlive/> -' - -############################################################################### -# 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/Master/bin/universal-darwin/fmtutil b/Master/bin/universal-darwin/fmtutil deleted file mode 100755 index 06ef11380b4..00000000000 --- a/Master/bin/universal-darwin/fmtutil +++ /dev/null @@ -1,1017 +0,0 @@ -#!/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" to avoid interaction. -# Sun Mar 21 19:44:36 CET 2004: support aleph -# Thu Dec 25 22:11:53 CET 2003: add version string -# Thu Dec 25 12:56:14 CET 2003: new listcfg_loop lists only supported formats -# Sun Dec 21 10:25:37 CET 2003 "mktexfmt pdflatex" did not work (if called -# as mktexfmt, an extention was mandatory) -# Mon Sep 15 13:07:31 CEST 2003 add tmpdir to TEXINPUTS -# Sun Aug 3 11:09:46 CEST 2003 special case for mptopdf -# Sun Apr 20 10:27:09 CEST 2003 allow " " as well as tab in config file -# Wed Feb 19 21:14:52 CET 2003 add eomega support -# Sat Feb 15 22:01:35 CET 2003 let mf-nowin work without mf -# Wed Dec 25 09:47:44 CET 2002 bugfix for localized pool files -# Fri Oct 25 02:29:06 CEST 2002: now more careful about find_hyphenfile() -# Tue Oct 22 22:46:48 CEST 2002: -jobname, oft extension -# Fri Oct 4 22:33:17 CEST 2002: add more cli stuff: enablefmt -# disablefmt listcfg -# Sun Jul 7 21:28:37 CEST 2002: look at log file for possible problems, -# and issue a warning -# Tue Jun 4 21:52:57 CEST 2002: trap / cleanup code from updmap -# Tue Jun 4 19:32:44 CEST 2002: be smarter about stdout / stderr -# Tue Apr 9 22:46:34 CEST 2002: pass -progname=mpost for metafun -# Tue Apr 2 00:37:39 CEST 2002: added mktexfmt functionality -# Tue Jun 5 14:45:57 CEST 2001: added support for mf / mpost -############################################################################### - -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+"$@"}'='"$@"' - -progname=fmtutil -argv0=$0 -version='$Id: fmtutil 25899 2012-04-09 23:09:26Z karl $' - -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 -$version -Usage: fmtutil [OPTION]... CMD [ARG]... -Usage: mktexfmt FORMAT.fmt|BASE.base|MEM.mem|FMTNAME.EXT - -Rebuild and manage TeX formats, Metafont bases and MetaPost mems. - -If the command name ends in mktexfmt, only one format can be created. -The only options supported are --help and --version, and the command -line must consist of either a format name, with its extension, or a -plain name that is passed as the argument to --byfmt (see below). The -full name of the generated file (if any) is written to stdout, and -nothing else. - -If not operating in mktexfmt mode, the command line can be more general, -and multiple formats can be generated, as follows. - -Optional behavior: - --cnffile FILE read FILE instead of fmtutil.cnf. - --fmtdir DIRECTORY - --no-engine-subdir don't use engine-specific subdir of the fmtdir - --no-error-if-no-format exit successfully if no format is selected - --quiet be silent - --test (not implemented, just for compatibility) - --dolinks (not implemented, just for compatibility) - --force (not implemented, just for compatibility) - -Valid commands for fmtutil: - --all recreate all format files - --missing create all missing format files - --refresh recreate only existing format files - --byengine ENGINENAME (re)create formats using ENGINENAME - --byfmt FORMATNAME (re)create format for FORMATNAME - --byhyphen HYPHENFILE (re)create formats that depend on HYPHENFILE - --enablefmt FORMATNAME enable formatname in config file - --disablefmt FORMATNAME disable formatname in config file - --listcfg list (enabled and disabled) configurations, - filtered to available formats - --catcfg output the content of the config file - --showhyphen FORMATNAME print name of hyphenfile for format FORMATNAME - --edit no-op in TeX Live - --version show version info - --help show this message - -The default config file is named fmtutil.cnf, and -running kpsewhich fmtutil.cnf should show the active file. -The command kpsewhich --engine=/ --all foo.fmt should show the -locations of any and all foo.fmt files. - -For more information about fmt generation in TeX Live, try -tlmgr --help or see http://tug.org/texlive/doc/tlmgr.html. -The \`generate' action in tlmgr does the work. - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -eof - cleanup 0 -} - -versionfunc() -{ - cat <<eof -$progname version $version -eof - cleanup 0 -} - -############################################################################### -# 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'" -} - -############################################################################### -# 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() -{ - file=$1; pat=$2; line=$3 - - if grep "$pat" "$file" >/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 <<eof - -############################################################################### -$progname: Warning! Some warnings have been issued. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`warning' messages: -$log_warning_msg -eof - } >&2 - fi - - if $has_errors; then - { - cat <<eof - -############################################################################### -$progname: Error! Not all formats have been built successfully. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`failed' messages: -$log_failure_msg -eof - } >&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 - - if test $use_engine_dir; then - fulldestdir="$destdir/$texengine" - else - fulldestdir="$destdir" - fi - mkdir -p "$fulldestdir" - if test -f "$fmtfile"; then - grep '^! ' $format.log >/dev/null 2>&1 && - log_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 - # - destfile=$fulldestdir/$fmtfile - if mv "$fmtfile" "$destfile" </dev/null; then - verboseMsg "$progname: $destfile installed." - # - # As a special special case, we create mplib-luatex.mem for use by - # the mplib embedded in luatex if it doesn't already exist. (We - # never update it if it does exist.) - # - # This is used by the luamplib package. This way, an expert user - # who wants to try a new version of luatex (hence with a new - # version of mplib) can manually update mplib-luatex.mem without - # having to tamper with mpost itself. - # - if test "x$format" = xmpost && test "x$engine" = xmpost; then - mplib_mem_name=mplib-luatex.mem - mplib_mem_file=$fulldestdir/$mplib_mem_name - if test \! -f $mplib_mem_file; then - verboseMsg "$progname: copying $destfile to $mplib_mem_file" - if cp "$destfile" "$mplib_mem_file" </dev/null; then - mktexupd "$fulldestdir" "$mplib_mem_name" - else - log_warning "cp $destfile $mplib_mem_file failed." - fi - else - verboseMsg "$progname: $mplib_mem_file already exists, not updating." - fi - fi - # - # Echo the (main) output filename for our caller. - $mktexfmtMode && $mktexfmtFirst \ - && echo "$destfile" && mktexfmtFirst=false - # - mktexupd "$fulldestdir" "$fmtfile" - fi - else - log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed" - fi -} - -############################################################################### -# recreate_loop() -# for each line in config file: check match-condition and recreate format -# if there is a match -############################################################################### -recreate_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line || continue - check_match || continue - run_initex - done -} - -############################################################################### -# listcfg_loop() -# prints all format definitions in config files (enabled and disabled ones) -# for supported formats (i.e. for those which have an existing ini file) -############################################################################### -listcfg_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#$/d; /^#[^!]/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line && echo "$line" - done -} - -############################################################################### -# check_match() -# recreate all formats -############################################################################### -check_match() -{ - $need_find_hyphenfile && \ - this_hyphenfile="`find_hyphenfile "$format" "$hyphenation"`" - - eval $match_cmd && setmatch true -} - -############################################################################### -# recreate_by_fmt(fmtname) -# recreate all versions of fmtname -############################################################################### -recreate_by_fmt() -{ - fmtname=$1 - match_cmd="test x\$format = x$fmtname" - recreate_loop -} - -############################################################################### -# create_missing() -# create all missing format files -############################################################################### -create_missing() -{ - # match_cmd='test ! -f $destdir/$fmtfile' - match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_existing() -# recreate only existing format files -############################################################################### -recreate_existing() -{ - match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_all() -# recreate all formats -############################################################################### -recreate_all() -{ - match_cmd=true - recreate_loop -} - -############################################################################### -# recreate_by_hyphenfile(hyphenfile) -# recreate all formats that depend on hyphenfile -############################################################################### -recreate_by_hyphenfile() -{ - hyphenfile=$1 - - case $hyphenfile in - /*) - : - ;; - ./*) - hyphenfile="$KPSE_DOT/"`echo "$hyphenfile" | sed 's@..@@'` - ;; - *) - hyphenfile="$KPSE_DOT/$hyphenfile" - ;; - esac - need_find_hyphenfile=true - match_cmd="echo \"\$this_hyphenfile\" | grep $hyphenfile >/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/Master/bin/universal-darwin/fmtutil-sys b/Master/bin/universal-darwin/fmtutil-sys deleted file mode 100755 index bfb52f94e1f..00000000000 --- a/Master/bin/universal-darwin/fmtutil-sys +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/Master/bin/universal-darwin/texconfig b/Master/bin/universal-darwin/texconfig deleted file mode 100755 index c9cc73c8305..00000000000 --- a/Master/bin/universal-darwin/texconfig +++ /dev/null @@ -1,1432 +0,0 @@ -#!/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' </dev/null \ - | awk '$1 == "XDPI" || $1 == "YDPI" { print $3 }' - ) -} - -############################################################################### -# checkElemInList(elem, list) -# check if element exists in list -############################################################################### -checkElemInList() -{ - checkElemInListElem=$1; shift - checkElemInListFound=false - for checkElemInListIter - do - case "x$checkElemInListElem" in - x$checkElemInListIter) - checkElemInListFound=true - break - ;; - esac - done - case $checkElemInListFound in - true) (exit 0); return 0;; - esac - (exit 1); return 1 -} - - -# show version information from the distribution, if we have any. -showDistVersionInfo() -{ - # TeX Live file. - test -f $MT_TEXMFMAIN/../release-texlive.txt \ - && sed 1q $MT_TEXMFMAIN/../release-texlive.txt - - # no harm in continuing to look for the teTeX files. - test -f $MT_TEXMFMAIN/release-tetex-src.txt \ - && "teTeX-src release: `cat $MT_TEXMFMAIN/release-tetex-src.txt`" - test -f $MT_TEXMFDIST/release-tetex-texmf.txt \ - && "teTeX-texmf release: `cat $MT_TEXMFDIST/release-tetex-texmf.txt`" -} - -# -############################################################################### -# tcBatch(args) -# handle batch mode -############################################################################### -tcBatch() -{ - help="texconfig supports adjusting and updating many aspects of -the TeX installation. - -Usage: $progname conf (show configuration information) - $progname dvipdfmx paper PAPER (dvipdfmx paper size) - $progname dvipdfm paper PAPER (dvipdfm paper size) - $progname dvips [OPTION...] (dvips options) - $progname faq (show teTeX faq) - $progname findprog PROG... (show locations of PROGs, a la which) - $progname font vardir DIR - $progname font ro - $progname font rw - $progname formats (edit fmtutil.cnf) - $progname help (or --help; show this help) - $progname hyphen FORMAT (edit hyphenation config for FORMAT) - $progname init [FORMAT]... (rebuild FORMATs, or all formats - plus run texlinks and updmap) - $progname mode MODE (set Metafont MODE) - $progname paper PAPER (set default paper size to PAPER) - $progname pdftex [OPTION]... (pdftex options) - $progname rehash (rebuild ls-R files with mktexlsr) - $progname version (or --version; show version info) - $progname xdvi paper PAPER (xdvi paper size) - -Get more help with: - $progname dvipdfmx - $progname dvipdfm - $progname dvips - $progname font - $progname hyphen - $progname mode - $progname paper - $progname pdftex - $progname xdvi - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -" - - case $1 in - # texconfig conf - conf|confall) - setupTexmfmain - setupTexmfdist - echo '=========================== version information ==========================' - showDistVersionInfo - echo - echo '==================== binaries found by searching $PATH ===================' - echo "PATH=$PATH" - echoLocateBinary kpsewhich updmap fmtutil texconfig tex pdftex mktexpk dvips dvipdfm - echo - echo '=========================== active config files ==========================' - echoLocateCfgfile texmf.cnf updmap.cfg fmtutil.cnf config.ps mktex.cnf XDvi pdftexconfig.tex config | sort -k 2 - echo - echo '============================= font map files =============================' - for m in psfonts.map pdftex.map ps2pk.map dvipdfm.map; do - echo "$m: `kpsewhich $m`" - done - echo - echo '=========================== kpathsea variables ===========================' - echoShowKpseVariable TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS - - echo - echo '==== kpathsea variables from environment only (ok if no output here) ====' - echoShowVariable $envVars - ;; - - # texconfig dvipdfm - dvipdfm) - help="Usage: $progname dvipdfm paper PAPER - -Valid PAPER settings: - letter legal ledger tabloid a4 a3" - case $2 in - # texconfig dvipdfm 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 config '^p' "p $3";; - "") echo "$help" >&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 <unknown> - *) - 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 <unknown> - *) - 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 <<EOM -texconfig formats is no longer supported, because manual edits of -fmtutil.cnf will be overwritten by the new TeX Live package manager, -tlmgr, which regenerates that file as needed upon package changes. -Thus, to add or remove formats, the recommended method is to use tlmgr -to add or remove the appropriate package. - -If you need to make manual additions, you can edit the file -fmtutil-local.cnf under TEXMFLOCAL. Further information with -tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - setupTmpDir - echo "$progname: analyzing old configuration..." >&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 <<EOM -texconfig hyphen is no longer supported, because manual edits of -language.dat (or language.def) will be overwritten by the new TeX Live -package manager, tlmgr, which regenerates those configuration files as -needed upon package changes. Thus, to add or remove hyphenation -patterns, the recommended method is to use tlmgr to add or remove the -appropriate package. - -If you need to make manual additions, you can edit the files -language-local.dat and language-local.def under TEXMFLOCAL. Further -information with tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - tcBatchHyphenFormat=$2 - formatsForHyphen=`getFormatsForHyphen` - formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'` - help="Usage: $progname hyphen FORMAT - -Valid FORMATs are: -$formatsForHyphenFmt" - case $tcBatchHyphenFormat in - "") - echo "$help" >&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/Master/bin/universal-darwin/texconfig-dialog b/Master/bin/universal-darwin/texconfig-dialog deleted file mode 100755 index e1868d91574..00000000000 --- a/Master/bin/universal-darwin/texconfig-dialog +++ /dev/null @@ -1,486 +0,0 @@ -#!/bin/sh - -# TeX-Config version 3.0 -# Thomas Esser, te@dbs.uni-hannover.de. Public domain. - -# 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+"$@"}'='"$@"' - -# the version string -version='$Id: texconfig-dialog 23826 2011-09-05 17:59:15Z karl $' - -: ${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/Master/bin/universal-darwin/texconfig-sys b/Master/bin/universal-darwin/texconfig-sys deleted file mode 100755 index ff549003ad2..00000000000 --- a/Master/bin/universal-darwin/texconfig-sys +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $Id: texconfig-sys 20962 2011-01-07 11:45:38Z peter $ - -# 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/Master/bin/universal-darwin/texlinks b/Master/bin/universal-darwin/texlinks deleted file mode 100755 index 09b3488d263..00000000000 --- a/Master/bin/universal-darwin/texlinks +++ /dev/null @@ -1,335 +0,0 @@ -#!/bin/sh -# $Id: texlinks 18035 2010-04-28 17:41:52Z mpg $ - -# 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 <vext01@gmail.com> -# 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: texlinks 18035 2010-04-28 17:41:52Z mpg $' -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: <http://tug.org/texlive/> -' - -############################################################################### -# 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/Master/bin/x86_64-darwin/fmtutil b/Master/bin/x86_64-darwin/fmtutil deleted file mode 100755 index 06ef11380b4..00000000000 --- a/Master/bin/x86_64-darwin/fmtutil +++ /dev/null @@ -1,1017 +0,0 @@ -#!/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" to avoid interaction. -# Sun Mar 21 19:44:36 CET 2004: support aleph -# Thu Dec 25 22:11:53 CET 2003: add version string -# Thu Dec 25 12:56:14 CET 2003: new listcfg_loop lists only supported formats -# Sun Dec 21 10:25:37 CET 2003 "mktexfmt pdflatex" did not work (if called -# as mktexfmt, an extention was mandatory) -# Mon Sep 15 13:07:31 CEST 2003 add tmpdir to TEXINPUTS -# Sun Aug 3 11:09:46 CEST 2003 special case for mptopdf -# Sun Apr 20 10:27:09 CEST 2003 allow " " as well as tab in config file -# Wed Feb 19 21:14:52 CET 2003 add eomega support -# Sat Feb 15 22:01:35 CET 2003 let mf-nowin work without mf -# Wed Dec 25 09:47:44 CET 2002 bugfix for localized pool files -# Fri Oct 25 02:29:06 CEST 2002: now more careful about find_hyphenfile() -# Tue Oct 22 22:46:48 CEST 2002: -jobname, oft extension -# Fri Oct 4 22:33:17 CEST 2002: add more cli stuff: enablefmt -# disablefmt listcfg -# Sun Jul 7 21:28:37 CEST 2002: look at log file for possible problems, -# and issue a warning -# Tue Jun 4 21:52:57 CEST 2002: trap / cleanup code from updmap -# Tue Jun 4 19:32:44 CEST 2002: be smarter about stdout / stderr -# Tue Apr 9 22:46:34 CEST 2002: pass -progname=mpost for metafun -# Tue Apr 2 00:37:39 CEST 2002: added mktexfmt functionality -# Tue Jun 5 14:45:57 CEST 2001: added support for mf / mpost -############################################################################### - -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+"$@"}'='"$@"' - -progname=fmtutil -argv0=$0 -version='$Id: fmtutil 25899 2012-04-09 23:09:26Z karl $' - -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 -$version -Usage: fmtutil [OPTION]... CMD [ARG]... -Usage: mktexfmt FORMAT.fmt|BASE.base|MEM.mem|FMTNAME.EXT - -Rebuild and manage TeX formats, Metafont bases and MetaPost mems. - -If the command name ends in mktexfmt, only one format can be created. -The only options supported are --help and --version, and the command -line must consist of either a format name, with its extension, or a -plain name that is passed as the argument to --byfmt (see below). The -full name of the generated file (if any) is written to stdout, and -nothing else. - -If not operating in mktexfmt mode, the command line can be more general, -and multiple formats can be generated, as follows. - -Optional behavior: - --cnffile FILE read FILE instead of fmtutil.cnf. - --fmtdir DIRECTORY - --no-engine-subdir don't use engine-specific subdir of the fmtdir - --no-error-if-no-format exit successfully if no format is selected - --quiet be silent - --test (not implemented, just for compatibility) - --dolinks (not implemented, just for compatibility) - --force (not implemented, just for compatibility) - -Valid commands for fmtutil: - --all recreate all format files - --missing create all missing format files - --refresh recreate only existing format files - --byengine ENGINENAME (re)create formats using ENGINENAME - --byfmt FORMATNAME (re)create format for FORMATNAME - --byhyphen HYPHENFILE (re)create formats that depend on HYPHENFILE - --enablefmt FORMATNAME enable formatname in config file - --disablefmt FORMATNAME disable formatname in config file - --listcfg list (enabled and disabled) configurations, - filtered to available formats - --catcfg output the content of the config file - --showhyphen FORMATNAME print name of hyphenfile for format FORMATNAME - --edit no-op in TeX Live - --version show version info - --help show this message - -The default config file is named fmtutil.cnf, and -running kpsewhich fmtutil.cnf should show the active file. -The command kpsewhich --engine=/ --all foo.fmt should show the -locations of any and all foo.fmt files. - -For more information about fmt generation in TeX Live, try -tlmgr --help or see http://tug.org/texlive/doc/tlmgr.html. -The \`generate' action in tlmgr does the work. - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -eof - cleanup 0 -} - -versionfunc() -{ - cat <<eof -$progname version $version -eof - cleanup 0 -} - -############################################################################### -# 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'" -} - -############################################################################### -# 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() -{ - file=$1; pat=$2; line=$3 - - if grep "$pat" "$file" >/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 <<eof - -############################################################################### -$progname: Warning! Some warnings have been issued. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`warning' messages: -$log_warning_msg -eof - } >&2 - fi - - if $has_errors; then - { - cat <<eof - -############################################################################### -$progname: Error! Not all formats have been built successfully. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`failed' messages: -$log_failure_msg -eof - } >&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 - - if test $use_engine_dir; then - fulldestdir="$destdir/$texengine" - else - fulldestdir="$destdir" - fi - mkdir -p "$fulldestdir" - if test -f "$fmtfile"; then - grep '^! ' $format.log >/dev/null 2>&1 && - log_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 - # - destfile=$fulldestdir/$fmtfile - if mv "$fmtfile" "$destfile" </dev/null; then - verboseMsg "$progname: $destfile installed." - # - # As a special special case, we create mplib-luatex.mem for use by - # the mplib embedded in luatex if it doesn't already exist. (We - # never update it if it does exist.) - # - # This is used by the luamplib package. This way, an expert user - # who wants to try a new version of luatex (hence with a new - # version of mplib) can manually update mplib-luatex.mem without - # having to tamper with mpost itself. - # - if test "x$format" = xmpost && test "x$engine" = xmpost; then - mplib_mem_name=mplib-luatex.mem - mplib_mem_file=$fulldestdir/$mplib_mem_name - if test \! -f $mplib_mem_file; then - verboseMsg "$progname: copying $destfile to $mplib_mem_file" - if cp "$destfile" "$mplib_mem_file" </dev/null; then - mktexupd "$fulldestdir" "$mplib_mem_name" - else - log_warning "cp $destfile $mplib_mem_file failed." - fi - else - verboseMsg "$progname: $mplib_mem_file already exists, not updating." - fi - fi - # - # Echo the (main) output filename for our caller. - $mktexfmtMode && $mktexfmtFirst \ - && echo "$destfile" && mktexfmtFirst=false - # - mktexupd "$fulldestdir" "$fmtfile" - fi - else - log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed" - fi -} - -############################################################################### -# recreate_loop() -# for each line in config file: check match-condition and recreate format -# if there is a match -############################################################################### -recreate_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line || continue - check_match || continue - run_initex - done -} - -############################################################################### -# listcfg_loop() -# prints all format definitions in config files (enabled and disabled ones) -# for supported formats (i.e. for those which have an existing ini file) -############################################################################### -listcfg_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#$/d; /^#[^!]/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line && echo "$line" - done -} - -############################################################################### -# check_match() -# recreate all formats -############################################################################### -check_match() -{ - $need_find_hyphenfile && \ - this_hyphenfile="`find_hyphenfile "$format" "$hyphenation"`" - - eval $match_cmd && setmatch true -} - -############################################################################### -# recreate_by_fmt(fmtname) -# recreate all versions of fmtname -############################################################################### -recreate_by_fmt() -{ - fmtname=$1 - match_cmd="test x\$format = x$fmtname" - recreate_loop -} - -############################################################################### -# create_missing() -# create all missing format files -############################################################################### -create_missing() -{ - # match_cmd='test ! -f $destdir/$fmtfile' - match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_existing() -# recreate only existing format files -############################################################################### -recreate_existing() -{ - match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_all() -# recreate all formats -############################################################################### -recreate_all() -{ - match_cmd=true - recreate_loop -} - -############################################################################### -# recreate_by_hyphenfile(hyphenfile) -# recreate all formats that depend on hyphenfile -############################################################################### -recreate_by_hyphenfile() -{ - hyphenfile=$1 - - case $hyphenfile in - /*) - : - ;; - ./*) - hyphenfile="$KPSE_DOT/"`echo "$hyphenfile" | sed 's@..@@'` - ;; - *) - hyphenfile="$KPSE_DOT/$hyphenfile" - ;; - esac - need_find_hyphenfile=true - match_cmd="echo \"\$this_hyphenfile\" | grep $hyphenfile >/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/Master/bin/x86_64-darwin/fmtutil-sys b/Master/bin/x86_64-darwin/fmtutil-sys deleted file mode 100755 index bfb52f94e1f..00000000000 --- a/Master/bin/x86_64-darwin/fmtutil-sys +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/Master/bin/x86_64-darwin/texconfig b/Master/bin/x86_64-darwin/texconfig deleted file mode 100755 index c9cc73c8305..00000000000 --- a/Master/bin/x86_64-darwin/texconfig +++ /dev/null @@ -1,1432 +0,0 @@ -#!/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' </dev/null \ - | awk '$1 == "XDPI" || $1 == "YDPI" { print $3 }' - ) -} - -############################################################################### -# checkElemInList(elem, list) -# check if element exists in list -############################################################################### -checkElemInList() -{ - checkElemInListElem=$1; shift - checkElemInListFound=false - for checkElemInListIter - do - case "x$checkElemInListElem" in - x$checkElemInListIter) - checkElemInListFound=true - break - ;; - esac - done - case $checkElemInListFound in - true) (exit 0); return 0;; - esac - (exit 1); return 1 -} - - -# show version information from the distribution, if we have any. -showDistVersionInfo() -{ - # TeX Live file. - test -f $MT_TEXMFMAIN/../release-texlive.txt \ - && sed 1q $MT_TEXMFMAIN/../release-texlive.txt - - # no harm in continuing to look for the teTeX files. - test -f $MT_TEXMFMAIN/release-tetex-src.txt \ - && "teTeX-src release: `cat $MT_TEXMFMAIN/release-tetex-src.txt`" - test -f $MT_TEXMFDIST/release-tetex-texmf.txt \ - && "teTeX-texmf release: `cat $MT_TEXMFDIST/release-tetex-texmf.txt`" -} - -# -############################################################################### -# tcBatch(args) -# handle batch mode -############################################################################### -tcBatch() -{ - help="texconfig supports adjusting and updating many aspects of -the TeX installation. - -Usage: $progname conf (show configuration information) - $progname dvipdfmx paper PAPER (dvipdfmx paper size) - $progname dvipdfm paper PAPER (dvipdfm paper size) - $progname dvips [OPTION...] (dvips options) - $progname faq (show teTeX faq) - $progname findprog PROG... (show locations of PROGs, a la which) - $progname font vardir DIR - $progname font ro - $progname font rw - $progname formats (edit fmtutil.cnf) - $progname help (or --help; show this help) - $progname hyphen FORMAT (edit hyphenation config for FORMAT) - $progname init [FORMAT]... (rebuild FORMATs, or all formats - plus run texlinks and updmap) - $progname mode MODE (set Metafont MODE) - $progname paper PAPER (set default paper size to PAPER) - $progname pdftex [OPTION]... (pdftex options) - $progname rehash (rebuild ls-R files with mktexlsr) - $progname version (or --version; show version info) - $progname xdvi paper PAPER (xdvi paper size) - -Get more help with: - $progname dvipdfmx - $progname dvipdfm - $progname dvips - $progname font - $progname hyphen - $progname mode - $progname paper - $progname pdftex - $progname xdvi - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -" - - case $1 in - # texconfig conf - conf|confall) - setupTexmfmain - setupTexmfdist - echo '=========================== version information ==========================' - showDistVersionInfo - echo - echo '==================== binaries found by searching $PATH ===================' - echo "PATH=$PATH" - echoLocateBinary kpsewhich updmap fmtutil texconfig tex pdftex mktexpk dvips dvipdfm - echo - echo '=========================== active config files ==========================' - echoLocateCfgfile texmf.cnf updmap.cfg fmtutil.cnf config.ps mktex.cnf XDvi pdftexconfig.tex config | sort -k 2 - echo - echo '============================= font map files =============================' - for m in psfonts.map pdftex.map ps2pk.map dvipdfm.map; do - echo "$m: `kpsewhich $m`" - done - echo - echo '=========================== kpathsea variables ===========================' - echoShowKpseVariable TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS - - echo - echo '==== kpathsea variables from environment only (ok if no output here) ====' - echoShowVariable $envVars - ;; - - # texconfig dvipdfm - dvipdfm) - help="Usage: $progname dvipdfm paper PAPER - -Valid PAPER settings: - letter legal ledger tabloid a4 a3" - case $2 in - # texconfig dvipdfm 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 config '^p' "p $3";; - "") echo "$help" >&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 <unknown> - *) - 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 <unknown> - *) - 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 <<EOM -texconfig formats is no longer supported, because manual edits of -fmtutil.cnf will be overwritten by the new TeX Live package manager, -tlmgr, which regenerates that file as needed upon package changes. -Thus, to add or remove formats, the recommended method is to use tlmgr -to add or remove the appropriate package. - -If you need to make manual additions, you can edit the file -fmtutil-local.cnf under TEXMFLOCAL. Further information with -tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - setupTmpDir - echo "$progname: analyzing old configuration..." >&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 <<EOM -texconfig hyphen is no longer supported, because manual edits of -language.dat (or language.def) will be overwritten by the new TeX Live -package manager, tlmgr, which regenerates those configuration files as -needed upon package changes. Thus, to add or remove hyphenation -patterns, the recommended method is to use tlmgr to add or remove the -appropriate package. - -If you need to make manual additions, you can edit the files -language-local.dat and language-local.def under TEXMFLOCAL. Further -information with tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - tcBatchHyphenFormat=$2 - formatsForHyphen=`getFormatsForHyphen` - formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'` - help="Usage: $progname hyphen FORMAT - -Valid FORMATs are: -$formatsForHyphenFmt" - case $tcBatchHyphenFormat in - "") - echo "$help" >&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/Master/bin/x86_64-darwin/texconfig-dialog b/Master/bin/x86_64-darwin/texconfig-dialog deleted file mode 100755 index e1868d91574..00000000000 --- a/Master/bin/x86_64-darwin/texconfig-dialog +++ /dev/null @@ -1,486 +0,0 @@ -#!/bin/sh - -# TeX-Config version 3.0 -# Thomas Esser, te@dbs.uni-hannover.de. Public domain. - -# 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+"$@"}'='"$@"' - -# the version string -version='$Id: texconfig-dialog 23826 2011-09-05 17:59:15Z karl $' - -: ${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/Master/bin/x86_64-darwin/texconfig-sys b/Master/bin/x86_64-darwin/texconfig-sys deleted file mode 100755 index ff549003ad2..00000000000 --- a/Master/bin/x86_64-darwin/texconfig-sys +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $Id: texconfig-sys 20962 2011-01-07 11:45:38Z peter $ - -# 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/Master/bin/x86_64-darwin/texlinks b/Master/bin/x86_64-darwin/texlinks deleted file mode 100755 index 09b3488d263..00000000000 --- a/Master/bin/x86_64-darwin/texlinks +++ /dev/null @@ -1,335 +0,0 @@ -#!/bin/sh -# $Id: texlinks 18035 2010-04-28 17:41:52Z mpg $ - -# 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 <vext01@gmail.com> -# 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: texlinks 18035 2010-04-28 17:41:52Z mpg $' -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: <http://tug.org/texlive/> -' - -############################################################################### -# 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/Master/bin/x86_64-linux/fmtutil b/Master/bin/x86_64-linux/fmtutil deleted file mode 100755 index 06ef11380b4..00000000000 --- a/Master/bin/x86_64-linux/fmtutil +++ /dev/null @@ -1,1017 +0,0 @@ -#!/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" to avoid interaction. -# Sun Mar 21 19:44:36 CET 2004: support aleph -# Thu Dec 25 22:11:53 CET 2003: add version string -# Thu Dec 25 12:56:14 CET 2003: new listcfg_loop lists only supported formats -# Sun Dec 21 10:25:37 CET 2003 "mktexfmt pdflatex" did not work (if called -# as mktexfmt, an extention was mandatory) -# Mon Sep 15 13:07:31 CEST 2003 add tmpdir to TEXINPUTS -# Sun Aug 3 11:09:46 CEST 2003 special case for mptopdf -# Sun Apr 20 10:27:09 CEST 2003 allow " " as well as tab in config file -# Wed Feb 19 21:14:52 CET 2003 add eomega support -# Sat Feb 15 22:01:35 CET 2003 let mf-nowin work without mf -# Wed Dec 25 09:47:44 CET 2002 bugfix for localized pool files -# Fri Oct 25 02:29:06 CEST 2002: now more careful about find_hyphenfile() -# Tue Oct 22 22:46:48 CEST 2002: -jobname, oft extension -# Fri Oct 4 22:33:17 CEST 2002: add more cli stuff: enablefmt -# disablefmt listcfg -# Sun Jul 7 21:28:37 CEST 2002: look at log file for possible problems, -# and issue a warning -# Tue Jun 4 21:52:57 CEST 2002: trap / cleanup code from updmap -# Tue Jun 4 19:32:44 CEST 2002: be smarter about stdout / stderr -# Tue Apr 9 22:46:34 CEST 2002: pass -progname=mpost for metafun -# Tue Apr 2 00:37:39 CEST 2002: added mktexfmt functionality -# Tue Jun 5 14:45:57 CEST 2001: added support for mf / mpost -############################################################################### - -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+"$@"}'='"$@"' - -progname=fmtutil -argv0=$0 -version='$Id: fmtutil 25899 2012-04-09 23:09:26Z karl $' - -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 -$version -Usage: fmtutil [OPTION]... CMD [ARG]... -Usage: mktexfmt FORMAT.fmt|BASE.base|MEM.mem|FMTNAME.EXT - -Rebuild and manage TeX formats, Metafont bases and MetaPost mems. - -If the command name ends in mktexfmt, only one format can be created. -The only options supported are --help and --version, and the command -line must consist of either a format name, with its extension, or a -plain name that is passed as the argument to --byfmt (see below). The -full name of the generated file (if any) is written to stdout, and -nothing else. - -If not operating in mktexfmt mode, the command line can be more general, -and multiple formats can be generated, as follows. - -Optional behavior: - --cnffile FILE read FILE instead of fmtutil.cnf. - --fmtdir DIRECTORY - --no-engine-subdir don't use engine-specific subdir of the fmtdir - --no-error-if-no-format exit successfully if no format is selected - --quiet be silent - --test (not implemented, just for compatibility) - --dolinks (not implemented, just for compatibility) - --force (not implemented, just for compatibility) - -Valid commands for fmtutil: - --all recreate all format files - --missing create all missing format files - --refresh recreate only existing format files - --byengine ENGINENAME (re)create formats using ENGINENAME - --byfmt FORMATNAME (re)create format for FORMATNAME - --byhyphen HYPHENFILE (re)create formats that depend on HYPHENFILE - --enablefmt FORMATNAME enable formatname in config file - --disablefmt FORMATNAME disable formatname in config file - --listcfg list (enabled and disabled) configurations, - filtered to available formats - --catcfg output the content of the config file - --showhyphen FORMATNAME print name of hyphenfile for format FORMATNAME - --edit no-op in TeX Live - --version show version info - --help show this message - -The default config file is named fmtutil.cnf, and -running kpsewhich fmtutil.cnf should show the active file. -The command kpsewhich --engine=/ --all foo.fmt should show the -locations of any and all foo.fmt files. - -For more information about fmt generation in TeX Live, try -tlmgr --help or see http://tug.org/texlive/doc/tlmgr.html. -The \`generate' action in tlmgr does the work. - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -eof - cleanup 0 -} - -versionfunc() -{ - cat <<eof -$progname version $version -eof - cleanup 0 -} - -############################################################################### -# 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'" -} - -############################################################################### -# 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() -{ - file=$1; pat=$2; line=$3 - - if grep "$pat" "$file" >/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 <<eof - -############################################################################### -$progname: Warning! Some warnings have been issued. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`warning' messages: -$log_warning_msg -eof - } >&2 - fi - - if $has_errors; then - { - cat <<eof - -############################################################################### -$progname: Error! Not all formats have been built successfully. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`failed' messages: -$log_failure_msg -eof - } >&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 - - if test $use_engine_dir; then - fulldestdir="$destdir/$texengine" - else - fulldestdir="$destdir" - fi - mkdir -p "$fulldestdir" - if test -f "$fmtfile"; then - grep '^! ' $format.log >/dev/null 2>&1 && - log_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 - # - destfile=$fulldestdir/$fmtfile - if mv "$fmtfile" "$destfile" </dev/null; then - verboseMsg "$progname: $destfile installed." - # - # As a special special case, we create mplib-luatex.mem for use by - # the mplib embedded in luatex if it doesn't already exist. (We - # never update it if it does exist.) - # - # This is used by the luamplib package. This way, an expert user - # who wants to try a new version of luatex (hence with a new - # version of mplib) can manually update mplib-luatex.mem without - # having to tamper with mpost itself. - # - if test "x$format" = xmpost && test "x$engine" = xmpost; then - mplib_mem_name=mplib-luatex.mem - mplib_mem_file=$fulldestdir/$mplib_mem_name - if test \! -f $mplib_mem_file; then - verboseMsg "$progname: copying $destfile to $mplib_mem_file" - if cp "$destfile" "$mplib_mem_file" </dev/null; then - mktexupd "$fulldestdir" "$mplib_mem_name" - else - log_warning "cp $destfile $mplib_mem_file failed." - fi - else - verboseMsg "$progname: $mplib_mem_file already exists, not updating." - fi - fi - # - # Echo the (main) output filename for our caller. - $mktexfmtMode && $mktexfmtFirst \ - && echo "$destfile" && mktexfmtFirst=false - # - mktexupd "$fulldestdir" "$fmtfile" - fi - else - log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed" - fi -} - -############################################################################### -# recreate_loop() -# for each line in config file: check match-condition and recreate format -# if there is a match -############################################################################### -recreate_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line || continue - check_match || continue - run_initex - done -} - -############################################################################### -# listcfg_loop() -# prints all format definitions in config files (enabled and disabled ones) -# for supported formats (i.e. for those which have an existing ini file) -############################################################################### -listcfg_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#$/d; /^#[^!]/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line && echo "$line" - done -} - -############################################################################### -# check_match() -# recreate all formats -############################################################################### -check_match() -{ - $need_find_hyphenfile && \ - this_hyphenfile="`find_hyphenfile "$format" "$hyphenation"`" - - eval $match_cmd && setmatch true -} - -############################################################################### -# recreate_by_fmt(fmtname) -# recreate all versions of fmtname -############################################################################### -recreate_by_fmt() -{ - fmtname=$1 - match_cmd="test x\$format = x$fmtname" - recreate_loop -} - -############################################################################### -# create_missing() -# create all missing format files -############################################################################### -create_missing() -{ - # match_cmd='test ! -f $destdir/$fmtfile' - match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_existing() -# recreate only existing format files -############################################################################### -recreate_existing() -{ - match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_all() -# recreate all formats -############################################################################### -recreate_all() -{ - match_cmd=true - recreate_loop -} - -############################################################################### -# recreate_by_hyphenfile(hyphenfile) -# recreate all formats that depend on hyphenfile -############################################################################### -recreate_by_hyphenfile() -{ - hyphenfile=$1 - - case $hyphenfile in - /*) - : - ;; - ./*) - hyphenfile="$KPSE_DOT/"`echo "$hyphenfile" | sed 's@..@@'` - ;; - *) - hyphenfile="$KPSE_DOT/$hyphenfile" - ;; - esac - need_find_hyphenfile=true - match_cmd="echo \"\$this_hyphenfile\" | grep $hyphenfile >/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/Master/bin/x86_64-linux/fmtutil-sys b/Master/bin/x86_64-linux/fmtutil-sys deleted file mode 100755 index bfb52f94e1f..00000000000 --- a/Master/bin/x86_64-linux/fmtutil-sys +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/Master/bin/x86_64-linux/texconfig b/Master/bin/x86_64-linux/texconfig deleted file mode 100755 index c9cc73c8305..00000000000 --- a/Master/bin/x86_64-linux/texconfig +++ /dev/null @@ -1,1432 +0,0 @@ -#!/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' </dev/null \ - | awk '$1 == "XDPI" || $1 == "YDPI" { print $3 }' - ) -} - -############################################################################### -# checkElemInList(elem, list) -# check if element exists in list -############################################################################### -checkElemInList() -{ - checkElemInListElem=$1; shift - checkElemInListFound=false - for checkElemInListIter - do - case "x$checkElemInListElem" in - x$checkElemInListIter) - checkElemInListFound=true - break - ;; - esac - done - case $checkElemInListFound in - true) (exit 0); return 0;; - esac - (exit 1); return 1 -} - - -# show version information from the distribution, if we have any. -showDistVersionInfo() -{ - # TeX Live file. - test -f $MT_TEXMFMAIN/../release-texlive.txt \ - && sed 1q $MT_TEXMFMAIN/../release-texlive.txt - - # no harm in continuing to look for the teTeX files. - test -f $MT_TEXMFMAIN/release-tetex-src.txt \ - && "teTeX-src release: `cat $MT_TEXMFMAIN/release-tetex-src.txt`" - test -f $MT_TEXMFDIST/release-tetex-texmf.txt \ - && "teTeX-texmf release: `cat $MT_TEXMFDIST/release-tetex-texmf.txt`" -} - -# -############################################################################### -# tcBatch(args) -# handle batch mode -############################################################################### -tcBatch() -{ - help="texconfig supports adjusting and updating many aspects of -the TeX installation. - -Usage: $progname conf (show configuration information) - $progname dvipdfmx paper PAPER (dvipdfmx paper size) - $progname dvipdfm paper PAPER (dvipdfm paper size) - $progname dvips [OPTION...] (dvips options) - $progname faq (show teTeX faq) - $progname findprog PROG... (show locations of PROGs, a la which) - $progname font vardir DIR - $progname font ro - $progname font rw - $progname formats (edit fmtutil.cnf) - $progname help (or --help; show this help) - $progname hyphen FORMAT (edit hyphenation config for FORMAT) - $progname init [FORMAT]... (rebuild FORMATs, or all formats - plus run texlinks and updmap) - $progname mode MODE (set Metafont MODE) - $progname paper PAPER (set default paper size to PAPER) - $progname pdftex [OPTION]... (pdftex options) - $progname rehash (rebuild ls-R files with mktexlsr) - $progname version (or --version; show version info) - $progname xdvi paper PAPER (xdvi paper size) - -Get more help with: - $progname dvipdfmx - $progname dvipdfm - $progname dvips - $progname font - $progname hyphen - $progname mode - $progname paper - $progname pdftex - $progname xdvi - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -" - - case $1 in - # texconfig conf - conf|confall) - setupTexmfmain - setupTexmfdist - echo '=========================== version information ==========================' - showDistVersionInfo - echo - echo '==================== binaries found by searching $PATH ===================' - echo "PATH=$PATH" - echoLocateBinary kpsewhich updmap fmtutil texconfig tex pdftex mktexpk dvips dvipdfm - echo - echo '=========================== active config files ==========================' - echoLocateCfgfile texmf.cnf updmap.cfg fmtutil.cnf config.ps mktex.cnf XDvi pdftexconfig.tex config | sort -k 2 - echo - echo '============================= font map files =============================' - for m in psfonts.map pdftex.map ps2pk.map dvipdfm.map; do - echo "$m: `kpsewhich $m`" - done - echo - echo '=========================== kpathsea variables ===========================' - echoShowKpseVariable TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS - - echo - echo '==== kpathsea variables from environment only (ok if no output here) ====' - echoShowVariable $envVars - ;; - - # texconfig dvipdfm - dvipdfm) - help="Usage: $progname dvipdfm paper PAPER - -Valid PAPER settings: - letter legal ledger tabloid a4 a3" - case $2 in - # texconfig dvipdfm 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 config '^p' "p $3";; - "") echo "$help" >&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 <unknown> - *) - 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 <unknown> - *) - 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 <<EOM -texconfig formats is no longer supported, because manual edits of -fmtutil.cnf will be overwritten by the new TeX Live package manager, -tlmgr, which regenerates that file as needed upon package changes. -Thus, to add or remove formats, the recommended method is to use tlmgr -to add or remove the appropriate package. - -If you need to make manual additions, you can edit the file -fmtutil-local.cnf under TEXMFLOCAL. Further information with -tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - setupTmpDir - echo "$progname: analyzing old configuration..." >&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 <<EOM -texconfig hyphen is no longer supported, because manual edits of -language.dat (or language.def) will be overwritten by the new TeX Live -package manager, tlmgr, which regenerates those configuration files as -needed upon package changes. Thus, to add or remove hyphenation -patterns, the recommended method is to use tlmgr to add or remove the -appropriate package. - -If you need to make manual additions, you can edit the files -language-local.dat and language-local.def under TEXMFLOCAL. Further -information with tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - tcBatchHyphenFormat=$2 - formatsForHyphen=`getFormatsForHyphen` - formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'` - help="Usage: $progname hyphen FORMAT - -Valid FORMATs are: -$formatsForHyphenFmt" - case $tcBatchHyphenFormat in - "") - echo "$help" >&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/Master/bin/x86_64-linux/texconfig-dialog b/Master/bin/x86_64-linux/texconfig-dialog deleted file mode 100755 index e1868d91574..00000000000 --- a/Master/bin/x86_64-linux/texconfig-dialog +++ /dev/null @@ -1,486 +0,0 @@ -#!/bin/sh - -# TeX-Config version 3.0 -# Thomas Esser, te@dbs.uni-hannover.de. Public domain. - -# 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+"$@"}'='"$@"' - -# the version string -version='$Id: texconfig-dialog 23826 2011-09-05 17:59:15Z karl $' - -: ${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/Master/bin/x86_64-linux/texconfig-sys b/Master/bin/x86_64-linux/texconfig-sys deleted file mode 100755 index ff549003ad2..00000000000 --- a/Master/bin/x86_64-linux/texconfig-sys +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $Id: texconfig-sys 20962 2011-01-07 11:45:38Z peter $ - -# 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/Master/bin/x86_64-linux/texlinks b/Master/bin/x86_64-linux/texlinks deleted file mode 100755 index 09b3488d263..00000000000 --- a/Master/bin/x86_64-linux/texlinks +++ /dev/null @@ -1,335 +0,0 @@ -#!/bin/sh -# $Id: texlinks 18035 2010-04-28 17:41:52Z mpg $ - -# 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 <vext01@gmail.com> -# 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: texlinks 18035 2010-04-28 17:41:52Z mpg $' -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: <http://tug.org/texlive/> -' - -############################################################################### -# 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/Master/bin/x86_64-solaris/fmtutil b/Master/bin/x86_64-solaris/fmtutil deleted file mode 100755 index 06ef11380b4..00000000000 --- a/Master/bin/x86_64-solaris/fmtutil +++ /dev/null @@ -1,1017 +0,0 @@ -#!/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" to avoid interaction. -# Sun Mar 21 19:44:36 CET 2004: support aleph -# Thu Dec 25 22:11:53 CET 2003: add version string -# Thu Dec 25 12:56:14 CET 2003: new listcfg_loop lists only supported formats -# Sun Dec 21 10:25:37 CET 2003 "mktexfmt pdflatex" did not work (if called -# as mktexfmt, an extention was mandatory) -# Mon Sep 15 13:07:31 CEST 2003 add tmpdir to TEXINPUTS -# Sun Aug 3 11:09:46 CEST 2003 special case for mptopdf -# Sun Apr 20 10:27:09 CEST 2003 allow " " as well as tab in config file -# Wed Feb 19 21:14:52 CET 2003 add eomega support -# Sat Feb 15 22:01:35 CET 2003 let mf-nowin work without mf -# Wed Dec 25 09:47:44 CET 2002 bugfix for localized pool files -# Fri Oct 25 02:29:06 CEST 2002: now more careful about find_hyphenfile() -# Tue Oct 22 22:46:48 CEST 2002: -jobname, oft extension -# Fri Oct 4 22:33:17 CEST 2002: add more cli stuff: enablefmt -# disablefmt listcfg -# Sun Jul 7 21:28:37 CEST 2002: look at log file for possible problems, -# and issue a warning -# Tue Jun 4 21:52:57 CEST 2002: trap / cleanup code from updmap -# Tue Jun 4 19:32:44 CEST 2002: be smarter about stdout / stderr -# Tue Apr 9 22:46:34 CEST 2002: pass -progname=mpost for metafun -# Tue Apr 2 00:37:39 CEST 2002: added mktexfmt functionality -# Tue Jun 5 14:45:57 CEST 2001: added support for mf / mpost -############################################################################### - -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+"$@"}'='"$@"' - -progname=fmtutil -argv0=$0 -version='$Id: fmtutil 25899 2012-04-09 23:09:26Z karl $' - -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 -$version -Usage: fmtutil [OPTION]... CMD [ARG]... -Usage: mktexfmt FORMAT.fmt|BASE.base|MEM.mem|FMTNAME.EXT - -Rebuild and manage TeX formats, Metafont bases and MetaPost mems. - -If the command name ends in mktexfmt, only one format can be created. -The only options supported are --help and --version, and the command -line must consist of either a format name, with its extension, or a -plain name that is passed as the argument to --byfmt (see below). The -full name of the generated file (if any) is written to stdout, and -nothing else. - -If not operating in mktexfmt mode, the command line can be more general, -and multiple formats can be generated, as follows. - -Optional behavior: - --cnffile FILE read FILE instead of fmtutil.cnf. - --fmtdir DIRECTORY - --no-engine-subdir don't use engine-specific subdir of the fmtdir - --no-error-if-no-format exit successfully if no format is selected - --quiet be silent - --test (not implemented, just for compatibility) - --dolinks (not implemented, just for compatibility) - --force (not implemented, just for compatibility) - -Valid commands for fmtutil: - --all recreate all format files - --missing create all missing format files - --refresh recreate only existing format files - --byengine ENGINENAME (re)create formats using ENGINENAME - --byfmt FORMATNAME (re)create format for FORMATNAME - --byhyphen HYPHENFILE (re)create formats that depend on HYPHENFILE - --enablefmt FORMATNAME enable formatname in config file - --disablefmt FORMATNAME disable formatname in config file - --listcfg list (enabled and disabled) configurations, - filtered to available formats - --catcfg output the content of the config file - --showhyphen FORMATNAME print name of hyphenfile for format FORMATNAME - --edit no-op in TeX Live - --version show version info - --help show this message - -The default config file is named fmtutil.cnf, and -running kpsewhich fmtutil.cnf should show the active file. -The command kpsewhich --engine=/ --all foo.fmt should show the -locations of any and all foo.fmt files. - -For more information about fmt generation in TeX Live, try -tlmgr --help or see http://tug.org/texlive/doc/tlmgr.html. -The \`generate' action in tlmgr does the work. - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -eof - cleanup 0 -} - -versionfunc() -{ - cat <<eof -$progname version $version -eof - cleanup 0 -} - -############################################################################### -# 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'" -} - -############################################################################### -# 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() -{ - file=$1; pat=$2; line=$3 - - if grep "$pat" "$file" >/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 <<eof - -############################################################################### -$progname: Warning! Some warnings have been issued. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`warning' messages: -$log_warning_msg -eof - } >&2 - fi - - if $has_errors; then - { - cat <<eof - -############################################################################### -$progname: Error! Not all formats have been built successfully. -Visit the log files in directory - $destdir -for details. -############################################################################### - -This is a summary of all \`failed' messages: -$log_failure_msg -eof - } >&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 - - if test $use_engine_dir; then - fulldestdir="$destdir/$texengine" - else - fulldestdir="$destdir" - fi - mkdir -p "$fulldestdir" - if test -f "$fmtfile"; then - grep '^! ' $format.log >/dev/null 2>&1 && - log_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 - # - destfile=$fulldestdir/$fmtfile - if mv "$fmtfile" "$destfile" </dev/null; then - verboseMsg "$progname: $destfile installed." - # - # As a special special case, we create mplib-luatex.mem for use by - # the mplib embedded in luatex if it doesn't already exist. (We - # never update it if it does exist.) - # - # This is used by the luamplib package. This way, an expert user - # who wants to try a new version of luatex (hence with a new - # version of mplib) can manually update mplib-luatex.mem without - # having to tamper with mpost itself. - # - if test "x$format" = xmpost && test "x$engine" = xmpost; then - mplib_mem_name=mplib-luatex.mem - mplib_mem_file=$fulldestdir/$mplib_mem_name - if test \! -f $mplib_mem_file; then - verboseMsg "$progname: copying $destfile to $mplib_mem_file" - if cp "$destfile" "$mplib_mem_file" </dev/null; then - mktexupd "$fulldestdir" "$mplib_mem_name" - else - log_warning "cp $destfile $mplib_mem_file failed." - fi - else - verboseMsg "$progname: $mplib_mem_file already exists, not updating." - fi - fi - # - # Echo the (main) output filename for our caller. - $mktexfmtMode && $mktexfmtFirst \ - && echo "$destfile" && mktexfmtFirst=false - # - mktexupd "$fulldestdir" "$fmtfile" - fi - else - log_failure "\`$engine -ini $tcxflag $jobswitch $prgswitch $texargs' failed" - fi -} - -############################################################################### -# recreate_loop() -# for each line in config file: check match-condition and recreate format -# if there is a match -############################################################################### -recreate_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line || continue - check_match || continue - run_initex - done -} - -############################################################################### -# listcfg_loop() -# prints all format definitions in config files (enabled and disabled ones) -# for supported formats (i.e. for those which have an existing ini file) -############################################################################### -listcfg_loop() -{ - OIFS=$IFS - IFS=' -' - set `echo x; sed '/^#$/d; /^#[^!]/d; /^[ ]*$/d' "$cnf_file"`; shift - IFS=$OIFS - for line - do - parse_line $line && echo "$line" - done -} - -############################################################################### -# check_match() -# recreate all formats -############################################################################### -check_match() -{ - $need_find_hyphenfile && \ - this_hyphenfile="`find_hyphenfile "$format" "$hyphenation"`" - - eval $match_cmd && setmatch true -} - -############################################################################### -# recreate_by_fmt(fmtname) -# recreate all versions of fmtname -############################################################################### -recreate_by_fmt() -{ - fmtname=$1 - match_cmd="test x\$format = x$fmtname" - recreate_loop -} - -############################################################################### -# create_missing() -# create all missing format files -############################################################################### -create_missing() -{ - # match_cmd='test ! -f $destdir/$fmtfile' - match_cmd='test ! -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_existing() -# recreate only existing format files -############################################################################### -recreate_existing() -{ - match_cmd='test -f "`kpsewhich -engine=$texengine -progname=$format $fmtfile`"' - recreate_loop -} - -############################################################################### -# recreate_all() -# recreate all formats -############################################################################### -recreate_all() -{ - match_cmd=true - recreate_loop -} - -############################################################################### -# recreate_by_hyphenfile(hyphenfile) -# recreate all formats that depend on hyphenfile -############################################################################### -recreate_by_hyphenfile() -{ - hyphenfile=$1 - - case $hyphenfile in - /*) - : - ;; - ./*) - hyphenfile="$KPSE_DOT/"`echo "$hyphenfile" | sed 's@..@@'` - ;; - *) - hyphenfile="$KPSE_DOT/$hyphenfile" - ;; - esac - need_find_hyphenfile=true - match_cmd="echo \"\$this_hyphenfile\" | grep $hyphenfile >/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/Master/bin/x86_64-solaris/fmtutil-sys b/Master/bin/x86_64-solaris/fmtutil-sys deleted file mode 100755 index bfb52f94e1f..00000000000 --- a/Master/bin/x86_64-solaris/fmtutil-sys +++ /dev/null @@ -1,29 +0,0 @@ -#!/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/Master/bin/x86_64-solaris/texconfig b/Master/bin/x86_64-solaris/texconfig deleted file mode 100755 index c9cc73c8305..00000000000 --- a/Master/bin/x86_64-solaris/texconfig +++ /dev/null @@ -1,1432 +0,0 @@ -#!/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' </dev/null \ - | awk '$1 == "XDPI" || $1 == "YDPI" { print $3 }' - ) -} - -############################################################################### -# checkElemInList(elem, list) -# check if element exists in list -############################################################################### -checkElemInList() -{ - checkElemInListElem=$1; shift - checkElemInListFound=false - for checkElemInListIter - do - case "x$checkElemInListElem" in - x$checkElemInListIter) - checkElemInListFound=true - break - ;; - esac - done - case $checkElemInListFound in - true) (exit 0); return 0;; - esac - (exit 1); return 1 -} - - -# show version information from the distribution, if we have any. -showDistVersionInfo() -{ - # TeX Live file. - test -f $MT_TEXMFMAIN/../release-texlive.txt \ - && sed 1q $MT_TEXMFMAIN/../release-texlive.txt - - # no harm in continuing to look for the teTeX files. - test -f $MT_TEXMFMAIN/release-tetex-src.txt \ - && "teTeX-src release: `cat $MT_TEXMFMAIN/release-tetex-src.txt`" - test -f $MT_TEXMFDIST/release-tetex-texmf.txt \ - && "teTeX-texmf release: `cat $MT_TEXMFDIST/release-tetex-texmf.txt`" -} - -# -############################################################################### -# tcBatch(args) -# handle batch mode -############################################################################### -tcBatch() -{ - help="texconfig supports adjusting and updating many aspects of -the TeX installation. - -Usage: $progname conf (show configuration information) - $progname dvipdfmx paper PAPER (dvipdfmx paper size) - $progname dvipdfm paper PAPER (dvipdfm paper size) - $progname dvips [OPTION...] (dvips options) - $progname faq (show teTeX faq) - $progname findprog PROG... (show locations of PROGs, a la which) - $progname font vardir DIR - $progname font ro - $progname font rw - $progname formats (edit fmtutil.cnf) - $progname help (or --help; show this help) - $progname hyphen FORMAT (edit hyphenation config for FORMAT) - $progname init [FORMAT]... (rebuild FORMATs, or all formats - plus run texlinks and updmap) - $progname mode MODE (set Metafont MODE) - $progname paper PAPER (set default paper size to PAPER) - $progname pdftex [OPTION]... (pdftex options) - $progname rehash (rebuild ls-R files with mktexlsr) - $progname version (or --version; show version info) - $progname xdvi paper PAPER (xdvi paper size) - -Get more help with: - $progname dvipdfmx - $progname dvipdfm - $progname dvips - $progname font - $progname hyphen - $progname mode - $progname paper - $progname pdftex - $progname xdvi - -Report bugs to: tex-k@tug.org -TeX Live home page: <http://tug.org/texlive/> -" - - case $1 in - # texconfig conf - conf|confall) - setupTexmfmain - setupTexmfdist - echo '=========================== version information ==========================' - showDistVersionInfo - echo - echo '==================== binaries found by searching $PATH ===================' - echo "PATH=$PATH" - echoLocateBinary kpsewhich updmap fmtutil texconfig tex pdftex mktexpk dvips dvipdfm - echo - echo '=========================== active config files ==========================' - echoLocateCfgfile texmf.cnf updmap.cfg fmtutil.cnf config.ps mktex.cnf XDvi pdftexconfig.tex config | sort -k 2 - echo - echo '============================= font map files =============================' - for m in psfonts.map pdftex.map ps2pk.map dvipdfm.map; do - echo "$m: `kpsewhich $m`" - done - echo - echo '=========================== kpathsea variables ===========================' - echoShowKpseVariable TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS - - echo - echo '==== kpathsea variables from environment only (ok if no output here) ====' - echoShowVariable $envVars - ;; - - # texconfig dvipdfm - dvipdfm) - help="Usage: $progname dvipdfm paper PAPER - -Valid PAPER settings: - letter legal ledger tabloid a4 a3" - case $2 in - # texconfig dvipdfm 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 config '^p' "p $3";; - "") echo "$help" >&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 <unknown> - *) - 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 <unknown> - *) - 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 <<EOM -texconfig formats is no longer supported, because manual edits of -fmtutil.cnf will be overwritten by the new TeX Live package manager, -tlmgr, which regenerates that file as needed upon package changes. -Thus, to add or remove formats, the recommended method is to use tlmgr -to add or remove the appropriate package. - -If you need to make manual additions, you can edit the file -fmtutil-local.cnf under TEXMFLOCAL. Further information with -tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - setupTmpDir - echo "$progname: analyzing old configuration..." >&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 <<EOM -texconfig hyphen is no longer supported, because manual edits of -language.dat (or language.def) will be overwritten by the new TeX Live -package manager, tlmgr, which regenerates those configuration files as -needed upon package changes. Thus, to add or remove hyphenation -patterns, the recommended method is to use tlmgr to add or remove the -appropriate package. - -If you need to make manual additions, you can edit the files -language-local.dat and language-local.def under TEXMFLOCAL. Further -information with tlmgr --help and at http://tug.org/texlive/tlmgr.html. - -Exiting. -EOM - exit 1 # but leave the real code for posterity - - tcBatchHyphenFormat=$2 - formatsForHyphen=`getFormatsForHyphen` - formatsForHyphenFmt=`echo "$formatsForHyphen" | myFmt | sed 's@^@ @'` - help="Usage: $progname hyphen FORMAT - -Valid FORMATs are: -$formatsForHyphenFmt" - case $tcBatchHyphenFormat in - "") - echo "$help" >&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/Master/bin/x86_64-solaris/texconfig-dialog b/Master/bin/x86_64-solaris/texconfig-dialog deleted file mode 100755 index e1868d91574..00000000000 --- a/Master/bin/x86_64-solaris/texconfig-dialog +++ /dev/null @@ -1,486 +0,0 @@ -#!/bin/sh - -# TeX-Config version 3.0 -# Thomas Esser, te@dbs.uni-hannover.de. Public domain. - -# 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+"$@"}'='"$@"' - -# the version string -version='$Id: texconfig-dialog 23826 2011-09-05 17:59:15Z karl $' - -: ${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/Master/bin/x86_64-solaris/texconfig-sys b/Master/bin/x86_64-solaris/texconfig-sys deleted file mode 100755 index ff549003ad2..00000000000 --- a/Master/bin/x86_64-solaris/texconfig-sys +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# $Id: texconfig-sys 20962 2011-01-07 11:45:38Z peter $ - -# 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/Master/bin/x86_64-solaris/texlinks b/Master/bin/x86_64-solaris/texlinks deleted file mode 100755 index 09b3488d263..00000000000 --- a/Master/bin/x86_64-solaris/texlinks +++ /dev/null @@ -1,335 +0,0 @@ -#!/bin/sh -# $Id: texlinks 18035 2010-04-28 17:41:52Z mpg $ - -# 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 <vext01@gmail.com> -# 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: texlinks 18035 2010-04-28 17:41:52Z mpg $' -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: <http://tug.org/texlive/> -' - -############################################################################### -# 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/Master/bin/alpha-linux/fmtutil-sys b/Master/texmf/scripts/tetex/fmtutil-sys.sh index bfb52f94e1f..bfb52f94e1f 100755 --- a/Master/bin/alpha-linux/fmtutil-sys +++ b/Master/texmf/scripts/tetex/fmtutil-sys.sh diff --git a/Master/bin/alpha-linux/fmtutil b/Master/texmf/scripts/tetex/fmtutil.sh index 06ef11380b4..06ef11380b4 100755 --- a/Master/bin/alpha-linux/fmtutil +++ b/Master/texmf/scripts/tetex/fmtutil.sh diff --git a/Master/bin/alpha-linux/texconfig-dialog b/Master/texmf/scripts/tetex/texconfig-dialog.sh index e1868d91574..e1868d91574 100755 --- a/Master/bin/alpha-linux/texconfig-dialog +++ b/Master/texmf/scripts/tetex/texconfig-dialog.sh diff --git a/Master/bin/alpha-linux/texconfig-sys b/Master/texmf/scripts/tetex/texconfig-sys.sh index ff549003ad2..ff549003ad2 100755 --- a/Master/bin/alpha-linux/texconfig-sys +++ b/Master/texmf/scripts/tetex/texconfig-sys.sh diff --git a/Master/bin/alpha-linux/texconfig b/Master/texmf/scripts/tetex/texconfig.sh index c9cc73c8305..c9cc73c8305 100755 --- a/Master/bin/alpha-linux/texconfig +++ b/Master/texmf/scripts/tetex/texconfig.sh diff --git a/Master/bin/alpha-linux/texlinks b/Master/texmf/scripts/tetex/texlinks.sh index 09b3488d263..09b3488d263 100755 --- a/Master/bin/alpha-linux/texlinks +++ b/Master/texmf/scripts/tetex/texlinks.sh diff --git a/Master/tlpkg/tlpsrc/tetex.tlpsrc b/Master/tlpkg/tlpsrc/tetex.tlpsrc index 47b8374a519..66b14545773 100644 --- a/Master/tlpkg/tlpsrc/tetex.tlpsrc +++ b/Master/tlpkg/tlpsrc/tetex.tlpsrc @@ -14,8 +14,13 @@ runpattern f texmf-dist/scripts/tetex/allcm.sh runpattern f texmf-dist/scripts/tetex/allneeded.sh runpattern f texmf-dist/scripts/tetex/dvi2fax.sh runpattern f texmf-dist/scripts/tetex/dvired.sh +runpattern f texmf-dist/scripts/tetex/fmtutil.sh +runpattern f texmf-dist/scripts/tetex/fmtutil-sys.sh runpattern f texmf-dist/scripts/tetex/kpsewhere.sh runpattern f texmf-dist/scripts/tetex/kpsetool.sh +runpattern f texmf-dist/scripts/tetex/texconfig-dialog.sh +runpattern f texmf-dist/scripts/tetex/texconfig-sys.sh +runpattern f texmf-dist/scripts/tetex/texlinks.sh runpattern f texmf-dist/scripts/tetex/updmap.pl runpattern f texmf-dist/scripts/tetex/updmap-sys.sh diff --git a/Master/tlpkg/tlpsrc/texconfig.tlpsrc b/Master/tlpkg/tlpsrc/texconfig.tlpsrc index 2c3f24ebf7b..ced5fc507e6 100644 --- a/Master/tlpkg/tlpsrc/texconfig.tlpsrc +++ b/Master/tlpkg/tlpsrc/texconfig.tlpsrc @@ -1,4 +1,5 @@ category TLCore +runpattern f texmf/scripts/tetex/texconfig.sh runpattern f texmf/texconfig/* runpattern f texmf/texconfig/g/* runpattern f texmf/texconfig/v/* |