aboutsummaryrefslogtreecommitdiff
path: root/texinfo/util
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1998-03-24 12:41:43 -0700
committerJeff Law <law@gcc.gnu.org>1998-03-24 12:41:43 -0700
commitd275726b338f876c210555d7eadf8c3d81bae6a5 (patch)
tree136f1d20658da254fd386793ce216800b7356521 /texinfo/util
parentf35e74f9a615e8b93da23af446667ee0bbfad0d0 (diff)
downloadgcc-d275726b338f876c210555d7eadf8c3d81bae6a5.zip
gcc-d275726b338f876c210555d7eadf8c3d81bae6a5.tar.gz
gcc-d275726b338f876c210555d7eadf8c3d81bae6a5.tar.bz2
Merge in texinfo-3.12.
From-SVN: r18811
Diffstat (limited to 'texinfo/util')
-rw-r--r--texinfo/util/Makefile.am14
-rw-r--r--texinfo/util/Makefile.in180
-rw-r--r--texinfo/util/README3
-rw-r--r--texinfo/util/install-info.c92
-rwxr-xr-xtexinfo/util/texi2dvi159
-rw-r--r--texinfo/util/texindex.c27
-rwxr-xr-xtexinfo/util/update-info2
7 files changed, 268 insertions, 209 deletions
diff --git a/texinfo/util/Makefile.am b/texinfo/util/Makefile.am
index 6690cc1..de4d0db 100644
--- a/texinfo/util/Makefile.am
+++ b/texinfo/util/Makefile.am
@@ -1,23 +1,13 @@
## Makefile.am for texinfo/util.
-## $Id: Makefile.am,v 1.2 1998/03/24 18:08:38 law Exp $
+## $Id: Makefile.am,v 1.3 1998/03/24 19:41:36 law Exp $
## Run automake in .. to produce Makefile.in from this.
-bin_PROGRAMS = texindex
+bin_PROGRAMS = install-info texindex
bin_SCRIPTS = texi2dvi
-## CYGNUS LOCAL: Build install-inf locally, and install it as
-## install-info, to avoid confusing with the install-info target
-## generated by automake --cygnus.
-noinst_PROGRAMS = install-inf
-install_inf_SOURCES = install-info.c
-
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
-
-install-exec-local: $(noinst_PROGRAMS)
- $(mkinstalldirs) $(bindir)
- $(INSTALL_PROGRAM) install-inf$(EXEEXT) $(bindir)/`echo install-info$(EXEEXT)|sed '$(transform)'`; \
diff --git a/texinfo/util/Makefile.in b/texinfo/util/Makefile.in
index a848e61..7b04741 100644
--- a/texinfo/util/Makefile.in
+++ b/texinfo/util/Makefile.in
@@ -1,8 +1,15 @@
-# Makefile.in generated automatically by automake 1.2 from Makefile.am
+# Makefile.in generated automatically by automake 1.2f from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+# 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, distribute and modify it.
+# 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
@@ -42,27 +49,26 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
-NORMAL_INSTALL = true
-PRE_INSTALL = true
-POST_INSTALL = true
-NORMAL_UNINSTALL = true
-PRE_UNINSTALL = true
-POST_UNINSTALL = true
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
DATADIRNAME = @DATADIRNAME@
-EXEEXT = @EXEEXT@
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@
-MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
@@ -78,12 +84,9 @@ USE_NLS = @USE_NLS@
VERSION = @VERSION@
l = @l@
-bin_PROGRAMS = texindex
+bin_PROGRAMS = install-info texindex
bin_SCRIPTS = texi2dvi
-noinst_PROGRAMS = install-inf
-install_inf_SOURCES = install-info.c
-
localedir = $(datadir)/locale
INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
LDADD = ../lib/libtxi.a @INTLLIBS@
@@ -93,24 +96,23 @@ EXTRA_DIST = README deref.c fixfonts gen-dir-node tex3patch texi2dvi \
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
-bin_PROGRAMS = texindex$(EXEEXT)
-noinst_PROGRAMS = install-inf$(EXEEXT)
-PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
+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 =
-install_inf_OBJECTS = install-info.o
-install_inf_LDADD = $(LDADD)
-install_inf_DEPENDENCIES = ../lib/libtxi.a
-install_inf_LDFLAGS =
SCRIPTS = $(bin_SCRIPTS)
CFLAGS = @CFLAGS@
@@ -123,15 +125,15 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
-SOURCES = texindex.c $(install_inf_SOURCES)
-OBJECTS = texindex.o $(install_inf_OBJECTS)
+SOURCES = install-info.c texindex.c
+OBJECTS = install-info.o texindex.o
default: all
.SUFFIXES:
-.SUFFIXES: .c .o
-$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --cygnus util/Makefile
+.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) \
@@ -141,7 +143,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
mostlyclean-binPROGRAMS:
clean-binPROGRAMS:
- test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
distclean-binPROGRAMS:
@@ -158,77 +160,79 @@ install-binPROGRAMS: $(bin_PROGRAMS)
done
uninstall-binPROGRAMS:
- $(NORMAL_UNINSTALL)
+ @$(NORMAL_UNINSTALL)
list='$(bin_PROGRAMS)'; for p in $$list; do \
rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
done
-mostlyclean-noinstPROGRAMS:
-
-clean-noinstPROGRAMS:
- test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
-
-distclean-noinstPROGRAMS:
+.c.o:
+ $(COMPILE) -c $<
-maintainer-clean-noinstPROGRAMS:
+.s.o:
+ $(COMPILE) -c $<
-.c.o:
+.S.o:
$(COMPILE) -c $<
mostlyclean-compile:
- rm -f *.o core
+ -rm -f *.o core *.core
clean-compile:
distclean-compile:
- rm -f *.tab.c
+ -rm -f *.tab.c
maintainer-clean-compile:
-texindex$(EXEEXT): $(texindex_OBJECTS) $(texindex_DEPENDENCIES)
- @rm -f texindex$(EXEEXT)
- $(LINK) $(texindex_LDFLAGS) $(texindex_OBJECTS) $(texindex_LDADD) $(LIBS)
+install-info: $(install_info_OBJECTS) $(install_info_DEPENDENCIES)
+ @rm -f install-info
+ $(LINK) $(install_info_LDFLAGS) $(install_info_OBJECTS) $(install_info_LDADD) $(LIBS)
-install-inf$(EXEEXT): $(install_inf_OBJECTS) $(install_inf_DEPENDENCIES)
- @rm -f install-inf$(EXEEXT)
- $(LINK) $(install_inf_LDFLAGS) $(install_inf_OBJECTS) $(install_inf_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)'`$(EXEEXT)"; \
- $(INSTALL_SCRIPT) $$p $(bindir)/`echo $$p|sed '$(transform)'`$(EXEEXT); \
+ 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)'`$(EXEEXT)"; \
- $(INSTALL_SCRIPT) $(srcdir)/$$p $(bindir)/`echo $$p|sed '$(transform)'`$(EXEEXT); \
+ 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)
+ @$(NORMAL_UNINSTALL)
list='$(bin_SCRIPTS)'; for p in $$list; do \
rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
done
tags: TAGS
-ID: $(HEADERS) $(SOURCES)
- here=`pwd` && cd $(srcdir) && mkid -f$$here/ID $(SOURCES) $(HEADERS)
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
- test -z "$(ETAGS_ARGS)$(SOURCES)$(HEADERS)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $(SOURCES) $(HEADERS) -o $$here/TAGS)
+ 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
+ -rm -f TAGS ID
maintainer-clean-tags:
@@ -238,18 +242,21 @@ subdir = util
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ 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-info:
-install-exec: install-binPROGRAMS install-binSCRIPTS install-exec-local
+install-exec: install-binPROGRAMS install-binSCRIPTS
@$(NORMAL_INSTALL)
install-data:
@@ -269,55 +276,46 @@ installdirs:
mostlyclean-generic:
- test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
- test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+ -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)
+ -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-noinstPROGRAMS \
- mostlyclean-compile mostlyclean-tags \
- mostlyclean-generic
-
-clean: clean-binPROGRAMS clean-noinstPROGRAMS clean-compile clean-tags \
- clean-generic mostlyclean
-
-distclean: distclean-binPROGRAMS distclean-noinstPROGRAMS \
- distclean-compile distclean-tags distclean-generic \
- clean
- rm -f config.status
-
-maintainer-clean: maintainer-clean-binPROGRAMS \
- maintainer-clean-noinstPROGRAMS \
- maintainer-clean-compile maintainer-clean-tags \
- maintainer-clean-generic distclean
+ -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-noinstPROGRAMS distclean-noinstPROGRAMS \
-clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
-mostlyclean-compile distclean-compile clean-compile \
+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-info install-exec install-data \
-install uninstall all installdirs mostlyclean-generic distclean-generic \
+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
-install-exec-local: $(noinst_PROGRAMS)
- $(mkinstalldirs) $(bindir)
- $(INSTALL_PROGRAM) install-inf$(EXEEXT) $(bindir)/`echo install-info$(EXEEXT)|sed '$(transform)'`; \
-
# 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/texinfo/util/README b/texinfo/util/README
index b1ce44c..5385522 100644
--- a/texinfo/util/README
+++ b/texinfo/util/README
@@ -1,3 +1,4 @@
Assorted Texinfo-related programs and scripts.
+
texindex, texi2dvi, and install-info get installed.
-The other programs are for your amusement.
+The other items here are for your amusement and/or hacking pleasure.
diff --git a/texinfo/util/install-info.c b/texinfo/util/install-info.c
index 6007a3c..91b599d 100644
--- a/texinfo/util/install-info.c
+++ b/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.5 1998/03/24 18:08:44 law Exp $
+ $Id: install-info.c,v 1.1.1.3 1998/03/24 18:20:30 law Exp $
- Copyright (C) 1996, 97 Free Software Foundation, Inc.
+ Copyright (C) 1996, 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
@@ -20,6 +20,10 @@
#include "system.h"
#include <getopt.h>
+#ifdef HAVE_LIBZ
+#include <zlib.h>
+#endif
+
/* Name this program was invoked with. */
char *progname;
@@ -283,8 +287,9 @@ suggest_asking_for_help ()
void
print_help ()
{
- printf (_("%s [OPTION]... [INFO-FILE [DIR-FILE]]\n\
- Install INFO-FILE in the Info directory file DIR-FILE.\n\
+ printf (_("Usage: %s [OPTION]... [INFO-FILE [DIR-FILE]]\n\
+\n\
+Install INFO-FILE in the Info directory file DIR-FILE.\n\
\n\
Options:\n\
--delete Delete existing entries in INFO-FILE;\n\
@@ -312,12 +317,14 @@ Options:\n\
from information in the Info file itself.\n\
--version Display version information and exit.\n\
\n\
-Email bug reports to bug-texinfo@prep.ai.mit.edu.\n\
+Email bug reports to bug-texinfo@gnu.org.\n\
"), progname);
}
+
/* If DIRFILE does not exist, create a minimal one (or abort). If it
already exists, do nothing. */
+
void
ensure_dirfile_exists (dirfile)
char *dirfile;
@@ -335,7 +342,7 @@ ensure_dirfile_exists (dirfile)
topmost node of the Info hierarchy, called (dir)Top.\n\
The first time you invoke Info you start off looking at this node.\n\
\n\
-File: dir Node: Top This is the top of the INFO tree\n\
+File: dir,\tNode: Top,\tThis is the top of the INFO tree\n\
\n\
This (the Directory node) gives a menu of major topics.\n\
Typing \"q\" exits, \"?\" lists all Info commands, \"d\" returns here,\n\
@@ -368,19 +375,20 @@ File: dir Node: Top This is the top of the INFO tree\n\
struct option longopts[] =
{
- { "delete", no_argument, NULL, 'r' },
- { "dir-file", required_argument, NULL, 'd' },
- { "entry", required_argument, NULL, 'e' },
- { "help", no_argument, NULL, 'h' },
- { "info-dir", required_argument, NULL, 'D' },
- { "info-file", required_argument, NULL, 'i' },
- { "item", required_argument, NULL, 'e' },
- { "quiet", no_argument, NULL, 'q' },
- { "remove", no_argument, NULL, 'r' },
- { "section", required_argument, NULL, 's' },
- { "version", no_argument, NULL, 'V' },
+ { "delete", no_argument, NULL, 'r' },
+ { "dir-file", required_argument, NULL, 'd' },
+ { "entry", required_argument, NULL, 'e' },
+ { "help", no_argument, NULL, 'h' },
+ { "info-dir", required_argument, NULL, 'D' },
+ { "info-file", required_argument, NULL, 'i' },
+ { "item", required_argument, NULL, 'e' },
+ { "quiet", no_argument, NULL, 'q' },
+ { "remove", no_argument, NULL, 'r' },
+ { "section", required_argument, NULL, 's' },
+ { "version", no_argument, NULL, 'V' },
{ 0 }
};
+
int
main (argc, argv)
@@ -518,11 +526,12 @@ main (argc, argv)
break;
case 'V':
- printf (_("install-info (GNU %s) %s\n"), PACKAGE, VERSION);
-puts (_("Copyright (C) 1996 Free Software Foundation, Inc.\n\
+ printf ("install-info (GNU %s) %s\n", PACKAGE, VERSION);
+ printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
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."));
+For more information about these matters, see the files named COPYING.\n"),
+ "1998");
exit (0);
default:
@@ -955,18 +964,49 @@ readfile (filename, sizep)
char *filename;
int *sizep;
{
+ int desc;
int data_size = 1024;
char *data = (char *) xmalloc (data_size);
int filled = 0;
int nread = 0;
+#ifdef HAVE_LIBZ
+ int isGZ = 0;
+ gzFile zdesc;
+#endif
- int desc = open (filename, O_RDONLY);
+ desc = open (filename, O_RDONLY);
if (desc < 0)
pfatal_with_name (filename);
+#ifdef HAVE_LIBZ
+ /* The file should always be two bytes long. */
+ if (read (desc, data, 2) != 2)
+ pfatal_with_name (filename);
+
+ /* Undo that read. */
+ lseek (desc, 0, SEEK_SET);
+
+ /* If we see gzip magic, use gzdopen. */
+ if (data[0] == '\x1f' && data[1] == '\x8b')
+ {
+ isGZ = 1;
+ zdesc = gzdopen (desc, "r");
+ if (zdesc == NULL) {
+ close (desc);
+ pfatal_with_name (filename);
+ }
+ }
+#endif /* HAVE_LIBZ */
+
while (1)
{
- nread = read (desc, data + filled, data_size - filled);
+#ifdef HAVE_LIBZ
+ if (isGZ)
+ nread = gzread (zdesc, data + filled, data_size - filled);
+ else
+#endif
+ nread = read (desc, data + filled, data_size - filled);
+
if (nread < 0)
pfatal_with_name (filename);
if (nread == 0)
@@ -981,6 +1021,14 @@ readfile (filename, sizep)
}
*sizep = filled;
+
+#ifdef HAVE_LIBZ
+ if (isGZ)
+ gzclose (zdesc);
+ else
+#endif
+ close(desc);
+
return data;
}
diff --git a/texinfo/util/texi2dvi b/texinfo/util/texi2dvi
index 8363f5e..5fe8dee 100755
--- a/texinfo/util/texi2dvi
+++ b/texinfo/util/texi2dvi
@@ -1,10 +1,9 @@
#! /bin/sh
# texi2dvi --- smartly produce DVI files from texinfo sources
-
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
-
-# $Id: texi2dvi,v 1.2 1998/03/24 18:08:49 law Exp $
-
+# $Id: texi2dvi,v 1.1.1.3 1998/03/24 18:20:32 law 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)
@@ -19,35 +18,34 @@
# 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@prep.ai.mit.edu>
-
-# Please send bug reports, etc. to bug-texinfo@prep.ai.mit.edu
+#
+# 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 with some bourne shells
-# are:
+# 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: 1.2 $'
+rcs_revision='$Revision: 1.1.1.3 $'
version=`set - $rcs_revision; echo $2`
# To prevent hairy quoting and escaping later.
@@ -58,6 +56,8 @@ 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.
@@ -67,14 +67,15 @@ Options:
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@prep.ai.mit.edu.
-"
+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=
@@ -92,16 +93,19 @@ export TEXINPUTS
# 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
- case $# in 0) break ;; esac
+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 (Texinfo 3.9) $version"
- echo "Copyright (C) 1996 Free Software Foundation, Inc.
+ 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."
@@ -109,8 +113,7 @@ For more information about these matters, see the files named COPYING."
--verb* ) verbose=echo; shift ;;
-- ) # Stop option processing
shift
- break
- ;;
+ break ;;
-* )
case "$1" in
--*=* ) arg=`echo "$1" | sed -e 's/=.*//'` ;;
@@ -119,11 +122,8 @@ For more information about these matters, see the files named COPYING."
exec 1>&2
echo "$progname: Unknown or ambiguous option $bq$arg$eq."
echo "$progname: Try $bq--help$eq for more information."
- exit 1
- ;;
- * )
- break
- ;;
+ exit 1 ;;
+ * ) break ;;
esac
done
@@ -139,14 +139,14 @@ fi
test "$debug" = t && set -x
# Texify files
-for command_line_filename in ${1+"$@"} ; do
+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
+ if test ! -r "${command_line_filename}"; then
echo "$0: Could not read ${command_line_filename}." >&2
continue
fi
@@ -161,17 +161,22 @@ for command_line_filename in ${1+"$@"} ; do
# 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.
- tmp_dir=${TMPDIR-/tmp}/$$
+ # 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.
- filename_tmp2=$tmp_dir.2/$filename_noext.texi
- mkdir $tmp_dir $tmp_dir.2
+ 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=.
+ if test "z${directory}" = "z${command_line_filename}"; then
+ directory=.
fi
# Source file might @include additional texinfo sources. Put `.' and
@@ -195,10 +200,10 @@ for command_line_filename in ${1+"$@"} ; do
# let's be safe.)
if test $? -ne 0 || cmp -s $filename_tmp $command_line_filename; then
$verbose "Reverting to $command_line_filename ..."
- filename_input=$command_line_filename
- else
- filename_input=$filename_tmp
+ 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
@@ -206,6 +211,14 @@ for command_line_filename in ${1+"$@"} ; do
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
@@ -218,17 +231,17 @@ for command_line_filename in ${1+"$@"} ; do
# 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
+ 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} \
@@ -238,7 +251,7 @@ for command_line_filename in ${1+"$@"} ; do
# 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
+ for index_file_to_save in ${orig_index_files}; do
cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}"
done
@@ -246,21 +259,27 @@ for command_line_filename in ${1+"$@"} ; do
# 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}
+ 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 ..."
- ${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
+ for this_file in ${possible_index_files}; do
# If file is empty, forget it.
test -s "${this_file}" || continue
@@ -283,17 +302,17 @@ for command_line_filename in ${1+"$@"} ; do
# 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
+ 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
+ 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
+ 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.
@@ -308,22 +327,34 @@ for command_line_filename in ${1+"$@"} ; do
# 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
+ 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
+ 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_dir.2 ..."
+ if test -n "${file_list}"; then
+ $verbose "Removing $file_list $tmp_dir $tmp_dir2 ..."
rm -f ${file_list}
- rm -rf $tmp_dir $tmp_dir.2
+ rm -rf $tmp_dir $tmp_dir2
fi
done
diff --git a/texinfo/util/texindex.c b/texinfo/util/texindex.c
index d0655fb..347cccb 100644
--- a/texinfo/util/texindex.c
+++ b/texinfo/util/texindex.c
@@ -1,7 +1,7 @@
/* Prepare TeX index dribble output into an actual index.
- $Id: texindex.c,v 1.2 1998/03/24 18:08:47 law Exp $
+ $Id: texindex.c,v 1.1.1.3 1998/03/24 18:20:31 law Exp $
- Copyright (C) 1987, 91, 92, 96, 97 Free Software Foundation, Inc.
+ Copyright (C) 1987, 91, 92, 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
@@ -43,18 +43,6 @@ char *mktemp ();
# define TI_FATAL_ERROR ((1 << 28) | 4)
# define unlink delete
#else /* !VMS */
-# if defined (HAVE_SYS_FCNTL_H)
-# include <sys/types.h>
-# include <sys/fcntl.h>
-# endif /* HAVE_SYS_FCNTL_H */
-
-# if defined (_AIX) || !defined (_POSIX_VERSION)
-# include <sys/file.h>
-# else /* !AIX && _POSIX_VERSION */
-# if !defined (HAVE_SYS_FCNTL_H)
-# include <fcntl.h>
-# endif /* !HAVE_FCNTL_H */
-# endif /* !_AIX && _POSIX_VERSION */
# define TI_NO_ERROR 0
# define TI_FATAL_ERROR 1
#endif /* !VMS */
@@ -246,6 +234,8 @@ main (argc, argv)
flush_tempfiles (tempcount);
exit (TI_NO_ERROR);
+
+ return 0; /* Avoid bogus warnings. */
}
typedef struct
@@ -297,7 +287,7 @@ usage (result_value)
fprintf (f, "\t%s\n", _(texindex_options[i].doc_string));
}
- puts (_("\nEmail bug reports to bug-texinfo@prep.ai.mit.edu."));
+ puts (_("\nEmail bug reports to bug-texinfo@gnu.org."));
exit (result_value);
}
@@ -344,11 +334,12 @@ decode_command (argc, argv)
{
if (strcmp (arg, "--version") == 0)
{
- printf (_("texindex (GNU %s %s) 2.1\n"), PACKAGE, VERSION);
-puts (_("Copyright (C) 1996 Free Software Foundation, Inc.\n\
+ printf ("texindex (GNU %s) %s\n", PACKAGE, VERSION);
+ printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
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."));
+For more information about these matters, see the files named COPYING.\n"),
+ "1998");
exit (0);
}
else if ((strcmp (arg, "--keep") == 0) ||
diff --git a/texinfo/util/update-info b/texinfo/util/update-info
index d946bce..0d31fde 100755
--- a/texinfo/util/update-info
+++ b/texinfo/util/update-info
@@ -213,7 +213,7 @@ Options:
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@prep.ai.mit.edu.
+Email bug reports to bug-texinfo@gnu.org.
HelpEndOfFile
exit;;