summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/texinfo/util
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2002-06-10 13:51:05 +0000
committerMarc Espie <espie@cvs.openbsd.org>2002-06-10 13:51:05 +0000
commite1bc7714b7945713f4c443c444b4abf17b1d7877 (patch)
treee7485506af2dcb5e2e4d5f71f01a3a652049aafc /gnu/usr.bin/texinfo/util
parent0766fc34a2525ed5b1d084ea33b198382d10e7d5 (diff)
brain-dead cvs conflict merge
Diffstat (limited to 'gnu/usr.bin/texinfo/util')
-rw-r--r--gnu/usr.bin/texinfo/util/Makefile.am24
-rw-r--r--gnu/usr.bin/texinfo/util/Makefile.in417
-rw-r--r--gnu/usr.bin/texinfo/util/install-info.c38
-rw-r--r--gnu/usr.bin/texinfo/util/mkinstalldirs40
-rw-r--r--gnu/usr.bin/texinfo/util/texi2dvi111
-rw-r--r--gnu/usr.bin/texinfo/util/texindex.c16
-rw-r--r--gnu/usr.bin/texinfo/util/update-info875
7 files changed, 1271 insertions, 250 deletions
diff --git a/gnu/usr.bin/texinfo/util/Makefile.am b/gnu/usr.bin/texinfo/util/Makefile.am
index 90003d13bcd..300e95aa658 100644
--- a/gnu/usr.bin/texinfo/util/Makefile.am
+++ b/gnu/usr.bin/texinfo/util/Makefile.am
@@ -1,15 +1,23 @@
-## Makefile.am for texinfo/util.
-## $Id: Makefile.am,v 1.3 2000/02/09 02:18:42 espie Exp $
-## Run automake in .. to produce Makefile.in from this.
+# $Id: Makefile.am,v 1.4 2002/06/10 13:51:04 espie Exp $
+# Makefile.am for texinfo/util.
+# Run automake in .. to produce Makefile.in from this.
+#
+# This file is free software; as a special exception the author 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.
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@
+LDADD = ../lib/libtxi.a @LIBINTL@
-# Most of these are just for fun. The only one that's really supported
-# is texi2dvi.
-EXTRA_DIST = README deref.c fix-info-dir fixfonts fixref.gawk gen-dir-node \
- outline.gawk prepinfo.awk tex3patch texi-docstring-magic.el texi2dvi
+# Most of these are for fun. The only one that's really supported is texi2dvi.
+EXTRA_DIST = README deref.c fix-info-dir fixfonts \
+ fixref.gawk gen-dir-node install-info-html outline.gawk prepinfo.awk \
+ tex3patch texi-docstring-magic.el texi2dvi
diff --git a/gnu/usr.bin/texinfo/util/Makefile.in b/gnu/usr.bin/texinfo/util/Makefile.in
index df98ddc3178..164def0051a 100644
--- a/gnu/usr.bin/texinfo/util/Makefile.in
+++ b/gnu/usr.bin/texinfo/util/Makefile.in
@@ -1,6 +1,8 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated by automake 1.6 from Makefile.am.
+# @configure_input@
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# 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.
@@ -10,7 +12,19 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-
+@SET_MAKE@
+
+# $Id: Makefile.in,v 1.3 2002/06/10 13:51:04 espie Exp $
+# Makefile.am for texinfo/util.
+# Run automake in .. to produce Makefile.in from this.
+#
+# This file is free software; as a special exception the author 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 = @SHELL@
srcdir = @srcdir@
@@ -31,13 +45,9 @@ infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
-
-DESTDIR?=
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-
top_builddir = ..
ACLOCAL = @ACLOCAL@
@@ -45,292 +55,339 @@ AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
-
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-CATALOGS = @CATALOGS@
+host_alias = @host_alias@
+host_triplet = @host@
+
+EXEEXT = @EXEEXT@
+OBJEXT = @OBJEXT@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+AMTAR = @AMTAR@
+AWK = @AWK@
+BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
DATADIRNAME = @DATADIRNAME@
+DEPDIR = @DEPDIR@
GENCAT = @GENCAT@
-GMOFILES = @GMOFILES@
+GLIBC21 = @GLIBC21@
GMSGFMT = @GMSGFMT@
-GT_NO = @GT_NO@
-GT_YES = @GT_YES@
-INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
+HAVE_LIB = @HAVE_LIB@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTOBJEXT = @INSTOBJEXT@
-INTLDEPS = @INTLDEPS@
+INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
-MAKEINFO = @MAKEINFO@
+INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
+LIB = @LIB@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LTLIB = @LTLIB@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@
-POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
+STRIP = @STRIP@
TERMLIBS = @TERMLIBS@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
-l = @l@
+am__include = @am__include@
+am__quote = @am__quote@
+install_sh = @install_sh@
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@
+LDADD = ../lib/libtxi.a @LIBINTL@
-# Most of these are just for fun. The only one that's really supported
-# is texi2dvi.
-EXTRA_DIST = README deref.c fix-info-dir fixfonts fixref.gawk gen-dir-node outline.gawk prepinfo.awk tex3patch texi-docstring-magic.el texi2dvi
+# Most of these are for fun. The only one that's really supported is texi2dvi.
+EXTRA_DIST = README deref.c fix-info-dir fixfonts \
+ fixref.gawk gen-dir-node install-info-html outline.gawk prepinfo.awk \
+ tex3patch texi-docstring-magic.el texi2dvi
+subdir = util
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-PROGRAMS = $(bin_PROGRAMS)
-
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+bin_PROGRAMS = install-info$(EXEEXT) texindex$(EXEEXT)
+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_OBJECTS = install-info.$(OBJEXT)
install_info_LDADD = $(LDADD)
-install_info_DEPENDENCIES = ../lib/libtxi.a
-install_info_LDFLAGS =
+install_info_DEPENDENCIES = ../lib/libtxi.a
+install_info_LDFLAGS =
texindex_SOURCES = texindex.c
-texindex_OBJECTS = texindex.o
+texindex_OBJECTS = texindex.$(OBJEXT)
texindex_LDADD = $(LDADD)
-texindex_DEPENDENCIES = ../lib/libtxi.a
-texindex_LDFLAGS =
-SCRIPTS = $(bin_SCRIPTS)
-
-CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-DIST_COMMON = README Makefile.am Makefile.in
-
+texindex_DEPENDENCIES = ../lib/libtxi.a
+texindex_LDFLAGS =
+SCRIPTS = $(bin_SCRIPTS)
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
-GZIP_ENV = --best
+DEFS = @DEFS@
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/install-info.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/texindex.Po
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+CFLAGS = @CFLAGS@
+DIST_SOURCES = install-info.c texindex.c
+DIST_COMMON = README Makefile.am Makefile.in
SOURCES = install-info.c texindex.c
-OBJECTS = install-info.o texindex.o
-
-all: all-redirect
-.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:
+all: all-am
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu util/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
- if test -f $$p; then \
- echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
- $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ ; then \
+ p1=`echo "$$p1" | sed -e 's,^.*/,,'`; \
+ f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
+ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
- list='$(bin_PROGRAMS)'; for p in $$list; do \
- rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ f=`echo "$$f" | sed -e 's,^.*/,,'`; \
+ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
+ rm -f $(DESTDIR)$(bindir)/$$f; \
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
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+install-info$(EXEEXT): $(install_info_OBJECTS) $(install_info_DEPENDENCIES)
+ @rm -f install-info$(EXEEXT)
$(LINK) $(install_info_LDFLAGS) $(install_info_OBJECTS) $(install_info_LDADD) $(LIBS)
-
-texindex: $(texindex_OBJECTS) $(texindex_DEPENDENCIES)
- @rm -f texindex
+texindex$(EXEEXT): $(texindex_OBJECTS) $(texindex_DEPENDENCIES)
+ @rm -f texindex$(EXEEXT)
$(LINK) $(texindex_LDFLAGS) $(texindex_OBJECTS) $(texindex_LDADD) $(LIBS)
-
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_SCRIPTS)'; for p in $$list; do \
+ f="`echo $$p|sed '$(transform)'`"; \
if test -f $$p; then \
- echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
- $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
- else if test -f $(srcdir)/$$p; then \
- echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
- $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
- else :; fi; fi; \
+ echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/$$f"; \
+ $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/$$f; \
+ elif test -f $(srcdir)/$$p; then \
+ echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/$$f"; \
+ $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/$$f; \
+ else :; fi; \
done
uninstall-binSCRIPTS:
@$(NORMAL_UNINSTALL)
- list='$(bin_SCRIPTS)'; for p in $$list; do \
- rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
+ @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ f="`echo $$p|sed '$(transform)'`"; \
+ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
+ rm -f $(DESTDIR)$(bindir)/$$f; \
done
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT) core *.core
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/install-info.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texindex.Po@am__quote@
+
+distclean-depend:
+ -rm -rf ./$(DEPDIR)
+
+.c.o:
+@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$<
+
+.c.obj:
+@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ $(COMPILE) -c `cygpath -w $<`
+CCDEPMODE = @CCDEPMODE@
+install-info-am:
+uninstall-info-am:
+
+ETAGS = etags
+ETAGSFLAGS =
+
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -fID $$unique
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ 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:
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
-clean-tags:
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
- -rm -f TAGS ID
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-maintainer-clean-tags:
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = util
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
- d=$(srcdir); \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir)$$dir \
+ || exit 1; \
else \
test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
fi; \
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-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
check-am: all-am
check: check-am
-installcheck-am:
-installcheck: installcheck-am
-install-exec-am: install-binPROGRAMS install-binSCRIPTS
-install-exec: install-exec-am
+all-am: Makefile $(PROGRAMS) $(SCRIPTS)
-install-data-am:
-install-data: install-data-am
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir)
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
-uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS
+install-exec: install-exec-am
+install-data: install-data-am
uninstall: uninstall-am
-all-am: Makefile $(PROGRAMS) $(SCRIPTS)
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir)
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
maintainer-clean-generic:
-mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
- mostlyclean-tags mostlyclean-generic
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
-mostlyclean: mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
-clean-am: clean-binPROGRAMS clean-compile clean-tags clean-generic \
- mostlyclean-am
+distclean: distclean-am
-clean: clean-am
+distclean-am: clean-am distclean-compile distclean-depend \
+ distclean-generic distclean-tags
-distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \
- distclean-generic clean-am
+dvi: dvi-am
-distclean: distclean-am
+dvi-am:
-maintainer-clean-am: maintainer-clean-binPROGRAMS \
- maintainer-clean-compile maintainer-clean-tags \
- maintainer-clean-generic distclean-am
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS install-binSCRIPTS
+
+install-man:
+
+installcheck-am:
maintainer-clean: maintainer-clean-am
-.PHONY: 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-am info dvi-am dvi check check-am installcheck-am \
-installcheck install-exec-am install-exec install-data-am install-data \
-install-am install uninstall-am uninstall all-redirect all-am all \
-installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
+ uninstall-info-am
+
+.PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic distclean distclean-compile distclean-depend \
+ distclean-generic distclean-tags distdir dvi dvi-am info \
+ info-am install install-am install-binPROGRAMS \
+ install-binSCRIPTS install-data install-data-am install-exec \
+ install-exec-am install-info-am install-man install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic tags uninstall uninstall-am \
+ uninstall-binPROGRAMS uninstall-binSCRIPTS uninstall-info-am
# 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/gnu/usr.bin/texinfo/util/install-info.c b/gnu/usr.bin/texinfo/util/install-info.c
index 915784bcf3f..b3b667c9f31 100644
--- a/gnu/usr.bin/texinfo/util/install-info.c
+++ b/gnu/usr.bin/texinfo/util/install-info.c
@@ -1,7 +1,7 @@
/* install-info -- create Info directory entry(ies) for an Info file.
- $Id: install-info.c,v 1.6 2000/02/09 02:18:42 espie Exp $
+ $Id: install-info.c,v 1.7 2002/06/10 13:51:04 espie Exp $
- Copyright (C) 1996, 97, 98, 99 Free Software Foundation, Inc.
+ Copyright (C) 1996, 97, 98, 99, 2000, 01, 02 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
@@ -173,7 +173,7 @@ xmalloc (size)
extern void *malloc ();
void *result = malloc (size);
if (result == NULL)
- fatal (_("virtual memory exhausted"), 0);
+ fatal (_("virtual memory exhausted"), 0, 0);
return result;
}
@@ -186,7 +186,7 @@ xrealloc (obj, size)
extern void *realloc ();
void *result = realloc (obj, size);
if (result == NULL)
- fatal (_("virtual memory exhausted"), 0);
+ fatal (_("virtual memory exhausted"), 0, 0);
return result;
}
@@ -230,7 +230,7 @@ pfatal_with_name (name)
char *name;
{
char *s = concat ("", strerror (errno), _(" for %s"));
- fatal (s, name);
+ fatal (s, name, 0);
}
/* Given the full text of a menu entry, null terminated,
@@ -416,10 +416,12 @@ Options:\n\
If you don't specify any sections, they are determined\n\
from information in the Info file itself.\n\
--version display version information and exit.\n\
-\n\
+"), progname);
+
+ puts (_("\n\
Email bug reports to bug-texinfo@gnu.org,\n\
general questions and discussion to help-texinfo@gnu.org.\n\
-"), progname);
+Texinfo home page: http://www.gnu.org/software/texinfo/"));
}
@@ -546,7 +548,7 @@ open_possibly_compressed_file (filename, create_callback,
/* Empty files don't set errno, so we get something like
"install-info: No error for foo", which is confusing. */
if (nread == 0)
- fatal (_("%s: empty file"), *opened_filename);
+ fatal (_("%s: empty file"), *opened_filename, 0);
pfatal_with_name (*opened_filename);
}
@@ -861,7 +863,7 @@ parse_input (lines, nlines, sections, entries)
reset_tail = 1;
if (start_of_this_entry != 0)
- fatal (_("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"));
+ fatal (_("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"), 0, 0);
start_of_this_entry = lines[i + 1].start;
}
else if (start_of_this_entry)
@@ -896,12 +898,13 @@ parse_input (lines, nlines, sections, entries)
else if (!strncmp ("END-INFO-DIR-ENTRY",
lines[i].start, lines[i].size)
&& sizeof ("END-INFO-DIR-ENTRY") - 1 == lines[i].size)
- fatal (_("END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY"));
+ fatal (_("END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY"), 0, 0);
}
}
}
if (start_of_this_entry != 0)
- fatal (_("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"));
+ fatal (_("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"),
+ 0, 0);
/* If we ignored the INFO-DIR-ENTRY directives, we need now go back
and plug the names of all the sections we found into every
@@ -1222,7 +1225,7 @@ main (argc, argv)
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
For more information about these matters, see the files named COPYING.\n"),
- "1999");
+ "2002");
xexit (0);
default:
@@ -1238,13 +1241,14 @@ For more information about these matters, see the files named COPYING.\n"),
else if (dirfile == 0)
dirfile = argv[optind];
else
- error (_("excess command line argument `%s'"), argv[optind]);
+ error (_("excess command line argument `%s'"), argv[optind], 0);
}
if (!infile)
- fatal (_("No input file specified; try --help for more information."));
+ fatal (_("No input file specified; try --help for more information."),
+ 0, 0);
if (!dirfile)
- fatal (_("No dir file specified; try --help for more information."));
+ fatal (_("No dir file specified; try --help for more information."), 0, 0);
/* Read the Info file and parse it into lines, unless we're deleting. */
if (!delete_flag)
@@ -1266,7 +1270,7 @@ For more information about these matters, see the files named COPYING.\n"),
something an installer should have to correct (it's a
problem for the maintainer), and there's no need to cause
subsequent parts of `make install' to fail. */
- warning (_("no info dir entry in `%s'"), infile);
+ warning (_("no info dir entry in `%s'"), infile, 0);
xexit (0);
}
@@ -1404,7 +1408,7 @@ For more information about these matters, see the files named COPYING.\n"),
}
if (delete_flag && !something_deleted && !quiet_flag)
- warning (_("no entries found for `%s'; nothing deleted"), infile);
+ warning (_("no entries found for `%s'; nothing deleted"), infile, 0);
output_dirfile (opened_dirfilename, dir_nlines, dir_lines, n_entries_to_add,
entries_to_add, input_sections, compression_program);
diff --git a/gnu/usr.bin/texinfo/util/mkinstalldirs b/gnu/usr.bin/texinfo/util/mkinstalldirs
new file mode 100644
index 00000000000..58b613d6d82
--- /dev/null
+++ b/gnu/usr.bin/texinfo/util/mkinstalldirs
@@ -0,0 +1,40 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+# $Id: mkinstalldirs,v 1.3 2002/06/10 13:51:04 espie 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/gnu/usr.bin/texinfo/util/texi2dvi b/gnu/usr.bin/texinfo/util/texi2dvi
index bd6387b499a..fe5f7c345b1 100644
--- a/gnu/usr.bin/texinfo/util/texi2dvi
+++ b/gnu/usr.bin/texinfo/util/texi2dvi
@@ -1,8 +1,9 @@
#! /bin/sh
# texi2dvi --- produce DVI (or PDF) files from Texinfo (or LaTeX) sources.
-# $Id: texi2dvi,v 1.3 2000/02/09 02:18:42 espie Exp $
+# $Id: texi2dvi,v 1.4 2002/06/10 13:51:04 espie Exp $
#
-# Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
+# Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2001, 02
+# 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
@@ -26,12 +27,12 @@
# the `--debug' option when making a bug report.
# This string is expanded by rcs automatically when this file is checked out.
-rcs_revision='$Revision: 1.3 $'
+rcs_revision='$Revision: 1.4 $'
rcs_version=`set - $rcs_revision; echo $2`
program=`echo $0 | sed -e 's!.*/!!'`
-version="texi2dvi (GNU Texinfo 4.0) $rcs_version
+version="texi2dvi (GNU Texinfo 4.2) $rcs_version
-Copyright (C) 1999 Free Software Foundation, Inc.
+Copyright (C) 2002 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."
@@ -46,46 +47,52 @@ is used to determine its language (LaTeX or Texinfo).
Makeinfo is used to perform Texinfo macro expansion before running TeX
when needed.
-Options:
- -@ Use @input instead of \input; for preloaded Texinfo.
- -b, --batch No interaction.
- -c, --clean Remove all auxiliary files.
- -D, --debug Turn on shell debugging (set -x).
- -e, --expand Force macro expansion using makeinfo.
- -I DIR Search DIR for Texinfo files.
- -h, --help Display this help and exit successfully.
- -l, --language=LANG Specify the LANG of FILE: LaTeX or Texinfo.
- -p, --pdf Use pdftex or pdflatex for processing.
- -q, --quiet No output unless errors (implies --batch).
- -s, --silent Same as --quiet.
- -t, --texinfo=CMD Insert CMD after @setfilename in copy of input file.
- Multiple values accumulate.
- -v, --version Display version information and exit successfully.
- -V, --verbose Report on what is done.
+Operation modes:
+ -b, --batch no interaction
+ -c, --clean remove all auxiliary files
+ -D, --debug turn on shell debugging (set -x)
+ -h, --help display this help and exit successfully
+ -o, --output=OFILE leave output in OFILE (implies --clean);
+ Only one input FILE may be specified in this case
+ -q, --quiet no output unless errors (implies --batch)
+ -s, --silent same as --quiet
+ -v, --version display version information and exit successfully
+ -V, --verbose report on what is done
+
+TeX tuning:
+ -@ use @input instead of \input; for preloaded Texinfo
+ -e, --expand force macro expansion using makeinfo
+ -I DIR search DIR for Texinfo files
+ -l, --language=LANG specify the LANG of FILE (LaTeX or Texinfo)
+ -p, --pdf use pdftex or pdflatex for processing
+ -t, --texinfo=CMD insert CMD after @setfilename in copy of input file
+ multiple values accumulate
The values of the BIBTEX, LATEX (or PDFLATEX), MAKEINDEX, MAKEINFO,
TEX (or PDFTEX), and TEXINDEX environment variables are used to run
those commands, if they are set.
Email bug reports to <bug-texinfo@gnu.org>,
-general questions and discussion to <help-texinfo@gnu.org>."
+general questions and discussion to <help-texinfo@gnu.org>.
+Texinfo home page: http://www.gnu.org/software/texinfo/"
# Initialize variables for option overriding and otherwise.
# Don't use `unset' since old bourne shells don't have this command.
# Instead, assign them an empty value.
-escape='\'
batch=false # eval for batch mode
clean=
debug=
+escape='\'
expand= # t for expansion via makeinfo
+miincludes= # makeinfo include path
oformat=dvi
+oname= # --output
+quiet= # by default let the tools' message be displayed
set_language=
-miincludes= # makeinfo include path
textra=
tmpdir=${TMPDIR:-/tmp}/t2d$$ # avoid collisions on 8.3 filesystems.
txincludes= # TEXINPUTS extensions
txiprereq=19990129 # minimum texinfo.tex version to have macro expansion
-quiet= # by default let the tools' message be displayed
verbose=false # echo for verbose mode
orig_pwd=`pwd`
@@ -144,6 +151,13 @@ while test x"$1" != x"$arg_sep"; do
txincludes="$txincludes$path_sep$1"
;;
-l | --l*) shift; set_language=$1;;
+ -o | --o*)
+ shift
+ clean=t
+ case "$1" in
+ /* | ?:/*) oname=$1;;
+ *) oname="$orig_pwd/$1";;
+ esac;;
-p | --p*) oformat=pdf;;
-t | --t*) shift; textra="$textra\\
$1";;
@@ -168,11 +182,20 @@ done
shift
# Interpret remaining command line args as filenames.
-if test $# = 0; then
+case $# in
+ 0)
echo "$0: Missing file arguments." >&2
echo "$0: Try \`--help' for more information." >&2
exit 2
-fi
+ ;;
+ 1) ;;
+ *)
+ if test -n "$oname"; then
+ echo "$0: Can't use option \`--output' with more than one argument." >&2
+ exit 2
+ fi
+ ;;
+esac
# Prepare the temporary directory. Remove it at exit, unless debugging.
if test -z "$debug"; then
@@ -205,14 +228,23 @@ cat <<EOF >$comment_iftex_sed
s/^@c texi2dvi//
}
}
-/^@html/,/^@end html/d
-/^@ifhtml/,/^@end ifhtml/d
-/^@ifnottex/,/^@end ifnottex/d
+/^@html/,/^@end html/{
+ s/^/@c (texi2dvi)/
+}
+/^@ifhtml/,/^@end ifhtml/{
+ s/^/@c (texi2dvi)/
+}
+/^@ifnottex/,/^@end ifnottex/{
+ s/^/@c (texi2dvi)/
+}
/^@ifinfo/,/^@end ifinfo/{
/^@node/p
/^@menu/,/^@end menu/p
- d
+ t
+ s/^/@c (texi2dvi)/
}
+s/^@ifnotinfo/@c texi2dvi@ifnotinfo/
+s/^@end ifnotinfo/@c texi2dvi@end ifnotinfo/
EOF
# Uncommenting is simple: Remove any leading `@c texi2dvi'.
uncomment_iftex_sed=$utildir/uncomment.sed
@@ -373,9 +405,9 @@ for command_line_filename in ${1+"$@"}; do
txiversion_tex=txiversion.tex
echo '\input texinfo.tex @bye' >$tmpdir/$txiversion_tex
# Run in the tmpdir to avoid leaving files.
- eval `cd $tmpdir >/dev/null \
- && $tex $txiversion_tex 2>/dev/null \
-| sed -n 's/^.*\[\(.*\)version \(....\)-\(..\)-\(..\).*$/txiformat=\1 txiversion="\2\3\4"/p'`
+ eval `cd $tmpdir >/dev/null &&
+ $tex $txiversion_tex 2>/dev/null |
+ sed -n 's/^.*\[\(.*\)version \(....\)-\(..\)-\(..\).*$/txiformat=\1 txiversion="\2\3\4"/p'`
$verbose "texinfo.tex preloaded as \`$txiformat', version is \`$txiversion' ..."
if test "$txiprereq" -le "$txiversion" >/dev/null 2>&1; then
makeinfo=
@@ -489,8 +521,8 @@ for command_line_filename in ${1+"$@"}; do
# Prevent $ESCAPE from being interpreted by the shell if it happens
# to be `/'.
$batch tex_args="\\${escape}nonstopmode\ \\${escape}input"
- $verbose "Running $cmd ..."
cmd="$tex $tex_args $filename_input"
+ $verbose "Running $cmd ..."
if $cmd >&5; then :; else
echo "$0: $tex exited with bad status, quitting." >&2
echo "$0: see $filename_noext.log for errors." >&2
@@ -550,8 +582,13 @@ for command_line_filename in ${1+"$@"}; do
# - the next file is processed in correct conditions
# - the temporary file can be removed
if test -n "$clean"; then
- $verbose "Copying $oformat file from `pwd` to $orig_pwd"
- cp -p "./$filename_noext.$oformat" "$orig_pwd"
+ if test -n "$oname"; then
+ dest=$oname
+ else
+ dest=$orig_pwd
+ fi
+ $verbose "Copying $oformat file from `pwd` to $dest"
+ cp -p "./$filename_noext.$oformat" "$dest"
cd / # in case $orig_pwd is on a different drive (for DOS)
cd $orig_pwd || exit 1
fi
diff --git a/gnu/usr.bin/texinfo/util/texindex.c b/gnu/usr.bin/texinfo/util/texindex.c
index 6eacd60120a..d520fa3a1b4 100644
--- a/gnu/usr.bin/texinfo/util/texindex.c
+++ b/gnu/usr.bin/texinfo/util/texindex.c
@@ -1,7 +1,8 @@
/* Process TeX index dribble output into an actual index.
- $Id: texindex.c,v 1.3 2000/02/09 02:18:43 espie Exp $
+ $Id: texindex.c,v 1.4 2002/06/10 13:51:04 espie Exp $
- Copyright (C) 1987, 91, 92, 96, 97, 98, 99 Free Software Foundation, Inc.
+ Copyright (C) 1987, 91, 92, 96, 97, 98, 99, 2000, 01, 02
+ 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
@@ -288,7 +289,8 @@ _("Usually FILE... is specified as `foo.%c%c\' for a document `foo.texi'.\n"),
fputs (_("\n\
Email bug reports to bug-texinfo@gnu.org,\n\
general questions and discussion to help-texinfo@gnu.org.\n\
-"), f);
+Texinfo home page: http://www.gnu.org/software/texinfo/"), f);
+ fputs ("\n", f);
xexit (result_value);
}
@@ -340,7 +342,7 @@ decode_command (argc, argv)
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
For more information about these matters, see the files named COPYING.\n"),
- "1999");
+ "2002");
xexit (0);
}
else if ((strcmp (arg, "--keep") == 0) ||
@@ -393,8 +395,8 @@ maketempname (count)
int fd;
sprintf (tempsuffix, ".%d", count);
- name = concat (tempdir, tempbase, tempsuffix);
-
+ name = concat (tempdir, tempbase, tempsuffix);
+
fd = open (name, O_CREAT|O_EXCL|O_WRONLY, 0666);
if (fd == -1)
return NULL;
@@ -958,8 +960,6 @@ fail:
for (i = 0; i < ntemps; i++)
{
char *newtemp = maketempname (++tempcount);
- if (!newtemp)
- pfatal_with_name("temp file");
sort_in_core (&tempfiles[i], MAX_IN_CORE_SORT, newtemp);
if (!keep_tempfiles)
unlink (tempfiles[i]);
diff --git a/gnu/usr.bin/texinfo/util/update-info b/gnu/usr.bin/texinfo/util/update-info
new file mode 100644
index 00000000000..0d31fde4d27
--- /dev/null
+++ b/gnu/usr.bin/texinfo/util/update-info
@@ -0,0 +1,875 @@
+#!/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@"