summaryrefslogtreecommitdiff
path: root/contrib/texinfo/util
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/texinfo/util')
-rw-r--r--contrib/texinfo/util/Makefile.am13
-rw-r--r--contrib/texinfo/util/Makefile.in321
-rw-r--r--contrib/texinfo/util/deref.c238
-rwxr-xr-xcontrib/texinfo/util/fixfonts84
-rwxr-xr-xcontrib/texinfo/util/gen-dir-node181
-rwxr-xr-xcontrib/texinfo/util/mkinstalldirs40
-rwxr-xr-xcontrib/texinfo/util/tex3patch71
-rwxr-xr-xcontrib/texinfo/util/texi2dvi362
-rwxr-xr-xcontrib/texinfo/util/update-info875
9 files changed, 0 insertions, 2185 deletions
diff --git a/contrib/texinfo/util/Makefile.am b/contrib/texinfo/util/Makefile.am
deleted file mode 100644
index f16dd034da85..000000000000
--- a/contrib/texinfo/util/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-## Makefile.am for texinfo/util.
-## $Id: Makefile.am,v 1.6 1997/07/15 19:15:05 karl Exp $
-## Run automake in .. to produce Makefile.in from this.
-
-bin_PROGRAMS = install-info texindex
-bin_SCRIPTS = texi2dvi
-
-localedir = $(datadir)/locale
-INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
-LDADD = ../lib/libtxi.a @INTLLIBS@
-
-EXTRA_DIST = README deref.c fixfonts gen-dir-node tex3patch texi2dvi \
- update-info
diff --git a/contrib/texinfo/util/Makefile.in b/contrib/texinfo/util/Makefile.in
deleted file mode 100644
index 7b04741a6c60..000000000000
--- a/contrib/texinfo/util/Makefile.in
+++ /dev/null
@@ -1,321 +0,0 @@
-# Makefile.in generated automatically by automake 1.2f from Makefile.am
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
-# This Makefile.in 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.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-
-top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-CC = @CC@
-DATADIRNAME = @DATADIRNAME@
-GENCAT = @GENCAT@
-GMOFILES = @GMOFILES@
-GMSGFMT = @GMSGFMT@
-GT_NO = @GT_NO@
-GT_YES = @GT_YES@
-INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
-INSTOBJEXT = @INSTOBJEXT@
-INTLDEPS = @INTLDEPS@
-INTLLIBS = @INTLLIBS@
-INTLOBJS = @INTLOBJS@
-MAKEINFO = @MAKEINFO@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
-PACKAGE = @PACKAGE@
-POFILES = @POFILES@
-POSUB = @POSUB@
-RANLIB = @RANLIB@
-TERMLIBS = @TERMLIBS@
-TEXCONFIG = @TEXCONFIG@
-TEXMF = @TEXMF@
-USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
-USE_NLS = @USE_NLS@
-VERSION = @VERSION@
-l = @l@
-
-bin_PROGRAMS = install-info texindex
-bin_SCRIPTS = texi2dvi
-
-localedir = $(datadir)/locale
-INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
-LDADD = ../lib/libtxi.a @INTLLIBS@
-
-EXTRA_DIST = README deref.c fixfonts gen-dir-node tex3patch texi2dvi \
- update-info
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-PROGRAMS = $(bin_PROGRAMS)
-
-
-DEFS = @DEFS@ -I. -I$(srcdir) -I..
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-install_info_SOURCES = install-info.c
-install_info_OBJECTS = install-info.o
-install_info_LDADD = $(LDADD)
-install_info_DEPENDENCIES = ../lib/libtxi.a
-install_info_LDFLAGS =
-texindex_SOURCES = texindex.c
-texindex_OBJECTS = texindex.o
-texindex_LDADD = $(LDADD)
-texindex_DEPENDENCIES = ../lib/libtxi.a
-texindex_LDFLAGS =
-SCRIPTS = $(bin_SCRIPTS)
-
-CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
-DIST_COMMON = README Makefile.am Makefile.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = tar
-GZIP = --best
-SOURCES = install-info.c texindex.c
-OBJECTS = install-info.o texindex.o
-
-default: all
-
-.SUFFIXES:
-.SUFFIXES: .S .c .o .s
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps util/Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-
-mostlyclean-binPROGRAMS:
-
-clean-binPROGRAMS:
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-
-distclean-binPROGRAMS:
-
-maintainer-clean-binPROGRAMS:
-
-install-binPROGRAMS: $(bin_PROGRAMS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(bindir)
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- if test -f $$p; then \
- echo " $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
- $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
- else :; fi; \
- done
-
-uninstall-binPROGRAMS:
- @$(NORMAL_UNINSTALL)
- list='$(bin_PROGRAMS)'; for p in $$list; do \
- rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
- done
-
-.c.o:
- $(COMPILE) -c $<
-
-.s.o:
- $(COMPILE) -c $<
-
-.S.o:
- $(COMPILE) -c $<
-
-mostlyclean-compile:
- -rm -f *.o core *.core
-
-clean-compile:
-
-distclean-compile:
- -rm -f *.tab.c
-
-maintainer-clean-compile:
-
-install-info: $(install_info_OBJECTS) $(install_info_DEPENDENCIES)
- @rm -f install-info
- $(LINK) $(install_info_LDFLAGS) $(install_info_OBJECTS) $(install_info_LDADD) $(LIBS)
-
-texindex: $(texindex_OBJECTS) $(texindex_DEPENDENCIES)
- @rm -f texindex
- $(LINK) $(texindex_LDFLAGS) $(texindex_OBJECTS) $(texindex_LDADD) $(LIBS)
-
-install-binSCRIPTS: $(bin_SCRIPTS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(bindir)
- @list='$(bin_SCRIPTS)'; for p in $$list; do \
- if test -f $$p; then \
- echo " $(INSTALL_SCRIPT) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
- $(INSTALL_SCRIPT) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
- else if test -f $(srcdir)/$$p; then \
- echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
- $(INSTALL_SCRIPT) $(srcdir)/$$p $(bindir)/`echo $$p|sed '$(transform)'`; \
- else :; fi; fi; \
- done
-
-uninstall-binSCRIPTS:
- @$(NORMAL_UNINSTALL)
- list='$(bin_SCRIPTS)'; for p in $$list; do \
- rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
- done
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP)
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
-
-mostlyclean-tags:
-
-clean-tags:
-
-distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = util
-
-distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
- done
-install-info.o: install-info.c ../lib/system.h ../config.h \
- ../lib/getopt.h
-texindex.o: texindex.c ../lib/system.h ../config.h ../lib/getopt.h
-
-info:
-dvi:
-check: all
- $(MAKE)
-installcheck:
-install-exec: install-binPROGRAMS install-binSCRIPTS
- @$(NORMAL_INSTALL)
-
-install-data:
- @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
- @:
-
-uninstall: uninstall-binPROGRAMS uninstall-binSCRIPTS
-
-all: Makefile $(PROGRAMS) $(SCRIPTS)
-
-install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
-installdirs:
- $(mkinstalldirs) $(bindir) $(bindir)
-
-
-mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-binPROGRAMS mostlyclean-compile \
- mostlyclean-tags mostlyclean-generic
-
-clean: clean-binPROGRAMS clean-compile clean-tags clean-generic \
- mostlyclean
-
-distclean: distclean-binPROGRAMS distclean-compile distclean-tags \
- distclean-generic clean
- -rm -f config.status
-
-maintainer-clean: maintainer-clean-binPROGRAMS maintainer-clean-compile \
- maintainer-clean-tags maintainer-clean-generic \
- distclean
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
-
-.PHONY: default mostlyclean-binPROGRAMS distclean-binPROGRAMS \
-clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
-install-binPROGRAMS mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile uninstall-binSCRIPTS install-binSCRIPTS tags \
-mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
-distdir info dvi installcheck install-exec install-data install \
-uninstall all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
-
-
-# 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/contrib/texinfo/util/deref.c b/contrib/texinfo/util/deref.c
deleted file mode 100644
index c15bc1abcf15..000000000000
--- a/contrib/texinfo/util/deref.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * deref.c
-
- * compile command: gcc -g -o deref deref.c
-
- * execute command: deref filename.texi > newfile.texi
-
- * To: bob@gnu.ai.mit.edu
- * Subject: another tool
- * Date: 18 Dec 91 16:03:13 EST (Wed)
- * From: gatech!skeeve!arnold@eddie.mit.edu (Arnold D. Robbins)
- *
- * Here is deref.c. It turns texinfo cross references back into the
- * one argument form. It has the same limitations as fixref; one xref per
- * line and can't cross lines. You can use it to find references that do
- * cross a line boundary this way:
- *
- * deref < manual > /dev/null 2>errs
- *
- * (This assumes bash or /bin/sh.) The file errs will have list of lines
- * where deref could not find matching braces.
- *
- * A gawk manual processed by deref goes through makeinfo without complaint.
- * Compile with gcc and you should be set.
- *
- * Enjoy,
- *
- * Arnold
- * -----------
- */
-
-/*
- * deref.c
- *
- * Make all texinfo references into the one argument form.
- *
- * Arnold Robbins
- * arnold@skeeve.atl.ga.us
- * December, 1991
- *
- * Copyright, 1991, Arnold Robbins
- */
-
-/*
- * LIMITATIONS:
- * One texinfo cross reference per line.
- * Cross references may not cross newlines.
- * Use of fgets for input (to be fixed).
- */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-
-/* for gcc on the 3B1, delete if this gives you grief */
-extern int fclose (FILE * fp);
-extern int fprintf (FILE * fp, const char *str,...);
-
-extern char *strerror (int errno);
-extern char *strchr (char *cp, int ch);
-extern int strncmp (const char *s1, const char *s2, int count);
-
-extern int errno;
-
-void process (FILE * fp);
-void repair (char *line, char *ref, int toffset);
-
-int Errs = 0;
-char *Name = "stdin";
-int Line = 0;
-char *Me;
-
-/* main --- handle arguments, global vars for errors */
-
-int
-main (int argc, char **argv)
-{
- FILE *fp;
-
- Me = argv[0];
-
- if (argc == 1)
- process (stdin);
- else
- for (argc--, argv++; *argv != NULL; argc--, argv++)
- {
- if (argv[0][0] == '-' && argv[0][1] == '\0')
- {
- Name = "stdin";
- Line = 0;
- process (stdin);
- }
- else if ((fp = fopen (*argv, "r")) != NULL)
- {
- Name = *argv;
- Line = 0;
- process (fp);
- fclose (fp);
- }
- else
- {
- fprintf (stderr, "%s: can not open: %s\n",
- *argv, strerror (errno));
- Errs++;
- }
- }
- return Errs != 0;
-}
-
-/* isref --- decide if we've seen a texinfo cross reference */
-
-int
-isref (char *cp)
-{
- if (strncmp (cp, "@ref{", 5) == 0)
- return 5;
- if (strncmp (cp, "@xref{", 6) == 0)
- return 6;
- if (strncmp (cp, "@pxref{", 7) == 0)
- return 7;
- return 0;
-}
-
-/* process --- read files, look for references, fix them up */
-
-void
-process (FILE * fp)
-{
- char buf[BUFSIZ];
- char *cp;
- int count;
-
- while (fgets (buf, sizeof buf, fp) != NULL)
- {
- Line++;
- cp = strchr (buf, '@');
- if (cp == NULL)
- {
- fputs (buf, stdout);
- continue;
- }
- do
- {
- count = isref (cp);
- if (count == 0)
- {
- cp++;
- cp = strchr (cp, '@');
- if (cp == NULL)
- {
- fputs (buf, stdout);
- goto next;
- }
- continue;
- }
- /* got one */
- repair (buf, cp, count);
- break;
- }
- while (cp != NULL);
- next:;
- }
-}
-
-/* repair --- turn all texinfo cross references into the one argument form */
-
-void
-repair (char *line, char *ref, int toffset)
-{
- int braces = 1; /* have seen first left brace */
- char *cp;
-
- ref += toffset;
-
- /* output line up to and including left brace in reference */
- for (cp = line; cp <= ref; cp++)
- putchar (*cp);
-
- /* output node name */
- for (; *cp && *cp != '}' && *cp != ',' && *cp != '\n'; cp++)
- putchar (*cp);
-
- if (*cp != '}')
- { /* could have been one arg xref */
- /* skip to matching right brace */
- for (; braces > 0; cp++)
- {
- switch (*cp)
- {
- case '@':
- cp++; /* blindly skip next character */
- break;
- case '{':
- braces++;
- break;
- case '}':
- braces--;
- break;
- case '\n':
- case '\0':
- Errs++;
- fprintf (stderr,
- "%s: %s: %d: mismatched braces\n",
- Me, Name, Line);
- goto out;
- default:
- break;
- }
- }
- out:
- ;
- }
-
- putchar ('}');
- if (*cp == '}')
- cp++;
-
- /* now the rest of the line */
- for (; *cp; cp++)
- putchar (*cp);
- return;
-}
-
-/* strerror --- return error string, delete if in your library */
-
-char *
-strerror (int errno)
-{
- static char buf[100];
- extern int sys_nerr;
- extern char *sys_errlist[];
-
- if (errno < sys_nerr && errno >= 0)
- return sys_errlist[errno];
-
- sprintf (buf, "unknown error %d", errno);
- return buf;
-}
diff --git a/contrib/texinfo/util/fixfonts b/contrib/texinfo/util/fixfonts
deleted file mode 100755
index ee2ea7192198..000000000000
--- a/contrib/texinfo/util/fixfonts
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/sh
-# Make links named `lcircle10' for all TFM and GF/PK files, if no
-# lcircle10 files already exist.
-
-# Don't override definition of prefix and/or libdir if they are
-# already defined in the environment.
-if test "z${prefix}" = "z" ; then
- prefix=/usr/local
-else
- # prefix may contain references to other variables, thanks to make.
- eval prefix=\""${prefix}"\"
-fi
-
-if test "z${libdir}" = "z" ; then
- libdir="${prefix}/lib/tex"
-else
- # libdir may contain references to other variables, thanks to make.
- eval libdir=\""${libdir}"\"
-fi
-
-texlibdir="${libdir}"
-texfontdir="${texlibdir}/fonts"
-
-# Directories for the different font formats, in case they're not all
-# stored in one place.
-textfmdir="${textfmdir-${texfontdir}}"
-texpkdir="${texpkdir-${texfontdir}}"
-texgfdir="${texgfdir-${texfontdir}}"
-
-test "z${TMPDIR}" = "z" && TMPDIR="/tmp"
-
-tempfile="${TMPDIR}/circ$$"
-tempfile2="${TMPDIR}/circ2$$"
-
-# EXIT SIGHUP SIGINT SIGQUIT SIGTERM
-#trap 'rm -f "${tempfile}" "${tempfile2}"' 0 1 2 3 15
-
-# Find all the fonts with names that include `circle'.
-(cd "${texfontdir}"; find . -name '*circle*' -print > "${tempfile}")
-
-# If they have lcircle10.tfm, assume everything is there, and quit.
-if grep 'lcircle10\.tfm' "${tempfile}" > /dev/null 2>&1 ; then
- echo "Found lcircle10.tfm."
- exit 0
-fi
-
-# No TFM file for lcircle. Make a link to circle10.tfm if it exists,
-# and then make a link to the bitmap files.
-grep 'circle10\.tfm' "${tempfile}" > "${tempfile2}" \
- || {
- echo "I can't find any circle fonts in ${texfontdir}.
-If it isn't installed somewhere else, you need to get the Metafont sources
-from somewhere, e.g., labrea.stanford.edu:pub/tex/latex/circle10.mf, and
-run Metafont on them."
- exit 1
- }
-
-# We have circle10.tfm. (If we have it more than once, take the first
-# one.) Make the link.
-tempfile2_line1="`sed -ne '1p;q' \"${tempfile2}\"`"
-ln "${tempfile2_line1}" "${textfmdir}/lcircle10.tfm"
-echo "Linked to ${tempfile2_line1}."
-
-# Now make a link for the PK files, if any.
-(cd "${texpkdir}"
- for f in `grep 'circle10.*pk' "${tempfile}"` ; do
- set - `echo "$f" \
- | sed -ne '/\//!s/^/.\//;s/\(.*\)\/\([^\/][^\/]*\)$/\1 \2/;p'`
- ln "$f" "${1}/l${2}"
- echo "Linked to $f."
- done
-)
-
-# And finally for the GF files.
-(cd "${texgfdir}"
- for f in `grep 'circle10.*gf' "${tempfile}"` ; do
- set - `echo "$f" \
- | sed -ne '/\//!s/^/.\//;s/\(.*\)\/\([^\/][^\/]*\)$/\1 \2/;p'`
- ln "$f" "${1}/l${2}"
- echo "Linked to $f."
- done
-)
-
-# eof
diff --git a/contrib/texinfo/util/gen-dir-node b/contrib/texinfo/util/gen-dir-node
deleted file mode 100755
index c7ef670c5393..000000000000
--- a/contrib/texinfo/util/gen-dir-node
+++ /dev/null
@@ -1,181 +0,0 @@
-#!/bin/sh
-# $Id: gen-dir-node,v 1.1 1997/05/22 22:02:43 karl Exp $
-# Generate the top-level Info node, given a directory of Info files
-# and (optionally) a skeleton file. The output will be suitable for a
-# top-level dir file. The skeleton file contains info topic names in the
-# order they should appear in the output. There are three special
-# lines that alter the behavior: a line consisting of just "--" causes
-# the next line to be echoed verbatim to the output. A line
-# containing just "%%" causes all the remaining filenames (wildcards
-# allowed) in the rest of the file to be ignored. A line containing
-# just "!!" exits the script when reached (unless preceded by a line
-# containing just "--"). Once the script reaches the end of the
-# skeleton file, it goes through the remaining files in the directory
-# in order, putting their entries at the end. The script will use the
-# ENTRY information in each info file if it exists. Otherwise it will
-# make a minimal entry.
-
-# sent by Jeffrey Osier <jeffrey@cygnus.com>, who thinks it came from
-# zoo@winternet.com (david d `zoo' zuhn)
-
-# modified 7 April 1995 by Joe Harrington <jh@tecate.gsfc.nasa.gov> to
-# take special flags
-
-INFODIR=$1
-if [ $# = 2 ] ; then
- SKELETON=$2
-else
- SKELETON=/dev/null
-fi
-
-skip=
-
-if [ $# -gt 2 ] ; then
- echo usage: $0 info-directory [ skeleton-file ] 1>&2
- exit 1
-else
- true
-fi
-
-if [ ! -d ${INFODIR} ] ; then
- echo "$0: first argument must specify a directory"
- exit 1
-fi
-
-### output the dir header
-echo "-*- Text -*-"
-echo "This file was generated automatically by $0."
-echo "This version was generated on `date`"
-echo "by `whoami`@`hostname` for `(cd ${INFODIR}; pwd)`"
-
-cat << moobler
-
-This is the file .../info/dir, which contains the topmost node of the
-Info hierarchy. The first time you invoke Info you start off
-looking at that node, which is (dir)Top.
-
-File: dir Node: Top This is the top of the INFO tree
- This (the Directory node) gives a menu of major topics.
- Typing "d" returns here, "q" exits, "?" lists all INFO commands, "h"
- gives a primer for first-timers, "mTexinfo<Return>" visits Texinfo topic,
- etc.
- Or click mouse button 2 on a menu item or cross reference to select it.
- --- PLEASE ADD DOCUMENTATION TO THIS TREE. (See INFO topic first.) ---
-
-* Menu: The list of major topics begins on the next line.
-
-moobler
-
-### go through the list of files in the skeleton. If an info file
-### exists, grab the ENTRY information from it. If an entry exists
-### use it, otherwise create a minimal dir entry.
-###
-### Then remove that file from the list of existing files. If any
-### additional files remain (ones that don't have a skeleton entry),
-### then generate entries for those in the same way, putting the info for
-### those at the end....
-
-infofiles=`(cd ${INFODIR}; ls | egrep -v '\-|^dir$|^dir\.info$|^dir\.orig$')`
-
-# echoing gets clobbered by backquotes; we do it the hard way...
-lines=`wc $SKELETON | awk '{print $1}'`
-line=1
-while [ $lines -ge $line ] ; do
- # Read one line from the file. This is so that we can echo lines with
- # whitespace and quoted characters in them.
- fileline=`awk NR==$line $SKELETON`
-
- # flag fancy features
- if [ ! -z "$echoline" ] ; then # echo line
- echo "$fileline"
- fileline=
- echoline=
- elif [ "${fileline}" = "--" ] ; then # should we echo the next line?
- echoline=1
- elif [ "${fileline}" = "%%" ] ; then # eliminate remaining files from dir?
- skip=1
- elif [ "${fileline}" = "!!" ] ; then # quit now
- exit 0
- fi
-
- # handle files if they exist
- for file in $fileline"" ; do # expand wildcards ("" handles blank lines)
-
- fname=
-
- if [ -z "$echoline" -a ! -z "$file" ] ; then
-
- # Find the file to operate upon. Check both possible names.
- infoname=`echo $file | sed 's/\.info$//'`
- noext=
- ext=
- if [ -f ${INFODIR}/$infoname ] ; then
- noext=$infoname
- fi
- if [ -f ${INFODIR}/${infoname}.info ] ; then
- ext=${infoname}.info
- fi
-
- # If it exists with both names take what was said in the file.
- if [ ! -z "$ext" -a ! -z "$noext" ]; then
- fname=$file
- warn="### Warning: $ext and $noext both exist! Using ${file}. ###"
- elif [ ! \( -z "$ext" -a -z "$noext" \) ]; then
- # just take the name if it exists only once
- fname=${noext}${ext}
- fi
-
- # if we found something and aren't skipping, do the entry
- if [ ! -z "$fname" ] ; then
- if [ -z "$skip" ] ; then
-
- if [ ! -z "$warn" ] ; then # issue any warning
- echo $warn
- warn=
- fi
-
- entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' \
- -e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/$fname`
- if [ ! -z "${entry}" ] ; then
- echo "${entry}"
- else
- echo "* ${infoname}: (${fname})."
- fi
- fi
-
- # remove the name from the directory listing
- infofiles=`echo ${infofiles} | sed -e "s/ ${fname} / /" \
- -e "s/^${fname} //" \
- -e "s/ ${fname}$//"`
-
- fi
-
- fi
-
- done
-
- line=`expr $line + 1`
-done
-
-if [ -z "${infofiles}" ] ; then
- exit 0
-else
- echo
-fi
-
-for file in ${infofiles}; do
- case $file in
- *.gz) zcat=zcat; file=`echo $file|sed 's/\.gz$//'`; gz=.gz;;
- *) zcat=cat; gz=;;
- esac
- infoname=`echo $file | sed 's/\.info$//'`
- entry=`$zcat ${INFODIR}/${file}$gz \
- |sed -e '1,/START-INFO-DIR-ENTRY/d' \
- -e '/END-INFO-DIR-ENTRY/,$d'`
-
- if [ ! -z "${entry}" ] ; then
- echo "${entry}"
- else
- echo "* ${infoname}: (${file})."
- fi
-done
diff --git a/contrib/texinfo/util/mkinstalldirs b/contrib/texinfo/util/mkinstalldirs
deleted file mode 100755
index a01481be4367..000000000000
--- a/contrib/texinfo/util/mkinstalldirs
+++ /dev/null
@@ -1,40 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
-# Created: 1993-05-16
-# Public domain
-
-# $Id: mkinstalldirs,v 1.10 1996/05/03 07:37:52 friedman Exp $
-
-errstatus=0
-
-for file
-do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
-
- pathcomp=
- for d
- do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
- -* ) pathcomp=./$pathcomp ;;
- esac
-
- if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp" 1>&2
-
- mkdir "$pathcomp" || lasterr=$?
-
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- fi
- fi
-
- pathcomp="$pathcomp/"
- done
-done
-
-exit $errstatus
-
-# mkinstalldirs ends here
diff --git a/contrib/texinfo/util/tex3patch b/contrib/texinfo/util/tex3patch
deleted file mode 100755
index 1708c7588bbb..000000000000
--- a/contrib/texinfo/util/tex3patch
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/sh
-# Auxiliary script to work around TeX 3.0 bug. ---- tex3patch ----
-# patches texinfo.tex in current directory, or in directory given as arg.
-
-ANYVERSION=no
-
-for arg in $1 $2
-do
- case $arg in
- --dammit | -d ) ANYVERSION=yes ;;
-
- * ) dir=$arg
- esac
-done
-
-if [ -z "$dir" ]; then
- dir='.'
-fi
-
-if [ \( 2 -lt $# \) -o \
- \( ! -f $dir/texinfo.tex \) ]; then
- echo "To patch texinfo.tex for peaceful coexistence with Unix TeX 3.0,"
- echo "run $0"
- echo "with no arguments in the same directory as texinfo.tex; or run"
- echo " $0 DIRECTORY"
- echo "(where DIRECTORY is a path leading to texinfo.tex)."
- exit
-fi
-
-if [ -z "$TMPDIR" ]; then
- TMPDIR=/tmp
-fi
-
-echo "Checking for \`dummy.tfm'"
-
-( cd $TMPDIR; tex '\relax \batchmode \font\foo=dummy \bye' )
-
-grep -s '3.0' $TMPDIR/texput.log
-if [ 1 = "$?" -a "$ANYVERSION" != "yes" ]; then
- echo "You probably do not need this patch,"
- echo "since your TeX does not seem to be version 3.0."
- echo "If you insist on applying the patch, run $0"
- echo "again with the option \`--dammit'"
- exit
-fi
-
-grep -s 'file not found' $TMPDIR/texput.log
-if [ 0 = $? ]; then
- echo "This patch requires the dummy font metric file \`dummy.tfm',"
- echo "which does not seem to be part of your TeX installation."
- echo "Please get your TeX maintainer to install \`dummy.tfm',"
- echo "then run this script again."
- exit
-fi
-rm $TMPDIR/texput.log
-
-echo "Patching $dir/texinfo.tex"
-
-sed -e 's/%%*\\font\\nullfont/\\font\\nullfont/' \
- $dir/texinfo.tex >$TMPDIR/texinfo.tex
-mv $dir/texinfo.tex $dir/texinfo.tex-distrib; mv $TMPDIR/texinfo.tex $dir
-
-if [ 0 = $? ]; then
- echo "Patched $dir/texinfo.tex to avoid TeX 3.0 bug."
- echo "The original version is saved as $dir/texinfo.tex-distrib."
-else
- echo "Patch failed. Sorry."
-fi
-----------------------------------------tex3patch ends
-
-
diff --git a/contrib/texinfo/util/texi2dvi b/contrib/texinfo/util/texi2dvi
deleted file mode 100755
index 43f652d00f19..000000000000
--- a/contrib/texinfo/util/texi2dvi
+++ /dev/null
@@ -1,362 +0,0 @@
-#! /bin/sh
-# texi2dvi --- smartly produce DVI files from texinfo sources
-# $Id: texi2dvi,v 0.8 1998/02/26 21:13:13 karl Exp $
-#
-# Copyright (C) 1992, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can either send email to this
-# program's maintainer or write to: The Free Software Foundation,
-# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
-#
-# Commentary:
-#
-# Author: Noah Friedman <friedman@gnu.org>
-#
-# Please send bug reports, etc. to bug-texinfo@gnu.org.
-# If possible, please send a copy of the output of the script called with
-# the `--debug' option when making a bug report.
-#
-# In the interest of general portability, some common bourne shell
-# constructs were avoided because they weren't guaranteed to be available
-# in some earlier implementations. I've tried to make this program as
-# portable as possible. Welcome to unix, where the lowest common
-# denominator is rapidly diminishing.
-#
-# Among the more interesting lossages I noticed among Bourne shells:
-# * No shell functions.
-# * No `unset' builtin.
-# * `shift' cannot take a numeric argument, and signals an error if
-# there are no arguments to shift.
-#
-# Code:
-
-# Name by which this script was invoked.
-progname=`echo "$0" | sed -e 's/[^\/]*\///g'`
-
-# This string is expanded by rcs automatically when this file is checked out.
-rcs_revision='$Revision: 0.8 $'
-version=`set - $rcs_revision; echo $2`
-
-# To prevent hairy quoting and escaping later.
-bq='`'
-eq="'"
-
-usage="Usage: $0 [OPTION]... FILE...
-Run a Texinfo document through TeX.
-
-Options:
--b, --batch No interaction (\nonstopmode in TeX).
--c, --clean Remove all auxiliary files.
--D, --debug Turn on shell debugging ($bq${bq}set -x$eq$eq).
--t, --texinfo CMD Insert CMD after @setfilename before running TeX.
---verbose Report on what is done.
--h, --help Display this help and exit.
--v, --version Display version information and exit.
-
-The values of the TEX, TEXINDEX, and MAKEINFO environment variables are
-used to run those commands, if they are set.
-
-Email bug reports to bug-texinfo@gnu.org."
-
-# Initialize variables.
-# Don't use `unset' since old bourne shells don't have this command.
-# Instead, assign them an empty value.
-# Some of these, like TEX and TEXINDEX, may be inherited from the environment.
-backup_extension=.bak # these files get deleted if all goes well.
-batch=
-clean=
-debug=
-orig_pwd="`pwd`"
-textra=
-verbose=false
-makeinfo="${MAKEINFO-makeinfo}"
-texindex="${TEXINDEX-texindex}"
-tex="${TEX-tex}"
-
-# Save this so we can construct a new TEXINPUTS path for each file.
-TEXINPUTS_orig="$TEXINPUTS"
-export TEXINPUTS
-
-# Parse command line arguments.
-# Make sure that all wildcarded options are long enough to be unambiguous.
-# It's a good idea to document the full long option name in each case.
-# Long options which take arguments will need a `*' appended to the
-# canonical name to match the value appended after the `=' character.
-while :; do
- test $# -eq 0 && break
-
- case "$1" in
- -b | --batch | --b* ) batch=t; shift ;;
- -c | --clean | --c* ) clean=t; shift ;;
- -D | --debug | --d* ) debug=t; shift ;;
- -h | --help | --h* ) echo "$usage"; exit 0 ;;
- # OK, we should do real option parsing here, but be lazy for now.
- -t | --texinfo | --t*) shift; textra="$textra $1"; shift ;;
- -v | --vers* )
- echo "$progname (GNU Texinfo 3.12) $version"
- echo "Copyright (C) 1998 Free Software Foundation, Inc.
-There is NO warranty. You may redistribute this software
-under the terms of the GNU General Public License.
-For more information about these matters, see the files named COPYING."
- exit 0 ;;
- --verb* ) verbose=echo; shift ;;
- -- ) # Stop option processing
- shift
- break ;;
- -* )
- case "$1" in
- --*=* ) arg=`echo "$1" | sed -e 's/=.*//'` ;;
- * ) arg="$1" ;;
- esac
- exec 1>&2
- echo "$progname: Unknown or ambiguous option $bq$arg$eq."
- echo "$progname: Try $bq--help$eq for more information."
- exit 1 ;;
- * ) break ;;
- esac
-done
-
-# See if there are any command line args left (which will be interpreted as
-# filename arguments).
-if test $# -eq 0; then
- exec 1>&2
- echo "$progname: At least one file name is required as an argument."
- echo "$progname: Try $bq--help$eq for more information."
- exit 2
-fi
-
-test "$debug" = t && set -x
-
-# Texify files
-for command_line_filename in ${1+"$@"}; do
- $verbose "Processing $command_line_filename ..."
-
- # See if file exists. If it doesn't we're in trouble since, even
- # though the user may be able to reenter a valid filename at the tex
- # prompt (assuming they're attending the terminal), this script won't
- # be able to find the right index files and so forth.
- if test ! -r "${command_line_filename}"; then
- echo "$0: Could not read ${command_line_filename}." >&2
- continue
- fi
-
- # Roughly equivalent to `dirname ...`, but more portable
- directory="`echo ${command_line_filename} | sed 's/\/[^\/]*$//'`"
- filename_texi="`basename ${command_line_filename}`"
- # Strip off the last extension part (probably .texinfo or .texi)
- filename_noext="`echo ${filename_texi} | sed 's/\.[^.]*$//'`"
-
- # Use same basename since we want to generate aux files with the same
- # basename as the manual. Use extension .texi for the temp file so
- # that TeX will ignore it. Thus, we must use a subdirectory.
- #
- # Output the macro-expanded file to here. The vastly abbreviated
- # temporary directory name is so we don't have collisions on 8.3 or
- # 14-character filesystems.
- tmp_dir=${TMPDIR-/tmp}/txi2d.$$
- filename_tmp=$tmp_dir/$filename_noext.texi
- # Output the file with the user's extra commands to here.
- tmp_dir2=${tmp_dir}.2
- filename_tmp2=$tmp_dir2/$filename_noext.texi
- mkdir $tmp_dir $tmp_dir2
- # Always remove the temporary directories.
- trap "rm -rf $tmp_dir $tmp_dir2" 1 2 15
-
- # If directory and file are the same, then it's probably because there's
- # no pathname component. Set dirname to `.', the current directory.
- if test "z${directory}" = "z${command_line_filename}"; then
- directory=.
- fi
-
- # Source file might @include additional texinfo sources. Put `.' and
- # directory where source file(s) reside in TEXINPUTS before anything
- # else. `.' goes first to ensure that any old .aux, .cps, etc. files in
- # ${directory} don't get used in preference to fresher files in `.'.
- TEXINPUTS=".:${directory}:${TEXINPUTS_orig}"
-
- # Expand macro commands in the original source file using Makeinfo;
- # the macro syntax bfox implemented is impossible to implement in TeX.
- # Always use `end' footnote style, since the `separate' style
- # generates different output (arguably this is a bug in -E).
- # Discard main info output, the user asked to run TeX, not makeinfo.
- # Redirect output to /dev/null to throw away `Making info file...' msg.
- $verbose "Macro-expanding $command_line_filename to $filename_tmp ..."
- $makeinfo --footnote-style=end -E $filename_tmp -o /dev/null \
- $command_line_filename >/dev/null
-
- # But if there were no macros, or makeinfo failed for some reason,
- # just use the original file. (It shouldn't make any difference, but
- # let's be safe.)
- if test $? -ne 0 || cmp -s $filename_tmp $command_line_filename; then
- $verbose "Reverting to $command_line_filename ..."
- cp -p $command_line_filename $filename_tmp
- fi
- filename_input=$filename_tmp
- dirname_input=$tmp_dir
-
- # Used most commonly for @finalout, @smallbook, etc.
- if test -n "$textra"; then
- $verbose "Inserting extra commands: $textra."
- sed '/^@setfilename/a\
-'"$textra" $filename_input >$filename_tmp2
- filename_input=$filename_tmp2
- dirname_input=$tmp_dir2
- fi
-
- # If clean mode was specified, then move to the temporary directory.
- if test "$clean" = t; then
- $verbose "cd $dirname_input"
- cd $dirname_input || exit 1
- filename_input=`basename $filename_input`
- fi
-
- while true; do # will break out of loop below
- # "Unset" variables that might have values from previous iterations and
- # which won't be completely reset later.
- definite_index_files=
-
- # Find all files having root filename with a two-letter extension,
- # determine whether they're really index files, and save them. Foo.aux
- # is actually the cross-references file, but we need to keep track of
- # that too.
- possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
- for this_file in ${possible_index_files}; do
- # If file is empty, forget it.
- test -s "${this_file}" || continue
-
- # Examine first character of file. If it's not suitable to be an
- # index or xref file, don't process it.
- first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
- if test "x${first_character}" = "x\\" \
- || test "x${first_character}" = "x'"; then
- definite_index_files="${definite_index_files} ${this_file}"
- fi
- done
- orig_index_files="${definite_index_files}"
- orig_index_files_sans_aux="`echo ${definite_index_files} \
- | sed 's/'${filename_noext}'\.aux//;
- s/^[ ]*//;s/[ ]*$//;'`"
-
- # Now save copies of original index files so we have some means of
- # comparison later.
- $verbose "Backing up current index files: $orig_index_files ..."
- for index_file_to_save in ${orig_index_files}; do
- cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}"
- done
-
- # Run texindex on current index files. If they already exist, and
- # after running TeX a first time the index files don't change, then
- # there's no reason to run TeX again. But we won't know that if the
- # index files are out of date or nonexistent.
- if test -n "${orig_index_files_sans_aux}"; then
- $verbose "Running $texindex $orig_index_files_sans_aux ..."
- ${texindex} ${orig_index_files_sans_aux}
- fi
-
- # Finally, run TeX.
- if test "$batch" = t; then
- tex_mode='\nonstopmode'
- else
- tex_mode=
- fi
- $verbose "Running $tex $filename_input ..."
- cmd="$tex $tex_mode \\input $filename_input"
- $cmd
-
- # Check if index files changed.
- #
- definite_index_files=
- # Get list of new index files.
- possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
- for this_file in ${possible_index_files}; do
- # If file is empty, forget it.
- test -s "${this_file}" || continue
-
- # Examine first character of file. If it's not a backslash or
- # single quote, then it's definitely not an index or xref file.
- # (Will have to check for @ when we switch to Texinfo syntax in
- # all these files...)
- first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
- if test "x${first_character}" = "x\\" \
- || test "x${first_character}" = "x'"; then
- definite_index_files="${definite_index_files} ${this_file}"
- fi
- done
- new_index_files="${definite_index_files}"
- new_index_files_sans_aux="`echo ${definite_index_files} \
- | sed 's/'${filename_noext}'\.aux//;
- s/^[ ]*//;s/[ ]*$//;'`"
-
- # If old and new list don't at least have the same file list, then one
- # file or another has definitely changed.
- $verbose "Original index files =$orig_index_files"
- $verbose "New index files =$new_index_files"
- if test "z${orig_index_files}" != "z${new_index_files}"; then
- index_files_changed_p=t
- else
- # File list is the same. We must compare each file until we find a
- # difference.
- index_files_changed_p=
- for this_file in ${new_index_files}; do
- $verbose "Comparing index file $this_file ..."
- # cmp -s will return nonzero exit status if files differ.
- cmp -s "${this_file}" "${this_file}${backup_extension}"
- if test $? -ne 0; then
- # We only need to keep comparing until we find *one* that
- # differs, because we'll have to run texindex & tex no
- # matter what.
- index_files_changed_p=t
- $verbose "Index file $this_file differed:"
- test $verbose = echo \
- && diff -c "${this_file}${backup_extension}" "${this_file}"
- break
- fi
- done
- fi
-
- # If index files have changed since TeX has been run, or if the aux
- # file wasn't present originally, run texindex and TeX again.
- if test "${index_files_changed_p}"; then :; else
- # Nothing changed. We're done with TeX.
- break
- fi
- done
-
- # If we were in clean mode, compilation was in a tmp directory.
- # Copy the DVI file into the directory where the compilation
- # has been done. (The temp dir is about to get removed anyway.)
- # We also return to the original directory so that
- # - the next file is processed in correct conditions
- # - the temporary file can be removed
- if test -n "$clean"; then
- $verbose "Copying DVI file from `pwd` to $orig_pwd"
- cp -p $filename_noext.dvi $orig_pwd
- cd $orig_pwd || exit 1
- fi
-
- # Generate list of files to delete, then call rm once with the entire
- # list. This is significantly faster than multiple executions of rm.
- file_list=
- for file in ${orig_index_files}; do
- file_list="${file_list} ${file}${backup_extension}"
- done
- if test -n "${file_list}"; then
- $verbose "Removing $file_list $tmp_dir $tmp_dir2 ..."
- rm -f ${file_list}
- rm -rf $tmp_dir $tmp_dir2
- fi
-done
-
-$verbose "$0 done."
-true # exit successfully.
diff --git a/contrib/texinfo/util/update-info b/contrib/texinfo/util/update-info
deleted file mode 100755
index 0d31fde4d27b..000000000000
--- a/contrib/texinfo/util/update-info
+++ /dev/null
@@ -1,875 +0,0 @@
-#!/bin/sh
-# update-info -- update dir file from all extant info pages.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, you can either send email to this
-# program's maintainer or write to: The Free Software Foundation,
-# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
-#
-# Author: rhawes@dmapub.dma.org. Please report bugs to him.
-#
-# run this program to install update-info
-# ###SECTION 0### install script
-# These constants set the version numbers for both files:
-PROGRAM_VERSION="1.4"
-PACKAGE_VERSION="4.0"
-
-# ENVIRONMENT
-if test -z "$TMPDIR"; then
- TMPDIR="/usr/tmp"
-fi
-
-TMP_SED="$TMPDIR/uss$$.info"
-TMP_F_ADD_SECTION="$TMPDIR/ufa$$.info"
-TMP_F_DELETE_INVALID="$TMPDIR/ufd$$.info"
-TMP_F_INSERT_MISSING="$TMPDIR/ufi$$.info"
-TMP_FILES="$TMP_SED $TMP_F_ADD_SECTION $TMP_F_DELETE_INVALID\
- $TMP_F_INSERT_MISSING"
-
-trap 'rm -f $TMP_FILES' 0
-
-# file boundaries
-UPDATE_INFO="/^# _file: 'update-info'_/"
-UPDATE_INFO_F="/^# _file: 'update-info.f'_/"
-
-# @F_ADD_SECTION@
-echo 'Item_Num=`expr "$Item_Num" + "1"`
-echo "$1">>"$TMP_SECTIONS"
-if test "$Item_Status"; then
- Item_Status=`echo "${Item_Status}
-X"`
-else
- Item_Status="X"
-fi '>$TMP_F_ADD_SECTION
-
-# @F_INSERT_MISSING@
-echo 'if test -z "$Create_Node"; then
- rm -f ${Info_Node}.old
- cp $Info_Node ${Info_Node}.old
- echo "$BACKUP_MSG"
-fi
-echo "/$MENU_BEGIN/
-+,$ d
-r $TMP_MENU
-w
-q"|ed -s $Info_Node>/dev/null'>$TMP_F_INSERT_MISSING
-
-# @F_DELETE_INVALID@
-echo '
-rm -f ${Info_Node}.old
-cp $Info_Node ${Info_Node}.old
-echo "$BACKUP_MSG"
-echo "/$MENU_BEGIN/
-+,$ d
-w
-q"|ed -s $Info_Node>/dev/null
-sed -f "$TMP_SED" "$TMP_MENU">>"$Info_Node"'>$TMP_F_DELETE_INVALID
-
-cat<<Sed_Script_EOF>$TMP_SED
-s/@UPDATE_INFO_VERSION@/$PROGRAM_VERSION/g
-s/@TEXINFO_VERSION@/$PACKAGE_VERSION/g
-s/@SET_ITEM@/Item_Status=\`echo "\$Item_Status"|sed -e "\${1}s%^.*%\${2}%"\`/
-/@F_ADD_SECTION@/r $TMP_F_ADD_SECTION
-/@F_ADD_SECTION@/d
-/@F_DELETE_INVALID@/r $TMP_F_DELETE_INVALID
-/@F_DELETE_INVALID@/d
-/@F_INSERT_MISSING@/r $TMP_F_INSERT_MISSING
-/@F_INSERT_MISSING@/d
-Sed_Script_EOF
-
-sed -e "1,${UPDATE_INFO}d" -e "$UPDATE_INFO_F,\$d" -f $TMP_SED $0>update-info
-sed -e "1,${UPDATE_INFO_F}d" -f $TMP_SED $0>update-info.f
-chmod +x update-info update-info.f
-echo "installed update-info, and update-info.f into `pwd`"
-rm -f $TMP_FILES
-exit
-
-# _file: 'update-info'_
-#!/bin/sh
-#update-info (GNU texinfo @TEXINFO_VERSION@) @UPDATE_INFO_VERSION@
-#Copyright (C) 1997 Free Software Foundation, Inc.
-#update-info comes with NO WARRANTY, to the extent permitted by law.
-#You may redistribute copies of update-info
-#under the terms of the GNU General Public License.
-#For more information about these matters, see the files named COPYING."
-#Author: Richard L. Hawes
-
-# ###SECTION 1### Constants
-set -h 2>/dev/null
-# ENVIRONMENT
-if test -z "$TMPDIR"; then
- TMPDIR="/usr/tmp"
-fi
-if test -z "$LINES"; then
- LINES=24
-fi
-if test -z "$COLUMNS"; then
- COLUMNS=80
-fi
-if test -z "$EDITOR"; then
- EDITOR=vi
-fi
-if test -z "$LINENO"; then
- LINENO="0"
-fi
-# constants redefined by update-info.f
-PROMPT1="(y=yes, Y=yes to all, n=no, N=No to all):"
-FUNCTIONS=""
-#
-ARGUMENTS="$*"
-DISPLAY_NUM=`expr "$LINES" - 4`
-CONTROL_D="{Ctrl-D}"
-DIR_SECTION="^INFO-DIR-SECTION"
-ENTRY_END="^END-INFO-DIR-ENTRY"
-ENTRY_START="^START-INFO-DIR-ENTRY"
-MENU_BEGIN='^\*\([ ]\)\{1,\}Menu:'
-MENU_ITEM='^\* ([^ ]).*:([ ])+\('
-SECTION_TITLE="^[A-Za-z0-9]"
-MENU_FILTER1='s/^\*\([ ]\)\{1,\}/* /'
-MENU_FILTER2='s/\([ ]\)\{1,\}$//g'
-TMP_ITEM="${TMPDIR}/ui${$}.info"
-TMP_LIST="${TMPDIR}/ul${$}.info"
-TMP_MENU="${TMPDIR}/um${$}.info"
-TMP_SECTIONS="${TMPDIR}/us${$}.info" # used only in Detect_Missing
-TMP_SED="$TMP_SECTIONS" # used only in Detect_Invalid routines
-TMP_FILE1="${TMPDIR}/ux${$}.info"
-TMP_FILE2="${TMPDIR}/uy${$}.info"
-TMP_COUNT="$TMP_FILE2"
-TMP_FILE_LIST="$TMP_LIST $TMP_MENU $TMP_SECTIONS $TMP_FILE1 $TMP_FILE2\
- $TMP_ITEM"
-TRY_HELP_MSG="Try --help for more information"
-if zcat --version 2>/dev/null>/dev/null; then
- CAT_COMMAND="zcat -f"
-else
- echo "$0:$LINENO: GNU zcat not found">&2
- CAT_COMMAND="cat"
-fi
-
-# ###SECTION 100### main program
-#variables set by options
-Create_Node=""
-Debug=":"
-Interactive=""
-Load_Functions="y"
-Mode=""
-#
-Inserts="0"
-Inserts_Total="0"
-Invalid="0"
-Invalid_Total="0"
-Changed=""
-
-while test "$*"
- do
- case "$1" in
- -c) Create_Node="y";;
- -ci|-ic) Create_Node="y"; Interactive="y";;
- -cif|-cfi|-ifc|-icf|-fci|-fic) Create_Node="y"
- Interactive="y"; Load_Functions="";;
- --debug) set -eux; Debug="set>&2";;
- -d|--delete) Mode="Detect_Invalid";;
- -f) Load_Functions="";;
- -i|--interactive) Interactive="y";;
- -fi|-if) Load_Functions=""; Interactive="y";;
- -id|-di) Mode="Detect_Invalid"; Interactive="y";;
- +i|+d|+f);;
- --version)
-cat<<VersionEOF
-update-info (GNU texinfo @TEXINFO_VERSION@) @UPDATE_INFO_VERSION@
-Copyright (C) 1997 Free Software Foundation, Inc.
-update-info comes with NO WARRANTY, to the extent permitted by law.
-You may redistribute copies of update-info
-under the terms of the GNU General Public License.
-For more information about these matters, see the files named COPYING.
-Author: Richard L. Hawes
-VersionEOF
- exit;;
-
- --help)
-cat<<HelpEndOfFile
-Usage: update-info [OPTION]... INFO_PATH/INFO_DIR_FILE
-
-It detects and inserts missing menu items into the info node file.
-
-Options:
--c create a new info node
- --debug print debug information to standard error path
--d, --delete delete invalid menu items (ignore missing menu items)
--f do not load functions (file update-info.f)
- --help print this help message and exit
--i, --interactive interactive mode prompts before inserting or removing
- menu items
- --version print current version and exit
-Backup of the info node has a '.old' suffix added. This is a shell script.
-Files: update-info.f -- contains functions (optional).
-Environment Variables: COLUMNS, EDITOR, LINES, TMPDIR
-Email bug reports to bug-texinfo@gnu.org.
-HelpEndOfFile
- exit;;
-
- [-+]*) echo "$0:$LINENO: \"$1\" is not a valid option">&2
- echo "$TRY_HELP_MSG">&2
- exit 2;;
- *) break;;
- esac
- shift
- done
-
-if test "$#" -lt "1"; then
- echo "$0:$LINENO: Too few parameters">&2
- echo "$TRY_HELP_MSG">&2
- exit 2
-elif test "$#" -gt "1"; then
- echo "$0:$LINENO: Too many parameters">&2
- echo "$TRY_HELP_MSG">&2
- exit 2
-fi
-Info_Path="$1"
-Info_Node=`basename "$Info_Path"`
-if echo "$Info_Node"|grep ".*dir$">/dev/null; then
- :
-else
- echo "$0:$LINENO: $Info_Node is not a valid info node name">&2
- exit 2
-fi
-Info_Pathname=`dirname "$Info_Path"`
-cd "$Info_Pathname"||exit
-
-BACKUP_MSG="Backed up $Info_Node to ${Info_Node}.old."
-HANGUP_MSG="Hang up on \"update-info $ARGUMENTS\""
-INSERT_MSG="menu item(s) were inserted (not counting duplicates)."
-INSERT_MSG2="total menu item(s) were inserted into `pwd`/$Info_Node"
-DELETE_MSG="invalid menu item(s) were removed (not counting duplicates)."
-DELETE_MSG2="total invalid menu item(s) were removed from `pwd`/$Info_Node"
-
-if test "$Create_Node"; then
- if test "$Mode"; then
- echo "$0:$LINENO: ERROR: Illogical option combination: -d -c">&2
- echo "$TRY_HELP_MSG">&2
- exit 2
- fi
- if test -f "$Info_Node"; then
- rm -f ${Info_Node}.old
- mv "$Info_Node" "${Info_Node}.old"
- echo "$BACKUP_MSG"
- fi
- echo "Creating new Info Node: `pwd`/$Info_Node"
-cat>$Info_Node<<NodeEndOfFile||exit
-
-This is the file .../info/dir, which contains the topmost node of the
-Info hierarchy. The first time you invoke Info you start off
-looking at that node, which is (dir)Top.
-
-File: dir Node: Top This is the top of the INFO tree
- This (the Directory node) gives a menu of major topics.
- Typing "d" returns here, "q" exits, "?" lists all INFO commands, "h"
- gives a primer for first-timers, "mTexinfo<Return>" visits Texinfo topic,
- etc.
- Or click mouse button 2 on a menu item or cross reference to select it.
- --- PLEASE ADD DOCUMENTATION TO THIS TREE. (See INFO topic first.) ---
-
-* Menu: The list of major topics begins on the next line.
-
-NodeEndOfFile
-else
- if test ! -f "$Info_Node"; then
- echo "$0:$LINENO: $Info_Node is irregular or nonexistant">&2
- exit 2
- elif test ! -r "$Info_Node"; then
- echo "$0:$LINENO: $Info_Node is not readable">&2
- exit 2
- elif test ! -w "$Info_Node"; then
- echo "$0:$LINENO: $Info_Node is not writeable">&2
- exit 2
- fi
-fi
-
-if test "$Load_Functions" -a "$Interactive" -a -z "$Mode"; then
- if FUNCTIONS_VERSION=`( update-info.f )`; then
- if test `echo "$FUNCTIONS_VERSION"\
- |cut -d' ' -f5` = "@UPDATE_INFO_VERSION@"; then
- echo "Loading functions..."
- . update-info.f
- else
- echo "$0:$LINENO: wrong version of update-info.f">&2
- echo "(functions were not loaded)">&2
- fi
- else
- echo "(functions were not loaded)">&2
- fi
-fi
-
-
-trap ' eval "$Debug"; rm -f $TMP_FILE_LIST; exit ' 0
-if test "$Interactive"; then
- if test ! -t "1"; then
- echo "$0:$LINENO: Cannot run in interactive mode "\
- "standard out is redirected">&2
- exit 2
- fi
- trap ' ' 2 3
-else
- trap ' rm -f $TMP_FILE_LIST
- echo "$0:$LINENO: received INT signal. All edits are canceled.">&2
- exit ' 2
- trap ' rm -f $TMP_FILE_LIST
- echo "$0:$LINENO: received QUIT signal. All edits are canceled.">&2
- exit ' 3
-fi
-if test -z "$Mode"; then
- trap '
- if test "$Changed"; then
- {
- echo $HANGUP_MSG
- @F_INSERT_MISSING@
- Inserts_Total=`wc -c<"$TMP_COUNT"`
- echo $Inserts_Total $INSERT_MSG2
- }|mail "$LOGNAME"
- fi
- rm -f $TMP_FILE_LIST
- exit ' 1
-else
- trap '
- if test "$Changed"; then
- {
- echo $HANGUP_MSG
- @F_DELETE_INVALID@
- Invalid_Total=`wc -l<"$TMP_SED"`
- echo $Invalid_Total $DELETE_MSG2
- }|mail $LOGNAME
- fi
- rm -f $TMP_FILE_LIST
- exit ' 1
-fi
-
-sed -e "1,/$MENU_BEGIN/d" -e "$MENU_FILTER1" -e "$MENU_FILTER2"<$Info_Node\
-|tee $TMP_MENU\
-|sed -n -e '/\* /{
-s/).*$//g
-s/\.gz$//
-s/\.info$//
-s/^.*(//p
-}'|sort -u>$TMP_FILE1
-ls -F|sed -e '/\/$/d' -e '/[-.][0-9]/d'\
- -e '/:$/d' -e '/^$/d' -e "/^${Info_Node}~\$/d"\
- -e "/^${Info_Node}\$/d" -e "/^${Info_Node}.old\$/d"\
- -e 's/\.gz$//' -e 's/\.info$//'|sort>$TMP_FILE2
-
-if test -z "$Mode"; then
- #Detect Missing
- comm -13 $TMP_FILE1 $TMP_FILE2>$TMP_LIST
- cat</dev/null>$TMP_COUNT
- #get sections, initialize variables
- sed -n -e "/$SECTION_TITLE/p" "$TMP_MENU">"$TMP_SECTIONS"
- Item_Num=`wc -l<"$TMP_SECTIONS"|tr -d ' '`
- Item_Status=`echo\
- |awk "BEGIN{for(i=1;i<=${Item_Num};i++)printf(\"_\n\")}"`
- Item_Dir="$Item_Num"
- for Info_Name in `cat $TMP_LIST`
- do
- if test -r "$Info_Name"; then
- Info_File="$Info_Name"
- elif test -r "${Info_Name}.info"; then
- Info_File="${Info_Name}.info"
- elif test -r "${Info_Name}.gz"; then
- Info_File="${Info_Name}.gz"
- elif test -r "${Info_Name}.info.gz"; then
- Info_File="${Info_Name}.info.gz"
- else
- echo "$0:$LINENO: can't find info file for ${Info_Name}?">&2
- fi
- #generate menu item
- echo|tr -d '\012'>$TMP_FILE1
- eval $CAT_COMMAND "$Info_File"\
- |sed -n -e "/$DIR_SECTION/w $TMP_FILE1"\
- -e "/$ENTRY_START/,/$ENTRY_END/{
- $MENU_FILTER1
- p
- }"|awk "BEGIN{Mode=0}
- /^$/{if(Mode==1)exit}
- /^([ ])+([^ ])+/{if(Mode==1)print}
- /^[^ ]/{if(Mode==1)exit}
- /${MENU_ITEM}${Info_Name}\)\./{if(Mode==0){Mode++
- print}
- else
- exit}">"$TMP_ITEM"
- if test ! -s "$TMP_ITEM"; then
- echo "* $Info_Name: ($Info_Name).">"$TMP_ITEM"
- fi
- Item_Status=`echo "$Item_Status"|sed -e '1,$s/^./_/'`
- if test -s "$TMP_FILE1"; then
- Item_Section=`sed -e "s/$DIR_SECTION[ ]*//"\
- <$TMP_FILE1`
- else
- Item_Section=`echo "Miscellaneous"`
- fi
- Size=`echo "$Item_Section"|wc -l|tr -d ' '`
- # initialize variables, check for new sections
- Num1=1
- while test "$Num1" -le "$Size"
- do
- Item=`echo "$Item_Section"|sed -n -e "${Num1}p"`
- if Num=`grep -in "^$Item$" "$TMP_SECTIONS"`; then
- Num=`echo "$Num"|sed -e 's/:.*$//g'`
- ##F#Set_Item
- set "$Num" "X"
- @SET_ITEM@
- else
- set "$Item"
- @F_ADD_SECTION@
- fi
- Num1=`expr "$Num1" + "1"`
- done
- if test "$Interactive"; then
- echo "$Item_Section"
- cat "$TMP_ITEM"
- echo "add menu item for $Info_File? "
- while true
- do
- echo "$PROMPT1"|tr -d '\012'
- read Answer
- case $Answer in
- y) break;;
- e)
- if test "$FUNCTIONS"; then
- Select_Sections
- break
- else
- echo "Can't edit. "\
- "Functions are not loaded.">&2
- fi;;
- Y) Interactive=""; break;;
- n) continue 2;;
- N) break 2;;
- *) echo "\"$Answer\" "\
- "is an invalid response">&2;;
- esac
- done
- fi
- if echo "$Item_Status"|grep '^X'>/dev/null; then
- # edit $TMP_MENU
-
- Changed="y"
- (
- trap ' ' 1 2 3
- Tmp_Var=`echo "$Item_Status"|tr -d '\012'`
- Key=`awk -F':' ' FNR==1{ print $1}' $TMP_ITEM`
- # add new sections to 'dir' file
- if test "$Item_Num" -gt "$Item_Dir"; then
- if test "$Item_Dir" -ne "0"; then
- sed -e "1,${Item_Dir}d" -e 'i\
-
-' "$TMP_SECTIONS">>"$TMP_MENU"
- else
- sed -e 'i\
-
-' "$TMP_SECTIONS">>"$TMP_MENU"
- fi
- fi
- # awk determines the insertion points for each section
- awk -F":" "function Insert(Line){
- if(Mode==2){
- Mode=1;if(substr(\"$Tmp_Var\",Item++,1)==\"X\")
- print Line
- }
- }
- BEGIN{Mode=1;Item=1}
- /$SECTION_TITLE/{Insert(FNR-1);if(Mode>=1)Mode=2}
- /${MENU_ITEM}.*\)\./{if(\$1>Item_Name)Insert(FNR-1)}
- /^$/{Insert(FNR-1)}
- END{Insert(FNR)}" Item_Name="$Key" "$TMP_MENU"\
- |sort -nr|sed -e "s%\$% r $TMP_ITEM%"|sed -e '$a\
-w
-' -e '$a\
-q
-'|ed -s "$TMP_MENU"
- echo "$Item_Status"|tr -cd "X">>$TMP_COUNT
- )
-
- Inserts=`expr "$Inserts" + "1"`
- echo "$Info_File installed into section(s):"\
- |tr -d '\012'
- echo "$Item_Status"|awk '/X/{printf(" %d", FNR)}'
- echo
- Item_Dir="$Item_Num"
- else
- echo "$Info_File not installed (no section selected)"
- fi
- done
- # print summary
- trap ' ' 1 2 3
- if test "$Changed"; then
- @F_INSERT_MISSING@
- Inserts_Total=`wc -c<"$TMP_COUNT"|tr -d " "`
- if test "$Inserts" -ne "$Inserts_Total"; then
- echo "$Inserts $INSERT_MSG"
- fi
- echo "$Inserts_Total $INSERT_MSG2"
- fi
-else
- # Detect Invalid
- cat</dev/null>"$TMP_SED"
- comm -23 $TMP_FILE1 $TMP_FILE2>$TMP_LIST
- for Info_Name in `cat $TMP_LIST`
- do
- if test "$Interactive"; then
- # display invalid menu item(s)
- awk "BEGIN{Mode=1}
- /^([ ])+([^ ])+/{if(Mode==2)print}
- /^$/{if(Mode==2)Mode=1}
- /$SECTION_TITLE/{Section=\$0}
- /^[^ ]/{if(Mode==2)Mode=1}
- /${MENU_ITEM}${Info_Name}\)\./{if(Mode==1){Mode++
- print Section
- print}}" $TMP_MENU
- echo "delete menu item for $Info_Name? "
- while true
- do
- echo\
- "(y=yes, n=no, Y=yes to all, N=No to all):"\
- |tr -d '\012'
- read Answer
- case "$Answer" in
- y) break;;
- Y) Interactive=""; break;;
- n) continue 2;;
- N) break 2;;
- *) echo "\"$Answer\" "\
- "is an invalid reponse">&2;;
- esac
- done
- fi
- # remove menu item from $TMP_MENU
- Invalid=`expr "$Invalid" + "1"`
- Changed="y"
- (
- trap ' ' 1 2 3
- echo\
- "invalid menu item for $Info_Name removed from section(s):"\
- |tr -d '\012'
- awk "function Delete(Last){
- printf(\"%d,%dd\n\",First,Last-1)>>\"$TMP_SED\"}
- BEGIN{Mode=1;Section=0}
- /^$/{if(Mode==2){Delete(FNR);Mode=1}}
- /$SECTION_TITLE/{Section++}
- /^[^ ]/{if(Mode==2){Delete(FNR);Mode=1}}
- /${MENU_ITEM}${Info_Name}\)\./{if(Mode==1){
- First=FNR;printf(\" %d\",Section);Mode=2}}
- END{if(Mode==2)Delete(FNR+1)}" $TMP_MENU
- echo
- )
- done
-
- # display a summary
- trap ' ' 1 2 3
- if test "$Changed"; then
- Invalid_Total=`wc -l<"$TMP_SED"|tr -d ' '`
- @F_DELETE_INVALID@
- if test "$Invalid" -ne "$Invalid_Total"; then
- echo "$Invalid $DELETE_MSG"
- fi
- echo "$Invalid_Total $DELETE_MSG2"
- fi
-fi
-if test -z "$Changed"; then
- echo "Nothing to do"
-fi
-rm -f $TMP_FILE_LIST
-eval "$Debug"
-exit 0
-# _file: 'update-info.f'_
-#update-info.f (GNU texinfo @TEXINFO_VERSION@) @UPDATE_INFO_VERSION@
-#Copyright (C) 1997 Free Software Foundation, Inc.
-#update-info comes with NO WARRANTY, to the extent permitted by law.
-#You may redistribute copies of update-info
-#under the terms of the GNU General Public License.
-#For more information about these matters, see the files named COPYING."
-#Author: Richard L. Hawes
-
-# update-info.f functions for update-info
-
-# ###SECTION 1### functions used to insert missing menu items
-
-Set_Item (){
-# set item status
-@SET_ITEM@
-}
-
-Add_Section (){
-# add a section
-@F_ADD_SECTION@
-}
-
-# ###SECTION 2### functions for menu selection of sections
-
-Print (){
-# print a line without a linefeed
-echo "$*"|tr -d '\012'
-}
-
-Get_Answer (){
-# get an answer to question
-_gs_Valid="$1"
-_gs_Prompt="$2"
-set -f
-Answer=""
-while test -z "$Answer"
- do
- Print "$_gs_Prompt"
- if read Answer; then
- :
- else
- Answer="$CONTROL_D"
- echo
- fi
- if expr "$Answer" : "[$_gs_Valid]$">/dev/null; then
- :
- else
- Print "\"$Answer\" is not a valid response! --">&2
- Answer=""
- fi
- done
-set +f
-}
-
-Do_Previous (){
-# go to previous screen
-if test "$Previous"; then
- Next="$Top_Item"
- Top_Item="$Previous"
- if Previous=`expr "$Top_Item" - "$DISPLAY_NUM"`; then
- if test "$Previous" -le "0"; then
- Previous=""
- fi
- else
- Previous=""
- fi
-elif test "$Next"; then
- Last_Page
-else
- Print "There is no previous page. ">&2
-fi
-}
-
-Do_Next (){
-# process go to next
-if test "$Next"; then
- Previous="$Top_Item"
- Top_Item="$Next"
- Set_Next
-elif test "$Previous"; then
- Top_Item="1"
- Previous=""
- Set_Next
-else
- Print "There is no next page. ">&2
-fi
-}
-
-Do_Add_Section (){
-# process add section command
-echo
-echo "Please enter the name of the new section:"
-if read Answer; then
- Answer=`echo "$Answer"\
- |sed -e 's/^\([ ]\)\{1,\}//g' -e "$MENU_FILTER2"`
- if test "$Answer"; then
- Add_Section "$Answer"
- Last_Page
- clear
- fi
-else
- Answer=""
-fi
-if test -z "$Answer"; then
- clear
- Print "no section added. "
-fi
-}
-
-Do_Edit (){
-# process edit item command
-if test -t "2"; then
- _de_Done=""
- cp "$TMP_ITEM" "$TMP_FILE1"
- while test -z "$_de_Done"
- do
- eval $EDITOR "$TMP_FILE1"
- clear
- _de_Done="t"
- if sed -n -e "$MENU_FILTER1" -e '1p' "$TMP_FILE1"\
- |egrep "${MENU_ITEM}${Info_Name}\)\.">/dev/null; then
- :
- else
- sed -n -e '1p' "$TMP_FILE1"
- echo "Pattern mismatch: `echo\
- "/${MENU_ITEM}${Info_Name}\)\./"\
- |tr -d "\011"`">&2
- echo
- _de_Done=""
- fi
- if sed -n -e '2,$p' "$TMP_FILE1"|grep '^[^ ]'>&2; then
- echo "These lines must have leading spaces">&2
- echo
- _de_Done=""
- fi
- if test -z "$_de_Done"; then
- Get_Answer "yn" "Invalid entry, cancel edits? (y or n):"
- if test "y" = "$Answer"; then
- clear
- Print "Canceling edits -- invalid entry ">&2
- _de_Done="t"
- fi
- else
- sed -e "$MENU_FILTER1" -e "$MENU_FILTER2" -e '/^$/d'\
- <"$TMP_FILE1">"$TMP_ITEM"
- fi
- done
-else
- Print "editor cannot run with error path redirected "
-fi
-}
-
-Do_Number (){
-# process number
-_dn_Num="$1"
-if test "$_dn_Num" -ge 1 -a "$_dn_Num" -le "$Item_Num"; then
- if test `echo "$Item_Status"|sed -n -e "${_dn_Num}p"` = "_"; then
- Set_Item "$_dn_Num" "X"
- else
- Set_Item "$_dn_Num" "_"
- fi
-else
- Print "\"$_dn_Num\" is an invalid section number. ">&2
-fi
-}
-
-Do_Help (){
-# process menu help
-echo
-echo "\
-Enter the following commands seperated
-by spaces and terminated by<ENTER>:
-# : (section number) toggle section
-a : add a new section
-e : edit item -- changes will not be
- accepted if you change the
- '(info_file_name).' or delete
- the key parts: '*' 'Menu Name' ':'
-h : get this help screen
-n : next page
-p : previous page
-q : quit and do not put into menu
-s : save and put into menu"
-Print "Press enter to continue:"
-read junk
-clear
-}
-
-Set_Next (){
-# determine value of Next
-Next=`expr "$DISPLAY_NUM" + "$Top_Item"`
-if test "$Next" -gt "$Item_Num"; then
- Next=""
-fi
-}
-
-Last_Page (){
-# go to last page of menu
-Top_Item=`echo|awk "BEGIN{printf(\"%d\",
-int((${Item_Num}-1)/${DISPLAY_NUM})*${DISPLAY_NUM}+1)}"`
-if test "$Top_Item" -gt "$DISPLAY_NUM"; then
- Previous=`expr "$Top_Item" '-' "$DISPLAY_NUM"`
-else
- Previous=""
-fi
-Set_Next
-}
-
-Select_Sections (){
-# prompt user for which sections
-set -f
-Top_Item="1"
-Previous=""
-Set_Next
-clear
-echo "Default sections are selected."
-Done=""
-while test -z "$Done"
- do
- awk "FNR==1{printf(\"%s\n\", substr(\$0,1,${COLUMNS}))}" $TMP_ITEM
- Tmp_Var=`echo "$Item_Status"|tr -d '\012'`
- awk "BEGIN{Max=$Top_Item+$DISPLAY_NUM}
- FNR>=$Top_Item{if(FNR>=Max)exit
- printf(\"%2d:%s %s\n\",FNR,substr(\"$Tmp_Var\",FNR,1),
- substr(\$0,1,${COLUMNS}-5))}" "$TMP_SECTIONS"
- echo "Enter 1-${Item_Num}, add, edit, help,"
- if test "$Previous" -o "$Next"; then
- Print "next, previous, "
- fi
- Print "quit, save :"
- read Command_List||Command_List="$CONTROL_D"
- Command_List=`echo "$Command_List"\
- |tr '\011' ' '|tr ' ' '\012'|sed -e "/^$/d"`
- clear
- if test -z "$Command_List"; then
- Help="y"
- else
- Help=""
- fi
- while test "$Command_List"
- do
- Command=`echo "$Command_List"|sed -n -e '1p'`
- Command_List=`echo "$Command_List"|sed -e '1d'`
- case "$Command" in
- [0-9]|[0-9][0-9]) Do_Number "$Command";;
- n*) Do_Next;;
- p*) Do_Previous;;
- a*) Do_Add_Section;;
- e*) Do_Edit; break;;
- h*) Help="y";;
- s*) Done="s"; break;;
- q*) Done="q"
- Item_Status=`echo "$Item_Status"|sed -e '1,$s/^./_/'`
- break;;
- *) Print "$Command is not a valid command. ">&2
- Help="y";;
- esac
- done
- if test "$Help"; then
- Do_Help
- fi
- echo
- done
-set +f
-# if new sections added, remove unused ones
-if test "$Item_Num" -gt "$Item_Dir"; then
- Tmp_Var=`echo "$Item_Status"|awk "FNR>$Item_Dir{
- if(\\$0==\"_\")printf(\"%d\n\", FNR)}"`
- if test "$Tmp_Var"; then
- Tmp_Var1=`echo "$Tmp_Var"|sed -e 's/$/d/'`
- sed -e "$Tmp_Var1" "$TMP_SECTIONS">$TMP_FILE1
- cp $TMP_FILE1 "$TMP_SECTIONS"
- Item_Status=`echo "$Item_Status"|sed -e "$Tmp_Var1"`
- Tmp_Var=""
- Tmp_Var1=""
- Item_Num=`wc -l<"$TMP_SECTIONS"|tr -d ' '`
- fi
-fi
-}
-
-# ###SECTION 100### Constants that redefine
-PROMPT1="(y=yes, e=edit, Y=yes to all, n=no, N=No to all):"
-FUNCTIONS="y"
-#
-echo "update-info.f (GNU texinfo @TEXINFO_VERSION@) @UPDATE_INFO_VERSION@"