From 5a7a494ba28f0dfaa5792f70585ca4dfe3c3051a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 8 Dec 2022 16:52:49 +0100 Subject: Merging upstream version 1.12~rc1. Signed-off-by: Daniel Baumann --- ChangeLog | 34 +++- INSTALL | 10 +- Makefile.in | 10 +- NEWS | 50 +++++- README | 3 +- configure | 13 +- doc/zcat.1 | 7 +- doc/zcmp.1 | 26 ++-- doc/zdiff.1 | 7 +- doc/zgrep.1 | 7 +- doc/ztest.1 | 29 ++-- doc/zupdate.1 | 11 +- doc/zutils.info | 366 +++++++++++++++++++++++++++---------------- doc/zutils.texi | 424 +++++++++++++++++++++++++++++++------------------- rc.cc | 88 +++++++---- rc.h | 21 ++- recursive.cc | 2 +- testsuite/check.sh | 149 ++++++++++++------ testsuite/zcat_vs.dat | 4 +- zcat.cc | 24 +-- zcmp.cc | 148 +++++++++--------- zcmpdiff.cc | 12 +- zdiff.cc | 55 +++---- zgrep.cc | 40 +++-- ztest.cc | 63 +++++--- zupdate.cc | 157 +++++++++++++------ zutils.cc | 14 +- zutils.conf | 18 +++ zutils.h | 5 +- zutilsrc | 17 -- 30 files changed, 1136 insertions(+), 678 deletions(-) create mode 100644 zutils.conf delete mode 100644 zutilsrc diff --git a/ChangeLog b/ChangeLog index 4f12393..90840c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,29 @@ +2022-12-05 Antonio Diaz Diaz + + * Version 1.12-rc1 released. + * zutilsrc: Rename to zutils.conf. Search for it in $XDG_CONFIG_HOME. + (Suggested by Adam Tuja). + * Allow '-O, --force-format' force also uncompressed format. + * zcmp.cc: New option '-H, --hexadecimal'. + Change long name of option '-s' to '--script'. + (Following a similar change made to GNU ed). + Assign short name '-q' to options '--quiet' and '--silent'. + Separate option '-l, --list' from '-v, --verbose'. + (cmp): Print byte and line in EOF message like GNU cmp. + * ztest.cc: Exit with status 2 if a file has wrong extension. + * zupdate.cc: New option '-d, --destdir'. + (zupdate_file): Pass '-q -s' to zcmp if verbosity < 0. + * rc.cc (show_version): Print the versions of the compressors used. + (show_option_error): New function showing argument and option name. + * zutils.texi: Document that format is detected by its magic bytes. + * check.sh: Test tarlz (if available) as compressor for zupdate. + 2022-04-12 Antonio Diaz Diaz * Version 1.12-pre2 released. * zgrep.cc: Accept option '-Z, --null'. (Reported by Leah Neukirchen). * zupdate.cc: New options '-e, --expand-extensions', - '-i, --ignore-errors'. + '-i, --ignore-errors'. ('-i' suggested by Antoni Sawicki). * Support compress'd (.Z) files through gzip in all utilities. 2022-03-06 Antonio Diaz Diaz @@ -126,13 +146,13 @@ * Version 1.0 released. * Add new option '--format' to all utilities. - * main.cc (main): Make 'grep_show_name' tri-state so that file - name is no prefixed to output by default when searching one - file and '--recursive' has not been selected. + * main.cc (main): Make 'grep_show_name' tri-state so that file name + is not prefixed to the output by default when searching one file + and '--recursive' has not been selected. * zgrep.cc: Fix output of option '-L' (it behaved like '-l'). * zcmp.cc: Fix deadlock when option '-n' is used. - * zdiff.cc (set_data_feeder): Call compressor with option '-q' - only if verbosity < 0. + * zdiff.cc (set_data_feeder): Call compressor with option '-q' only + if verbosity < 0. * zutils.cc (set_data_feeder): Likewise. * Change quote characters in messages as advised by GNU Standards. * configure: Options now accept a separate argument. @@ -145,7 +165,7 @@ 2011-01-11 Antonio Diaz Diaz * Version 0.9 released. - * configure: New options 'DIFF' and 'GREP'. + * configure: New variables 'DIFF' and 'GREP'. * zcmp.cc: Fix deadlock when files differ. * zgrep.cc: Fix deadlock when binary file matches. diff --git a/INSTALL b/INSTALL index a5f5afe..91f1f39 100644 --- a/INSTALL +++ b/INSTALL @@ -1,6 +1,6 @@ Requirements ------------ -You will need a C++98 compiler with suport for 'long long'. +You will need a C++98 compiler with support for 'long long'. (gcc 3.3.6 or newer is recommended). I use gcc 6.1.0 and 3.3.6, but the code should compile with any standards compliant compiler. @@ -32,8 +32,8 @@ Procedure or lzip -cd zutils[version].tar.lz | tar -xf - -This creates the directory ./zutils[version] containing the source from -the main archive. +This creates the directory ./zutils[version] containing the source code +extracted from the archive. 2. Change to zutils directory and run configure. (Try 'configure --help' for usage instructions). @@ -68,8 +68,8 @@ object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in '.', in '..', and in the directory that 'configure' is in. -'configure' recognizes the option '--srcdir=DIR' to control where to -look for the sources. Usually 'configure' can determine that directory +'configure' recognizes the option '--srcdir=DIR' to control where to look +for the source code. Usually 'configure' can determine that directory automatically. After running 'configure', you can run 'make' and 'make install' as diff --git a/Makefile.in b/Makefile.in index d02d15d..fbd7102 100644 --- a/Makefile.in +++ b/Makefile.in @@ -84,7 +84,7 @@ doc : info man info : $(VPATH)/doc/$(pkgname).info $(VPATH)/doc/$(pkgname).info : $(VPATH)/doc/$(pkgname).texi - cd $(VPATH)/doc && makeinfo $(pkgname).texi + cd $(VPATH)/doc && $(MAKEINFO) $(pkgname).texi man : $(VPATH)/doc/zcat.1 $(VPATH)/doc/zcmp.1 $(VPATH)/doc/zdiff.1 \ $(VPATH)/doc/zgrep.1 $(VPATH)/doc/ztest.1 $(VPATH)/doc/zupdate.1 @@ -134,9 +134,9 @@ install-bin : all $(INSTALL_PROGRAM) ./zgrep "$(DESTDIR)$(bindir)/zgrep" $(INSTALL_PROGRAM) ./ztest "$(DESTDIR)$(bindir)/ztest" $(INSTALL_PROGRAM) ./zupdate "$(DESTDIR)$(bindir)/zupdate" - if [ ! -e "$(DESTDIR)$(sysconfdir)/$(pkgname)rc" ] ; then \ + if [ ! -e "$(DESTDIR)$(sysconfdir)/$(pkgname).conf" ] ; then \ if [ ! -d "$(DESTDIR)$(sysconfdir)" ] ; then $(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)" ; fi ; \ - $(INSTALL_DATA) $(VPATH)/$(pkgname)rc "$(DESTDIR)$(sysconfdir)/$(pkgname)rc" ; \ + $(INSTALL_DATA) $(VPATH)/$(pkgname).conf "$(DESTDIR)$(sysconfdir)/$(pkgname).conf" ; \ fi install-bin-strip : all @@ -187,7 +187,7 @@ uninstall-bin : -rm -f "$(DESTDIR)$(bindir)/zgrep" -rm -f "$(DESTDIR)$(bindir)/ztest" -rm -f "$(DESTDIR)$(bindir)/zupdate" - -rm -f "$(DESTDIR)$(sysconfdir)/$(pkgname)rc" + -rm -f "$(DESTDIR)$(sysconfdir)/$(pkgname).conf" uninstall-info : -if $(CAN_RUN_INSTALLINFO) ; then \ @@ -217,7 +217,7 @@ dist : doc $(DISTNAME)/doc/*.1 \ $(DISTNAME)/doc/$(pkgname).info \ $(DISTNAME)/doc/$(pkgname).texi \ - $(DISTNAME)/$(pkgname)rc \ + $(DISTNAME)/$(pkgname).conf \ $(DISTNAME)/*.h \ $(DISTNAME)/*.cc \ $(DISTNAME)/z*.in \ diff --git a/NEWS b/NEWS index a4bee06..b2f8ed9 100644 --- a/NEWS +++ b/NEWS @@ -1,16 +1,64 @@ Changes in version 1.12: +The zutils configuration file 'zutilsrc' has been renamed to 'zutils.conf'. +Zutils now looks for the configuration file in $XDG_CONFIG_HOME/zutils.conf +instead of $HOME/.zutilsrc. (XDG_CONFIG_HOME defaults to $HOME/.config). +(Suggested by Adam Tuja). + +In zcat, zcmp, zdiff, and zgrep, the option '-O, --force-format' now can +force also "uncompressed" format. + +zcmp now accepts the option '-H, --hexadecimal' to print byte values in +hexadecimal instead of octal. + +In zcmp: + The long name of option '-s' has been changed to '--script' following a + similar change made to GNU ed. + + The short name '-q' has been assigned to options '--quiet' and '--silent'. + + Option '-q' now only suppresses diagnostic messages written to stderr. + + Option '-s' now only suppresses messages about file differences written to + stdout or stderr. + + Option '-l, --list' is now different from option '-v, --verbose', which + now undoes the effect of '--quiet'. + +zcmp now prints byte and line in EOF message like GNU cmp: +"zcmp: EOF on FILE after byte B, in line L". + zgrep now also accepts the following options: '-G, --basic-regexp', '--label=