Merging upstream version 1.1~rc2.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
24e2ea3a41
commit
e13f4df619
26 changed files with 1151 additions and 583 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2013-07-07 Antonio Diaz Diaz <antonio@gnu.org>
|
||||
|
||||
* Version 1.1-rc2 released.
|
||||
* Fixed all uses of decompressed/uncompressed.
|
||||
|
||||
2013-07-04 Antonio Diaz Diaz <antonio@gnu.org>
|
||||
|
||||
* Version 1.1-rc1 released.
|
||||
* Added options '--bz2', '--gz', '--lz' and '--xz' to all utilities.
|
||||
* Added runtime configuration file 'zutilsrc'.
|
||||
* New function 'good_status' checks exit status of all children.
|
||||
|
||||
2013-05-31 Antonio Diaz Diaz <antonio@gnu.org>
|
||||
|
||||
* Version 1.0 released.
|
||||
|
@ -7,7 +19,7 @@
|
|||
file and '--recursive' has not been selected.
|
||||
* Zgrep: Fixed output of option '-L' (it behaved like '-l').
|
||||
* zcmp.cc: Fixed deadlock when '-n' option is used.
|
||||
* zdiff.cc (set_data_feeder): Call decompressor with option "-q"
|
||||
* zdiff.cc (set_data_feeder): Call compressor with option "-q"
|
||||
only if verbosity < 0.
|
||||
* zutils.cc (set_data_feeder): Likewise.
|
||||
* Changed quote characters in messages as advised by GNU Standards.
|
||||
|
|
2
INSTALL
2
INSTALL
|
@ -1,7 +1,7 @@
|
|||
Requirements
|
||||
------------
|
||||
You will need a C++ compiler.
|
||||
I use gcc 4.8.0 and 3.3.6, but the code should compile with any
|
||||
I use gcc 4.8.1 and 3.3.6, but the code should compile with any
|
||||
standards compliant compiler.
|
||||
Gcc is available at http://gcc.gnu.org.
|
||||
|
||||
|
|
24
Makefile.in
24
Makefile.in
|
@ -7,9 +7,9 @@ INSTALL_DATA = $(INSTALL) -p -m 644
|
|||
INSTALL_DIR = $(INSTALL) -d -m 755
|
||||
SHELL = /bin/sh
|
||||
|
||||
objs = arg_parser.o zutils.o main.o
|
||||
zcmp_objs = arg_parser.o zutils.o zcmp.o
|
||||
zdiff_objs = arg_parser.o zutils.o zdiff.o
|
||||
objs = arg_parser.o rc.o zutils.o main.o
|
||||
zcmp_objs = arg_parser.o rc.o zutils.o zcmp.o
|
||||
zdiff_objs = arg_parser.o rc.o zutils.o zdiff.o
|
||||
scripts = zcat zegrep zfgrep zgrep ztest
|
||||
|
||||
|
||||
|
@ -57,6 +57,9 @@ main.o : main.cc
|
|||
zdiff.o : zdiff.cc
|
||||
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -DDIFF=\"$(DIFF)\" -c -o $@ $<
|
||||
|
||||
rc.o : rc.cc
|
||||
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -DSYSCONFDIR=\"$(sysconfdir)\" -c -o $@ $<
|
||||
|
||||
zutils.o : zutils.cc
|
||||
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -DPROGVERSION=\"$(pkgversion)\" -c -o $@ $<
|
||||
|
||||
|
@ -66,10 +69,11 @@ zutils.o : zutils.cc
|
|||
$(objs) : Makefile
|
||||
$(scripts) : Makefile
|
||||
arg_parser.o : arg_parser.h
|
||||
main.o : arg_parser.h zutils.h zcat.cc zgrep.cc ztest.cc
|
||||
zcmp.o : arg_parser.h zutils.h zcmpdiff.cc Makefile
|
||||
zdiff.o : arg_parser.h zutils.h zcmpdiff.cc Makefile
|
||||
zutils.o : zutils.h
|
||||
main.o : arg_parser.h zutils.h rc.h zcat.cc zgrep.cc ztest.cc
|
||||
rc.o : arg_parser.h zutils.h rc.h
|
||||
zcmp.o : arg_parser.h zutils.h rc.h zcmpdiff.cc Makefile
|
||||
zdiff.o : arg_parser.h zutils.h rc.h zcmpdiff.cc Makefile
|
||||
zutils.o : zutils.h rc.h
|
||||
|
||||
|
||||
doc : info man
|
||||
|
@ -120,6 +124,10 @@ install-bin : all
|
|||
$(INSTALL_SCRIPT) ./zfgrep "$(DESTDIR)$(bindir)/zfgrep"
|
||||
$(INSTALL_SCRIPT) ./zgrep "$(DESTDIR)$(bindir)/zgrep"
|
||||
$(INSTALL_SCRIPT) ./ztest "$(DESTDIR)$(bindir)/ztest"
|
||||
if [ ! -e "$(DESTDIR)$(sysconfdir)/$(pkgname)rc" ] ; then \
|
||||
if [ ! -d "$(DESTDIR)$(sysconfdir)" ] ; then $(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)" ; fi ; \
|
||||
$(INSTALL_DATA) $(VPATH)/$(pkgname)rc "$(DESTDIR)$(sysconfdir)/$(pkgname)rc" ; \
|
||||
fi
|
||||
|
||||
install-info :
|
||||
if [ ! -d "$(DESTDIR)$(infodir)" ] ; then $(INSTALL_DIR) "$(DESTDIR)$(infodir)" ; fi
|
||||
|
@ -148,6 +156,7 @@ uninstall-bin :
|
|||
-rm -f "$(DESTDIR)$(bindir)/zfgrep"
|
||||
-rm -f "$(DESTDIR)$(bindir)/zgrep"
|
||||
-rm -f "$(DESTDIR)$(bindir)/ztest"
|
||||
-rm -f "$(DESTDIR)$(sysconfdir)/$(pkgname)rc"
|
||||
|
||||
uninstall-info :
|
||||
-install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$(pkgname).info"
|
||||
|
@ -177,6 +186,7 @@ dist : doc
|
|||
$(DISTNAME)/testsuite/check.sh \
|
||||
$(DISTNAME)/testsuite/test.txt \
|
||||
$(DISTNAME)/testsuite/test.txt.tar \
|
||||
$(DISTNAME)/$(pkgname)rc \
|
||||
$(DISTNAME)/*.h \
|
||||
$(DISTNAME)/*.cc \
|
||||
$(DISTNAME)/z*.in
|
||||
|
|
32
NEWS
32
NEWS
|
@ -1,28 +1,12 @@
|
|||
Changes in version 1.0:
|
||||
Changes in version 1.1:
|
||||
|
||||
The new option "--format" has been added to all utilities.
|
||||
The new options "--bz2", "--gz", "--lz" and "--xz" have been added to
|
||||
all utilities.
|
||||
|
||||
Zgrep no more prefixes the file name to the output by default when
|
||||
searching one file and "--recursive" has not been selected.
|
||||
Zutils now provides the runtime configuration file "zutilsrc", which
|
||||
allows the user change the compressor to be used for each format.
|
||||
|
||||
The output of "zgrep -L" has been fixed (it behaved like "zgrep -l").
|
||||
The checking of the exit status of compressors has been improved.
|
||||
|
||||
A deadlock in zcmp, which happens when the "-n" option is used, has been
|
||||
fixed.
|
||||
|
||||
Decompressors are now invoked without the "-q" option except if
|
||||
explicitly requested, as some simplified implementations do not accept
|
||||
it.
|
||||
|
||||
Quote characters in messages have been changed as advised by GNU Coding
|
||||
Standards.
|
||||
|
||||
"configure" now accepts options with a separate argument.
|
||||
|
||||
Configure option "--datadir" has been renamed to "--datarootdir" to
|
||||
follow GNU Standards.
|
||||
|
||||
The target "install-bin" has been added to the Makefile.
|
||||
|
||||
Information has been added to the INSTALL file about how to install
|
||||
zutils along with GNU gzip.
|
||||
The use of "decompressed" and "uncompressed" in the documentation have
|
||||
been revised.
|
||||
|
|
9
README
9
README
|
@ -1,8 +1,8 @@
|
|||
Description
|
||||
|
||||
Zutils is a collection of utilities able to deal with any combination of
|
||||
compressed and non-compressed files transparently. If any given file,
|
||||
including standard input, is compressed, its uncompressed content is
|
||||
compressed and uncompressed files transparently. If any given file,
|
||||
including standard input, is compressed, its decompressed content is
|
||||
used. Compressed files are decompressed on the fly; no temporary files
|
||||
are created.
|
||||
|
||||
|
@ -12,6 +12,7 @@ those utilities supporting it.
|
|||
|
||||
The provided utilities are zcat, zcmp, zdiff, zgrep and ztest.
|
||||
The supported formats are bzip2, gzip, lzip and xz.
|
||||
The compressor to be used for each format is configurable at runtime.
|
||||
|
||||
Zcat, zcmp, zdiff, and zgrep are improved replacements for the shell
|
||||
scripts provided with GNU gzip. Ztest is unique to zutils.
|
||||
|
@ -20,6 +21,10 @@ NOTE: Bzip2 and lzip provide well-defined values of exit status, which
|
|||
makes them safe to use with zutils. Gzip and xz may return ambiguous
|
||||
warning values, making them less reliable backends for zutils.
|
||||
|
||||
LANGUAGE NOTE: Uncompressed = not compressed = plain data; it may never
|
||||
have been compressed. Decompressed is used to refer to data which has
|
||||
undergone the process of decompression.
|
||||
|
||||
|
||||
Copyright (C) 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
|
||||
|
||||
|
|
18
configure
vendored
18
configure
vendored
|
@ -6,9 +6,9 @@
|
|||
# to copy, distribute and modify it.
|
||||
|
||||
pkgname=zutils
|
||||
pkgversion=1.0
|
||||
pkgversion=1.1-rc2
|
||||
progname=zutils
|
||||
srctrigger=zutils.h
|
||||
srctrigger=${pkgname}rc
|
||||
|
||||
# clear some things potentially inherited from environment.
|
||||
LC_ALL=C
|
||||
|
@ -20,6 +20,7 @@ bindir='$(exec_prefix)/bin'
|
|||
datarootdir='$(prefix)/share'
|
||||
infodir='$(datarootdir)/info'
|
||||
mandir='$(datarootdir)/man'
|
||||
sysconfdir='$(prefix)/etc'
|
||||
CXX=g++
|
||||
CPPFLAGS=
|
||||
CXXFLAGS='-Wall -W -O2'
|
||||
|
@ -66,6 +67,7 @@ while [ $# != 0 ] ; do
|
|||
echo " --datarootdir=DIR base directory for doc and data [${datarootdir}]"
|
||||
echo " --infodir=DIR info files directory [${infodir}]"
|
||||
echo " --mandir=DIR man pages directory [${mandir}]"
|
||||
echo " --sysconfdir=DIR read-only single-machine data directory [${sysconfdir}]"
|
||||
echo " CXX=COMPILER C++ compiler to use [g++]"
|
||||
echo " CPPFLAGS=OPTIONS command line options for the preprocessor [${CPPFLAGS}]"
|
||||
echo " CXXFLAGS=OPTIONS command line options for the C++ compiler [${CXXFLAGS}]"
|
||||
|
@ -84,6 +86,7 @@ while [ $# != 0 ] ; do
|
|||
--datarootdir) datarootdir=$1 ; arg2=yes ;;
|
||||
--infodir) infodir=$1 ; arg2=yes ;;
|
||||
--mandir) mandir=$1 ; arg2=yes ;;
|
||||
--sysconfdir) sysconfdir=$1 ; arg2=yes ;;
|
||||
|
||||
--srcdir=*) srcdir=${optarg} ;;
|
||||
--prefix=*) prefix=${optarg} ;;
|
||||
|
@ -92,6 +95,7 @@ while [ $# != 0 ] ; do
|
|||
--datarootdir=*) datarootdir=${optarg} ;;
|
||||
--infodir=*) infodir=${optarg} ;;
|
||||
--mandir=*) mandir=${optarg} ;;
|
||||
--sysconfdir=*) sysconfdir=${optarg} ;;
|
||||
--no-create) no_create=yes ;;
|
||||
|
||||
CXX=*) CXX=${optarg} ;;
|
||||
|
@ -106,7 +110,7 @@ while [ $# != 0 ] ; do
|
|||
*=* | *-*-*) ;;
|
||||
*)
|
||||
echo "configure: unrecognized option: '${option}'" 1>&2
|
||||
echo "Try 'configure --help' for more information."
|
||||
echo "Try 'configure --help' for more information." 1>&2
|
||||
exit 1 ;;
|
||||
esac
|
||||
|
||||
|
@ -131,10 +135,8 @@ if [ -z "${srcdir}" ] ; then
|
|||
fi
|
||||
|
||||
if [ ! -r "${srcdir}/${srctrigger}" ] ; then
|
||||
exec 1>&2
|
||||
echo
|
||||
echo "configure: Can't find sources in ${srcdir} ${srcdirtext}"
|
||||
echo "configure: (At least ${srctrigger} is missing)."
|
||||
echo "configure: Can't find sources in ${srcdir} ${srcdirtext}" 1>&2
|
||||
echo "configure: (At least ${srctrigger} is missing)." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -166,6 +168,7 @@ echo "bindir = ${bindir}"
|
|||
echo "datarootdir = ${datarootdir}"
|
||||
echo "infodir = ${infodir}"
|
||||
echo "mandir = ${mandir}"
|
||||
echo "sysconfdir = ${sysconfdir}"
|
||||
echo "CXX = ${CXX}"
|
||||
echo "CPPFLAGS = ${CPPFLAGS}"
|
||||
echo "CXXFLAGS = ${CXXFLAGS}"
|
||||
|
@ -191,6 +194,7 @@ bindir = ${bindir}
|
|||
datarootdir = ${datarootdir}
|
||||
infodir = ${infodir}
|
||||
mandir = ${mandir}
|
||||
sysconfdir = ${sysconfdir}
|
||||
CXX = ${CXX}
|
||||
CPPFLAGS = ${CPPFLAGS}
|
||||
CXXFLAGS = ${CXXFLAGS}
|
||||
|
|
21
doc/zcat.1
21
doc/zcat.1
|
@ -1,5 +1,5 @@
|
|||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
|
||||
.TH ZCAT "1" "May 2013" "Zcat (zutils) 1.0" "User Commands"
|
||||
.TH ZCAT "1" "July 2013" "Zcat (zutils) 1.1-rc2" "User Commands"
|
||||
.SH NAME
|
||||
Zcat \- decompress and concatenate files to standard output
|
||||
.SH SYNOPSIS
|
||||
|
@ -7,7 +7,7 @@ Zcat \- decompress and concatenate files to standard output
|
|||
[\fIoptions\fR] [\fIfiles\fR]
|
||||
.SH DESCRIPTION
|
||||
Zcat copies each given file ("\-" means standard input), to standard
|
||||
output. If any given file is compressed, its uncompressed content is
|
||||
output. If any given file is compressed, its decompressed content is
|
||||
used. If a given file does not exist, and its name does not end with one
|
||||
of the known extensions, zcat tries the compressed file names
|
||||
corresponding to the supported formats. If no files are specified,
|
||||
|
@ -17,7 +17,7 @@ all uncompressed or all in the same compression format.
|
|||
.PP
|
||||
The supported formats are bzip2, gzip, lzip and xz.
|
||||
.PP
|
||||
Exit status is 0 if no errors occurred, 1 otherwise.
|
||||
Exit status is 0 if no errors occurred, non\-zero otherwise.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
|
@ -44,6 +44,9 @@ force given format (bz2, gz, lz, xz)
|
|||
\fB\-n\fR, \fB\-\-number\fR
|
||||
number all output lines
|
||||
.TP
|
||||
\fB\-N\fR, \fB\-\-no\-rcfile\fR
|
||||
don't read runtime configuration file
|
||||
.TP
|
||||
\fB\-q\fR, \fB\-\-quiet\fR
|
||||
suppress all messages
|
||||
.TP
|
||||
|
@ -64,6 +67,18 @@ use '^' and 'M\-' notation, except for LF and TAB
|
|||
.TP
|
||||
\fB\-\-verbose\fR
|
||||
verbose mode (show error messages)
|
||||
.TP
|
||||
\fB\-\-bz2=\fR<command>
|
||||
set compressor and options for bzip2 format
|
||||
.TP
|
||||
\fB\-\-gz=\fR<command>
|
||||
set compressor and options for gzip format
|
||||
.TP
|
||||
\fB\-\-lz=\fR<command>
|
||||
set compressor and options for lzip format
|
||||
.TP
|
||||
\fB\-\-xz=\fR<command>
|
||||
set compressor and options for xz format
|
||||
.SH "REPORTING BUGS"
|
||||
Report bugs to zutils\-bug@nongnu.org
|
||||
.br
|
||||
|
|
32
doc/zcmp.1
32
doc/zcmp.1
|
@ -1,5 +1,5 @@
|
|||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
|
||||
.TH ZCMP "1" "May 2013" "Zcmp (zutils) 1.0" "User Commands"
|
||||
.TH ZCMP "1" "July 2013" "Zcmp (zutils) 1.1-rc2" "User Commands"
|
||||
.SH NAME
|
||||
Zcmp \- decompress and compare two files byte by byte
|
||||
.SH SYNOPSIS
|
||||
|
@ -9,19 +9,22 @@ Zcmp \- decompress and compare two files byte by byte
|
|||
Zcmp compares two files ("\-" means standard input), and if they
|
||||
differ, tells the first byte and line number where they differ. Bytes
|
||||
and lines are numbered starting with 1. If any given file is compressed,
|
||||
its uncompressed content is used. Compressed files are uncompressed on
|
||||
its decompressed content is used. Compressed files are decompressed on
|
||||
the fly; no temporary files are created.
|
||||
.PP
|
||||
The supported formats are bzip2, gzip, lzip and xz.
|
||||
.PP
|
||||
Compares <file1> to <file2>. If <file2> is omitted zcmp tries the
|
||||
following:
|
||||
If <file1> is compressed, compares <file1> to the file with the
|
||||
corresponding decompressed file name (removes the extension from
|
||||
<file1>).
|
||||
If <file1> is not compressed, compares <file1> to the uncompressed
|
||||
.IP
|
||||
1. If <file1> is compressed, compares its decompressed contents with
|
||||
the corresponding uncompressed file (the name of <file1> with the
|
||||
extension removed).
|
||||
.IP
|
||||
2. If <file1> is uncompressed, compares it with the decompressed
|
||||
contents of <file1>.[lz|bz2|gz|xz] (the first one that is found).
|
||||
If no suitable file is found, compares <file1> to data read from
|
||||
.IP
|
||||
3. If no suitable file is found, compares <file1> with data read from
|
||||
standard input.
|
||||
.PP
|
||||
Exit status is 0 if inputs are identical, 1 if different, 2 if trouble.
|
||||
|
@ -48,6 +51,9 @@ list position, value of all differing bytes
|
|||
\fB\-n\fR, \fB\-\-bytes=\fR<n>
|
||||
compare at most <n> bytes
|
||||
.TP
|
||||
\fB\-N\fR, \fB\-\-no\-rcfile\fR
|
||||
don't read runtime configuration file
|
||||
.TP
|
||||
\fB\-q\fR, \fB\-\-quiet\fR
|
||||
suppress all messages
|
||||
.TP
|
||||
|
@ -56,6 +62,18 @@ suppress all messages
|
|||
.TP
|
||||
\fB\-v\fR, \fB\-\-verbose\fR
|
||||
verbose mode (same as \fB\-\-list\fR)
|
||||
.TP
|
||||
\fB\-\-bz2=\fR<command>
|
||||
set compressor and options for bzip2 format
|
||||
.TP
|
||||
\fB\-\-gz=\fR<command>
|
||||
set compressor and options for gzip format
|
||||
.TP
|
||||
\fB\-\-lz=\fR<command>
|
||||
set compressor and options for lzip format
|
||||
.TP
|
||||
\fB\-\-xz=\fR<command>
|
||||
set compressor and options for xz format
|
||||
.PP
|
||||
Numbers may be followed by a multiplier: k = kB = 10^3 = 1000,
|
||||
Ki = KiB = 2^10 = 1024, M = 10^6, Mi = 2^20, G = 10^9, Gi = 2^30, etc...
|
||||
|
|
32
doc/zdiff.1
32
doc/zdiff.1
|
@ -1,5 +1,5 @@
|
|||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
|
||||
.TH ZDIFF "1" "May 2013" "Zdiff (zutils) 1.0" "User Commands"
|
||||
.TH ZDIFF "1" "July 2013" "Zdiff (zutils) 1.1-rc2" "User Commands"
|
||||
.SH NAME
|
||||
Zdiff \- decompress and compare two files line by line
|
||||
.SH SYNOPSIS
|
||||
|
@ -8,7 +8,7 @@ Zdiff \- decompress and compare two files line by line
|
|||
.SH DESCRIPTION
|
||||
Zdiff compares two files ("\-" means standard input), and if they
|
||||
differ, shows the differences line by line. If any given file is
|
||||
compressed, its uncompressed content is used. Zdiff is a front end to
|
||||
compressed, its decompressed content is used. Zdiff is a front end to
|
||||
the diff program and has the limitation that messages from diff refer to
|
||||
temporary filenames instead of those specified.
|
||||
.PP
|
||||
|
@ -16,12 +16,15 @@ The supported formats are bzip2, gzip, lzip and xz.
|
|||
.PP
|
||||
Compares <file1> to <file2>. If <file2> is omitted zdiff tries the
|
||||
following:
|
||||
If <file1> is compressed, compares <file1> to the file with the
|
||||
corresponding decompressed file name (removes the extension from
|
||||
<file1>).
|
||||
If <file1> is not compressed, compares <file1> to the uncompressed
|
||||
.IP
|
||||
1. If <file1> is compressed, compares its decompressed contents with
|
||||
the corresponding uncompressed file (the name of <file1> with the
|
||||
extension removed).
|
||||
.IP
|
||||
2. If <file1> is uncompressed, compares it with the decompressed
|
||||
contents of <file1>.[lz|bz2|gz|xz] (the first one that is found).
|
||||
If no suitable file is found, compares <file1> to data read from
|
||||
.IP
|
||||
3. If no suitable file is found, compares <file1> with data read from
|
||||
standard input.
|
||||
.PP
|
||||
Exit status is 0 if inputs are identical, 1 if different, 2 if trouble.
|
||||
|
@ -60,6 +63,9 @@ force given formats (bz2, gz, lz, xz)
|
|||
\fB\-i\fR, \fB\-\-ignore\-case\fR
|
||||
ignore case differences in file contents
|
||||
.TP
|
||||
\fB\-N\fR, \fB\-\-no\-rcfile\fR
|
||||
don't read runtime configuration file
|
||||
.TP
|
||||
\fB\-p\fR, \fB\-\-show\-c\-function\fR
|
||||
show which C function each change is in
|
||||
.TP
|
||||
|
@ -83,6 +89,18 @@ same as \fB\-u\fR but use <n> lines of context
|
|||
.TP
|
||||
\fB\-w\fR, \fB\-\-ignore\-all\-space\fR
|
||||
ignore all white space
|
||||
.TP
|
||||
\fB\-\-bz2=\fR<command>
|
||||
set compressor and options for bzip2 format
|
||||
.TP
|
||||
\fB\-\-gz=\fR<command>
|
||||
set compressor and options for gzip format
|
||||
.TP
|
||||
\fB\-\-lz=\fR<command>
|
||||
set compressor and options for lzip format
|
||||
.TP
|
||||
\fB\-\-xz=\fR<command>
|
||||
set compressor and options for xz format
|
||||
.PP
|
||||
Numbers may be followed by a multiplier: k = kB = 10^3 = 1000,
|
||||
Ki = KiB = 2^10 = 1024, M = 10^6, Mi = 2^20, G = 10^9, Gi = 2^30, etc...
|
||||
|
|
21
doc/zgrep.1
21
doc/zgrep.1
|
@ -1,5 +1,5 @@
|
|||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
|
||||
.TH ZGREP "1" "May 2013" "Zgrep (zutils) 1.0" "User Commands"
|
||||
.TH ZGREP "1" "July 2013" "Zgrep (zutils) 1.1-rc2" "User Commands"
|
||||
.SH NAME
|
||||
Zgrep \- search compressed files for a regular expression
|
||||
.SH SYNOPSIS
|
||||
|
@ -7,8 +7,8 @@ Zgrep \- search compressed files for a regular expression
|
|||
[\fIoptions\fR] \fI<pattern> \fR[\fIfiles\fR]
|
||||
.SH DESCRIPTION
|
||||
Zgrep is a front end to the grep program that allows transparent search
|
||||
on any combination of compressed and non\-compressed files. If any given
|
||||
file is compressed, its uncompressed content is used. If a given file
|
||||
on any combination of compressed and uncompressed files. If any given
|
||||
file is compressed, its decompressed content is used. If a given file
|
||||
does not exist, and its name does not end with one of the known
|
||||
extensions, zgrep tries the compressed file names corresponding to the
|
||||
supported formats. If no files are specified, data is read from
|
||||
|
@ -84,6 +84,9 @@ stop after <n> matches
|
|||
\fB\-n\fR, \fB\-\-line\-number\fR
|
||||
print the line number of each line
|
||||
.TP
|
||||
\fB\-N\fR, \fB\-\-no\-rcfile\fR
|
||||
don't read runtime configuration file
|
||||
.TP
|
||||
\fB\-o\fR, \fB\-\-only\-matching\fR
|
||||
show only the part of a line matching <pattern>
|
||||
.TP
|
||||
|
@ -107,6 +110,18 @@ match only whole words
|
|||
.TP
|
||||
\fB\-x\fR, \fB\-\-line\-regexp\fR
|
||||
match only whole lines
|
||||
.TP
|
||||
\fB\-\-bz2=\fR<command>
|
||||
set compressor and options for bzip2 format
|
||||
.TP
|
||||
\fB\-\-gz=\fR<command>
|
||||
set compressor and options for gzip format
|
||||
.TP
|
||||
\fB\-\-lz=\fR<command>
|
||||
set compressor and options for lzip format
|
||||
.TP
|
||||
\fB\-\-xz=\fR<command>
|
||||
set compressor and options for xz format
|
||||
.SH "REPORTING BUGS"
|
||||
Report bugs to zutils\-bug@nongnu.org
|
||||
.br
|
||||
|
|
23
doc/ztest.1
23
doc/ztest.1
|
@ -1,5 +1,5 @@
|
|||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
|
||||
.TH ZTEST "1" "May 2013" "Ztest (zutils) 1.0" "User Commands"
|
||||
.TH ZTEST "1" "July 2013" "Ztest (zutils) 1.1-rc2" "User Commands"
|
||||
.SH NAME
|
||||
Ztest \- verify integrity of compressed files
|
||||
.SH SYNOPSIS
|
||||
|
@ -7,9 +7,9 @@ Ztest \- verify integrity of compressed files
|
|||
[\fIoptions\fR] [\fIfiles\fR]
|
||||
.SH DESCRIPTION
|
||||
Ztest verifies the integrity of the specified compressed files.
|
||||
Non\-compressed files are ignored. If no files are specified, the
|
||||
integrity of compressed data read from standard input is verified. Data
|
||||
read from standard input must be all in the same compression format.
|
||||
Uncompressed files are ignored. If no files are specified, the integrity
|
||||
of compressed data read from standard input is verified. Data read from
|
||||
standard input must be all in the same compression format.
|
||||
.PP
|
||||
The supported formats are bzip2, gzip, lzip and xz.
|
||||
.PP
|
||||
|
@ -30,6 +30,9 @@ output version information and exit
|
|||
\fB\-\-format=\fR<fmt>
|
||||
force given format (bz2, gz, lz, xz)
|
||||
.TP
|
||||
\fB\-N\fR, \fB\-\-no\-rcfile\fR
|
||||
don't read runtime configuration file
|
||||
.TP
|
||||
\fB\-q\fR, \fB\-\-quiet\fR
|
||||
suppress all messages
|
||||
.TP
|
||||
|
@ -38,6 +41,18 @@ operate recursively on directories
|
|||
.TP
|
||||
\fB\-v\fR, \fB\-\-verbose\fR
|
||||
be verbose (a 2nd \fB\-v\fR gives more)
|
||||
.TP
|
||||
\fB\-\-bz2=\fR<command>
|
||||
set compressor and options for bzip2 format
|
||||
.TP
|
||||
\fB\-\-gz=\fR<command>
|
||||
set compressor and options for gzip format
|
||||
.TP
|
||||
\fB\-\-lz=\fR<command>
|
||||
set compressor and options for lzip format
|
||||
.TP
|
||||
\fB\-\-xz=\fR<command>
|
||||
set compressor and options for xz format
|
||||
.SH "REPORTING BUGS"
|
||||
Report bugs to zutils\-bug@nongnu.org
|
||||
.br
|
||||
|
|
202
doc/zutils.info
202
doc/zutils.info
|
@ -12,18 +12,20 @@ File: zutils.info, Node: Top, Next: Introduction, Up: (dir)
|
|||
Zutils Manual
|
||||
*************
|
||||
|
||||
This manual is for Zutils (version 1.0, 31 May 2013).
|
||||
This manual is for Zutils (version 1.1-rc2, 7 July 2013).
|
||||
|
||||
* Menu:
|
||||
|
||||
* Introduction:: Purpose and features of zutils
|
||||
* Common options:: Common options
|
||||
* The zutilsrc file:: The zutils configuration file
|
||||
* Zcat:: Concatenating compressed files
|
||||
* Zcmp:: Comparing compressed files byte by byte
|
||||
* Zdiff:: Comparing compressed files line by line
|
||||
* Zgrep:: Searching inside compressed files
|
||||
* Ztest:: Testing integrity of compressed files
|
||||
* Problems:: Reporting bugs
|
||||
* Concept Index:: Index of concepts
|
||||
* Concept index:: Index of concepts
|
||||
|
||||
|
||||
Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
|
||||
|
@ -32,14 +34,14 @@ This manual is for Zutils (version 1.0, 31 May 2013).
|
|||
copy, distribute and modify it.
|
||||
|
||||
|
||||
File: zutils.info, Node: Introduction, Next: Zcat, Prev: Top, Up: Top
|
||||
File: zutils.info, Node: Introduction, Next: Common options, Prev: Top, Up: Top
|
||||
|
||||
1 Introduction
|
||||
**************
|
||||
|
||||
Zutils is a collection of utilities able to deal with any combination of
|
||||
compressed and non-compressed files transparently. If any given file,
|
||||
including standard input, is compressed, its uncompressed content is
|
||||
compressed and uncompressed files transparently. If any given file,
|
||||
including standard input, is compressed, its decompressed content is
|
||||
used. Compressed files are decompressed on the fly; no temporary files
|
||||
are created.
|
||||
|
||||
|
@ -49,6 +51,7 @@ in those utilities supporting it.
|
|||
|
||||
The provided utilities are zcat, zcmp, zdiff, zgrep and ztest.
|
||||
The supported formats are bzip2, gzip, lzip and xz.
|
||||
The compressor to be used for each format is configurable at runtime.
|
||||
|
||||
Zcat, zcmp, zdiff, and zgrep are improved replacements for the shell
|
||||
scripts provided with GNU gzip. Ztest is unique to zutils.
|
||||
|
@ -57,6 +60,10 @@ scripts provided with GNU gzip. Ztest is unique to zutils.
|
|||
which makes them safe to use with zutils. Gzip and xz may return
|
||||
ambiguous warning values, making them less reliable backends for zutils.
|
||||
|
||||
LANGUAGE NOTE: Uncompressed = not compressed = plain data; it may
|
||||
never have been compressed. Decompressed is used to refer to data which
|
||||
has undergone the process of decompression.
|
||||
|
||||
|
||||
Numbers given as arguments to options (positions, sizes) may be
|
||||
followed by a multiplier and an optional `B' for "byte".
|
||||
|
@ -74,13 +81,81 @@ Z zettabyte (10^21) | Zi zebibyte (2^70)
|
|||
Y yottabyte (10^24) | Yi yobibyte (2^80)
|
||||
|
||||
|
||||
File: zutils.info, Node: Zcat, Next: Zcmp, Prev: Introduction, Up: Top
|
||||
File: zutils.info, Node: Common options, Next: The zutilsrc file, Prev: Introduction, Up: Top
|
||||
|
||||
2 Zcat
|
||||
2 Common options
|
||||
****************
|
||||
|
||||
The following options are available in all the utilities. Rather than
|
||||
writing identical descriptions for each of the programs, they are
|
||||
described here.
|
||||
|
||||
`-h'
|
||||
`--help'
|
||||
Print an informative help message describing the options and exit.
|
||||
Zgrep only supports the `--help' form of this option.
|
||||
|
||||
`-V'
|
||||
`--version'
|
||||
Print the version number on the standard output and exit.
|
||||
|
||||
`-N'
|
||||
`--no-rcfile'
|
||||
Don't read the runtime configuration file `zutilsrc'.
|
||||
|
||||
`--bz2=COMMAND'
|
||||
`--gz=COMMAND'
|
||||
`--lz=COMMAND'
|
||||
`--xz=COMMAND'
|
||||
Set program (may include arguments) to be used as (de)compressor
|
||||
for the given format. These options override the values set in
|
||||
`zutilsrc'. The compression program used must meet three
|
||||
requirements:
|
||||
|
||||
1. When called with the `-d' option, it must read compressed
|
||||
data from the standard input and produce decompressed data on
|
||||
the standard output.
|
||||
|
||||
2. If the `-q' option is passed to zutils, the compression
|
||||
program must also accept it.
|
||||
|
||||
3. It must return 0 if no errors occurred, and a non-zero value
|
||||
otherwise.
|
||||
|
||||
|
||||
|
||||
File: zutils.info, Node: The zutilsrc file, Next: Zcat, Prev: Common options, Up: Top
|
||||
|
||||
3 The zutilsrc file
|
||||
*******************
|
||||
|
||||
`zutilsrc' is the runtime configuration file for zutils. In it you may
|
||||
define the compressor name and options to be used for each format. The
|
||||
`zutilsrc' file is optional; you do not need to install it in order to
|
||||
run zutils.
|
||||
|
||||
The compressors specified in the command line override those
|
||||
specified in the `zutilsrc' file.
|
||||
|
||||
You may copy the system `zutilsrc' file `${sysconfdir}/zutilsrc' to
|
||||
`$HOME/.zutilsrc' and customize these options as you like. The file
|
||||
syntax is fairly obvious (and there are further instructions in it):
|
||||
|
||||
1. Any line beginning with `#' is a comment line.
|
||||
|
||||
2. Each non-comment line defines the command to be used for the given
|
||||
format, with the syntax:
|
||||
<format> = <compressor> [options]
|
||||
where <format> is one of `bz2', `gz', `lz' or `xz'.
|
||||
|
||||
|
||||
File: zutils.info, Node: Zcat, Next: Zcmp, Prev: The zutilsrc file, Up: Top
|
||||
|
||||
4 Zcat
|
||||
******
|
||||
|
||||
Zcat copies each given file (`-' means standard input), to standard
|
||||
output. If any given file is compressed, its uncompressed content is
|
||||
output. If any given file is compressed, its decompressed content is
|
||||
used. If a given file does not exist, and its name does not end with one
|
||||
of the known extensions, zcat tries the compressed file names
|
||||
corresponding to the supported formats.
|
||||
|
@ -94,18 +169,10 @@ same compression format.
|
|||
|
||||
zcat [OPTIONS] [FILES]
|
||||
|
||||
Exit status is 0 if no errors occurred, 1 otherwise.
|
||||
Exit status is 0 if no errors occurred, non-zero otherwise.
|
||||
|
||||
Zcat supports the following options:
|
||||
|
||||
`-h'
|
||||
`--help'
|
||||
Print an informative help message describing the options and exit.
|
||||
|
||||
`-V'
|
||||
`--version'
|
||||
Print the version number of zcat on the standard output and exit.
|
||||
|
||||
`-A'
|
||||
`--show-all'
|
||||
Equivalent to `-vET'.
|
||||
|
@ -164,13 +231,13 @@ Exit status is 0 if no errors occurred, 1 otherwise.
|
|||
|
||||
File: zutils.info, Node: Zcmp, Next: Zdiff, Prev: Zcat, Up: Top
|
||||
|
||||
3 Zcmp
|
||||
5 Zcmp
|
||||
******
|
||||
|
||||
Zcmp compares two files (`-' means standard input), and if they differ,
|
||||
tells the first byte and line number where they differ. Bytes and lines
|
||||
are numbered starting with 1. If any given file is compressed, its
|
||||
uncompressed content is used. Compressed files are decompressed on the
|
||||
decompressed content is used. Compressed files are decompressed on the
|
||||
fly; no temporary files are created.
|
||||
|
||||
The format for running zcmp is:
|
||||
|
@ -180,14 +247,14 @@ fly; no temporary files are created.
|
|||
This compares FILE1 to FILE2. If FILE2 is omitted zcmp tries the
|
||||
following:
|
||||
|
||||
1. If FILE1 is compressed, compares FILE1 to the file with the
|
||||
corresponding decompressed file name (removes the extension from
|
||||
FILE1).
|
||||
1. If FILE1 is compressed, compares its decompressed contents with
|
||||
the corresponding uncompressed file (the name of FILE1 with the
|
||||
extension removed).
|
||||
|
||||
2. If FILE1 is not compressed, compares FILE1 to the uncompressed
|
||||
2. If FILE1 is uncompressed, compares it with the decompressed
|
||||
contents of FILE1.[lz|bz2|gz|xz] (the first one that is found).
|
||||
|
||||
3. If no suitable file is found, compares FILE1 to data read from
|
||||
3. If no suitable file is found, compares FILE1 with data read from
|
||||
standard input.
|
||||
|
||||
An exit status of 0 means no differences were found, 1 means some
|
||||
|
@ -195,14 +262,6 @@ differences were found, and 2 means trouble.
|
|||
|
||||
Zcmp supports the following options:
|
||||
|
||||
`-h'
|
||||
`--help'
|
||||
Print an informative help message describing the options and exit.
|
||||
|
||||
`-V'
|
||||
`--version'
|
||||
Print the version number of zcmp on the standard output and exit.
|
||||
|
||||
`-b'
|
||||
`--print-bytes'
|
||||
Print the differing bytes. Print control bytes as a `^' followed by
|
||||
|
@ -247,12 +306,12 @@ differences were found, and 2 means trouble.
|
|||
|
||||
File: zutils.info, Node: Zdiff, Next: Zgrep, Prev: Zcmp, Up: Top
|
||||
|
||||
4 Zdiff
|
||||
6 Zdiff
|
||||
*******
|
||||
|
||||
Zdiff compares two files (`-' means standard input), and if they
|
||||
differ, shows the differences line by line. If any given file is
|
||||
compressed, its uncompressed content is used. Zdiff is a front end to
|
||||
compressed, its decompressed content is used. Zdiff is a front end to
|
||||
the diff program and has the limitation that messages from diff refer to
|
||||
temporary filenames instead of those specified.
|
||||
|
||||
|
@ -263,14 +322,14 @@ temporary filenames instead of those specified.
|
|||
This compares FILE1 to FILE2. If FILE2 is omitted zdiff tries the
|
||||
following:
|
||||
|
||||
1. If FILE1 is compressed, compares FILE1 to the file with the
|
||||
corresponding decompressed file name (removes the extension from
|
||||
FILE1).
|
||||
1. If FILE1 is compressed, compares its decompressed contents with
|
||||
the corresponding uncompressed file (the name of FILE1 with the
|
||||
extension removed).
|
||||
|
||||
2. If FILE1 is not compressed, compares FILE1 to the uncompressed
|
||||
2. If FILE1 is uncompressed, compares it with the decompressed
|
||||
contents of FILE1.[lz|bz2|gz|xz] (the first one that is found).
|
||||
|
||||
3. If no suitable file is found, compares FILE1 to data read from
|
||||
3. If no suitable file is found, compares FILE1 with data read from
|
||||
standard input.
|
||||
|
||||
An exit status of 0 means no differences were found, 1 means some
|
||||
|
@ -278,14 +337,6 @@ differences were found, and 2 means trouble.
|
|||
|
||||
Zdiff supports the following options:
|
||||
|
||||
`-h'
|
||||
`--help'
|
||||
Print an informative help message describing the options and exit.
|
||||
|
||||
`-V'
|
||||
`--version'
|
||||
Print the version number of zdiff on the standard output and exit.
|
||||
|
||||
`-a'
|
||||
`--text'
|
||||
Treat all files as text.
|
||||
|
@ -360,12 +411,12 @@ differences were found, and 2 means trouble.
|
|||
|
||||
File: zutils.info, Node: Zgrep, Next: Ztest, Prev: Zdiff, Up: Top
|
||||
|
||||
5 Zgrep
|
||||
7 Zgrep
|
||||
*******
|
||||
|
||||
Zgrep is a front end to the grep program that allows transparent search
|
||||
on any combination of compressed and non-compressed files. If any given
|
||||
file is compressed, its uncompressed content is used. If a given file
|
||||
on any combination of compressed and uncompressed files. If any given
|
||||
file is compressed, its decompressed content is used. If a given file
|
||||
does not exist, and its name does not end with one of the known
|
||||
extensions, zgrep tries the compressed file names corresponding to the
|
||||
supported formats.
|
||||
|
@ -384,13 +435,6 @@ matches were found, and 2 means trouble.
|
|||
|
||||
Zgrep supports the following options:
|
||||
|
||||
`--help'
|
||||
Print an informative help message describing the options and exit.
|
||||
|
||||
`-V'
|
||||
`--version'
|
||||
Print the version number of zgrep on the standard output and exit.
|
||||
|
||||
`-a'
|
||||
`--text'
|
||||
Treat all files as text.
|
||||
|
@ -503,13 +547,13 @@ matches were found, and 2 means trouble.
|
|||
|
||||
File: zutils.info, Node: Ztest, Next: Problems, Prev: Zgrep, Up: Top
|
||||
|
||||
6 Ztest
|
||||
8 Ztest
|
||||
*******
|
||||
|
||||
Ztest verifies the integrity of the specified compressed files.
|
||||
Non-compressed files are ignored. If no files are specified, the
|
||||
integrity of compressed data read from standard input is verified. Data
|
||||
read from standard input must be all in the same compression format.
|
||||
Uncompressed files are ignored. If no files are specified, the integrity
|
||||
of compressed data read from standard input is verified. Data read from
|
||||
standard input must be all in the same compression format.
|
||||
|
||||
Note that some xz files lack integrity information, and therefore
|
||||
can't be verified as reliably as the other formats can.
|
||||
|
@ -524,14 +568,6 @@ environmental problems (file not found, invalid flags, I/O errors, etc),
|
|||
|
||||
Ztest supports the following options:
|
||||
|
||||
`-h'
|
||||
`--help'
|
||||
Print an informative help message describing the options and exit.
|
||||
|
||||
`-V'
|
||||
`--version'
|
||||
Print the version number of ztest on the standard output and exit.
|
||||
|
||||
`--format=FMT'
|
||||
Force the given compression format. Valid values for FMT are
|
||||
`bz2', `gz', `lz' and `xz'. If this option is used, all files not
|
||||
|
@ -552,9 +588,9 @@ environmental problems (file not found, invalid flags, I/O errors, etc),
|
|||
|
||||
|
||||
|
||||
File: zutils.info, Node: Problems, Next: Concept Index, Prev: Ztest, Up: Top
|
||||
File: zutils.info, Node: Problems, Next: Concept index, Prev: Ztest, Up: Top
|
||||
|
||||
7 Reporting Bugs
|
||||
9 Reporting Bugs
|
||||
****************
|
||||
|
||||
There are probably bugs in zutils. There are certainly errors and
|
||||
|
@ -567,17 +603,19 @@ for all eternity, if not longer.
|
|||
by running `zutils --version'.
|
||||
|
||||
|
||||
File: zutils.info, Node: Concept Index, Prev: Problems, Up: Top
|
||||
File: zutils.info, Node: Concept index, Prev: Problems, Up: Top
|
||||
|
||||
Concept Index
|
||||
Concept index
|
||||
*************
|
||||
|
||||
|