[patch] fastjar documentation

Matthias Klose doko@cs.tu-berlin.de
Tue Aug 27 23:03:00 GMT 2002


Joseph S. Myers writes:
> > > AM_MAKEINFOFLAGS, according to the Automake manual.
> >
> > the automake manual doesn't say anything about AM_MAKEINFOFLAGS, at
> > least the 1.4 version. Assigning a value to it simply puts it into
> > Makefile.in, but nothing more.
> 
> If MAKEINFOFLAGS (which is meant to be for the user, but I don't think
> that generally works in GCC) doesn't work either, then wait until GCC
> moves to a more recent Automake.  Or will Automake handle using += on
> MAKEINFO to add the flags sensibly?

thanks for the pointer. works for MAKEINFO, but not MAKEINFOFLAGS.
New patch, addressing Bryce's comments as well.

2002-08-28  Matthias Klose  <doko@debian.org>

	* fastjar.texi: New.
	* Makefile.am: Support building info docs and manpages.
	* Makefile.in: Regenerated.
	* configure.in: Set gcc_version.
	* configure: Regenerated.
	* jargrep.c: Update usage and help strings.

--- fastjar.orig/Makefile.am	2002-08-25 15:05:17.000000000 +0200
+++ fastjar/Makefile.am	2002-08-28 07:38:17.000000000 +0200
@@ -57,3 +57,30 @@
 grepjar_DEPENDENCIES = $(ZDEPS) $(LIBIBERTY)
 
 AM_CFLAGS = @fastjar_warn_cflags@
+
+MAKEINFO += -I $(srcdir)/../gcc/doc/include
+TEXINFO_TEX = $(srcdir)/../gcc/doc/include/texinfo.tex
+info_TEXINFOS = fastjar.texi
+fastjar_TEXINFOS = \
+	$(srcdir)/../gcc/doc/include/gcc-common.texi \
+	$(srcdir)/../gcc/doc/include/fdl.texi \
+	$(srcdir)/../gcc/doc/include/gpl.texi
+man_MANS = jar.1 grepjar.1
+EXTRA_DIST = $(man_MANS)
+
+TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl
+POD2MAN = pod2man --center="GNU" --release="gcc-@gcc_version@"
+
+$(srcdir)/jar.1: $(srcdir)/fastjar.texi
+	-$(TEXI2POD) -D jar < $(srcdir)/fastjar.texi > fastjar.pod
+	($(POD2MAN) --section=1 fastjar.pod > jar.1.T$$$$ && \
+		mv -f jar.1.T$$$$ $(srcdir)/jar.1) || \
+		(rm -f jar.1.T$$$$ && exit 1)
+	rm -f fastjar.pod
+
+$(srcdir)/grepjar.1: $(srcdir)/fastjar.texi
+	-$(TEXI2POD) -D grepjar < $(srcdir)/fastjar.texi > fastjar.pod
+	($(POD2MAN) --section=1 fastjar.pod > grepjar.1.T$$$$ && \
+		mv -f grepjar.1.T$$$$ $(srcdir)/grepjar.1) || \
+		(rm -f grepjar.1.T$$$$ && exit 1)
+	rm -f fastjar.pod

--- fastjar.orig/configure.in	2002-06-26 20:25:23.000000000 +0200
+++ fastjar/configure.in	2002-08-28 07:41:11.000000000 +0200
@@ -63,4 +63,16 @@
 AC_SUBST(ZDEPS)
 AC_SUBST(ZINCS)
 
+# Get the version trigger filename from the toplevel
+if test "${with_gcc_version_trigger+set}" = set; then
+   gcc_version_trigger=$with_gcc_version_trigger
+else
+   gcc_version_trigger=${srcdir}/../gcc/version.c
+fi
+changequote(,)dnl
+gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'`
+gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
+changequote([,])dnl
+AC_SUBST(gcc_version)
+
 AC_OUTPUT(Makefile install-defs.sh)

--- fastjar.orig/fastjar.texi	1970-01-01 01:00:00.000000000 +0100
+++ fastjar/fastjar.texi	2002-08-28 07:27:08.000000000 +0200
@@ -0,0 +1,262 @@
+@\input texinfo @c -*-texinfo-*-
+@setfilename fastjar.info
+@settitle Guide to GNU jar utilites
+
+@c Note: When reading this manual you'll find lots of strange
+@c circumlocutions like ``compiler for the Java language''.
+@c This is necessary due to Sun's restrictions on the use of
+@c the word ``Java'.
+
+@c When this manual is copyrighted.
+@set copyrights-fastjar 2002
+
+@include gcc-common.texi
+
+@c Versions
+@set which-gcj GCC-@value{version-GCC}
+
+@ifinfo
+@format
+@dircategory Programming
+@direntry
+* fastjar: (fastjar).       GNU jar utilities
+@end direntry
+
+@dircategory Individual utilities
+@direntry
+* jar: Invoking jar.
+                            An archive tool for Java archives
+* grepjar: Invoking grepjar.
+                            Search files in a jar file for a pattern
+@end direntry
+@end format
+
+@c man begin COPYRIGHT
+Copyright (C) @value{copyrights-fastjar} Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``GNU General Public License'', the Front-Cover
+texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below).  A copy of the license is included in the
+@c man end
+section entitled
+``GNU Free Documentation License''.
+@ignore
+@c man begin COPYRIGHT
+man page gfdl(7).
+@c man end
+@end ignore
+
+(a) The FSF's Front-Cover Text is:
+
+     A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+     You have freedom to copy and modify this GNU Manual, like GNU
+     software.  Copies published by the Free Software Foundation raise
+     funds for GNU development.
+@end ifinfo
+
+@titlepage
+@title GNU jar utilites
+@author Brian Burns
+
+@page
+@vskip 0pt plus 1filll
+Copyright @copyright{} @value{copyrights-gcj} Free Software Foundation, Inc.
+@sp 2
+For the @value{which-gcj} Version*
+@sp 1
+Published by the Free Software Foundation @*
+59 Temple Place - Suite 330@*
+Boston, MA 02111-1307, USA@*
+@sp 1
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``GNU General Public License'', the Front-Cover
+texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below).  A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
+
+(a) The FSF's Front-Cover Text is:
+
+     A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+     You have freedom to copy and modify this GNU Manual, like GNU
+     software.  Copies published by the Free Software Foundation raise
+     funds for GNU development.
+@end titlepage
+@contents
+@page
+
+
+@node Top
+@top Introduction
+
+This manual describes how to use @command{jar} and @command{grepjar}.
+
+@menu
+* Invoking jar::	Options supported by @command{jar}
+* Invoking grepjar::    Options supported by @command{grepjar}
+* Copying::		The GNU General Public License
+* GNU Free Documentation License::
+			How you can share and copy this manual
+@end menu
+
+@node Invoking jar
+@chapter Invoking jar
+
+@c man title jar archive tool for Java archives
+
+@c man begin DESCRIPTION jar
+
+@code{fastjar} is an implementation of Sun's jar utility that comes with
+the JDK, written entirely in C, and runs in a fraction of the time while
+being feature compatible.
+
+If any file is a directory then it is processed recursively.  The
+manifest file name and the archive file name needs to be specified in
+the same order the @option{-m} and @option{-f} flags are specified.
+
+@c man end
+
+@ignore
+@c man begin SYNOPSIS jar
+jar @option{-ctxu} [@option{OPTIONS}] [@var{jar-file}] [@var{manifest-file}] [@option{-C} @var{dir}] @var{files}@dots{}
+@c man end
+@c man begin SEEALSO jar
+gcj(1), gij(1), grepjar(1)
+and the Info entry for @file{gcj}.
+@c man end
+@end ignore
+
+@c man begin OPTIONS jar
+
+Exactly one of the following actions must be specified:
+
+@table @gcctabopt
+
+@item -c
+Create new archive.
+
+@item -t
+List table of contents for archive.
+
+@item -x
+Extract named (or all) files from archive.
+
+@item -u
+Update existing archive. This option is disabled due to bugs (currently
+fails with exit status 1 and does nothing).
+
+@end table
+
+The following parameters are optional:
+
+@table @gcctabopt
+
+@item -@@
+Read the names of the files to add to the archive from stdin.  This
+option is supported only in combination with @option{-c} or @option{-u}.
+Non standard option added in the GCC version.
+
+@item -C @var{directory}
+Change to the @var{directory} and include the following file.
+
+@item -E
+Prevent fastjar from reading the content of a directory when specifying
+one (and instead relying on the provided list of files to populate the
+archive with regard to the directory entry). Non standard option added
+in the GCC version.
+
+@item -M
+Do not create a manifest file for the entries.
+
+@item -0
+Store only; use no ZIP compression.
+
+@item -V
+@itemx --version
+Display version information.
+
+@item -f @var{archive}
+Specify archive file name.
+
+@item -m @var{manifest}
+Include manifest information from specified @var{manifest} file.
+
+@item -v
+Generate verbose output on standard output.
+
+@end table
+
+All remaining options are considered to be names of files.
+
+@c man end
+
+@node Invoking grepjar
+@chapter Invoking grepjar
+
+@c man title grepjar search files in a jar file for a pattern
+
+@c man begin DESCRIPTION grepjar
+
+The @code{grepjar} program can be used to search files in a jar file for
+a pattern.
+
+@c man end
+
+@ignore
+@c man begin SYNOPSIS grepjar
+grepjar [@option{-bcinsw}] @option{-e} @var{PATTERN} | @var{PATTERN} @var{files}@dots{}
+@c man end
+@c man begin SEEALSO grepjar
+jar(1), gcj(1), gij(1), gfdl(7) and the Info entry for @file{gcj}.
+@c man end
+@end ignore
+
+@c man begin OPTIONS grepjar
+
+@table @gcctabopt
+@item -b
+Print byte offset of match.
+
+@item -c
+Print number of matches.
+
+@item -i
+Compare case-insensitively.
+
+@item -n
+Print line number of each match.
+
+@item -s
+Suppress error messages.
+
+@item -w
+Force @var{PATTERN} to match only whole words.
+
+@item -e @var{PATTERN}
+Use @var{PATTERN} as regular expression.
+
+@item --help
+Print help, then exit.
+
+@item -V
+@itemx --version
+Print version number, then exit.
+@end table
+
+@c man end
+
+@include gpl.texi
+
+@include fdl.texi
+
+@bye

--- fastjar.orig/jargrep.c	2002-03-02 00:37:37.000000000 +0100
+++ fastjar/jargrep.c	2002-08-25 14:39:02.000000000 +0200
@@ -126,7 +126,7 @@
 void version(void);
 void help(const char *name);
 
-#define Usage "Usage: %s [-bcinsw] <-e PATTERN | PATTERN> FILE ...\n"
+#define Usage "Usage: %s [-bcinsVw] [--version|--help] <-e PATTERN | PATTERN> FILE ...\n"
 
 /*
 Function name: opt_valid
@@ -769,7 +769,9 @@
    -n                print line number of each match\n\
    -s                suppress error messages\n\
    -w                force PATTERN to match only whole words\n\
-   -e PATTERN        use PATTERN as regular exprssion\n\
+   -e PATTERN        use PATTERN as regular expression\n\
+   -V|--version      print version number and exit\n\
+   --help            print help\n\
 ");
 
   exit (0);



More information about the Java mailing list