From 2fa0edbe051634f33687572c68fefc150ca3d499 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 31 Mar 2022 15:57:10 -0700 Subject: [PATCH 1/2] zless: install only on platforms with 'less' Problem reported by Michael Felt (Bug#30029). * Makefile.am (ZLESS_MAN, ZLESS_PROG): New macros. (man_MANS, bin_SCRIPTS): Use them. * configure.ac: Check for 'less'. * tests/Makefile.am (ZLESS_PROG): New macro. (built_programs): Use it. --- Makefile.am | 12 ++++++++++-- NEWS | 2 ++ configure.ac | 2 ++ tests/Makefile.am | 8 +++++++- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 92192ca..07f47a8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,8 +31,16 @@ noinst_LIBRARIES = libver.a nodist_libver_a_SOURCES = version.c version.h DISTCLEANFILES = version.c version.h +if LESS +ZLESS_MAN = zless.1 +ZLESS_PROG = zless +else +ZLESS_MAN = +ZLESS_PROG = +endif + man_MANS = gunzip.1 gzexe.1 gzip.1 \ - zcat.1 zcmp.1 zdiff.1 zforce.1 zgrep.1 zless.1 zmore.1 znew.1 + zcat.1 zcmp.1 zdiff.1 zforce.1 zgrep.1 $(ZLESS_MAN) zmore.1 znew.1 EXTRA_DIST = $(ACINCLUDE_INPUTS) $(man_MANS) \ ChangeLog-2007 \ @@ -49,7 +57,7 @@ noinst_HEADERS = gzip.h lzw.h bin_PROGRAMS = gzip bin_SCRIPTS = gunzip gzexe zcat zcmp zdiff \ - zegrep zfgrep zforce zgrep zless zmore znew + zegrep zfgrep zforce zgrep $(ZLESS_PROG) zmore znew gzip_SOURCES = \ bits.c deflate.c gzip.c inflate.c \ trees.c unlzh.c unlzw.c unpack.c unzip.c util.c zip.c diff --git a/NEWS b/NEWS index 05b4166..95ffe49 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,8 @@ GNU gzip NEWS -*- outline -*- much more time, nowadays the correctness pros seem to outweigh the performance cons. + 'zless' is no longer installed on platforms lacking 'less'. + ** Bug fixes 'zdiff -C 5' no longer misbehaves by treating '5' as a file name. diff --git a/configure.ac b/configure.ac index 074d81a..d9c77da 100644 --- a/configure.ac +++ b/configure.ac @@ -50,6 +50,8 @@ AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CPP AC_PROG_GREP +AC_CHECK_PROG([LESS], [less], [less]) +AM_CONDITIONAL([LESS], [test "$LESS"]) AC_CHECK_TOOL([NM], [nm], [nm]) AC_PROG_LN_S AC_PROG_RANLIB diff --git a/tests/Makefile.am b/tests/Makefile.am index 3b45afa..d09672e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -46,6 +46,12 @@ EXTRA_DIST = \ init.sh \ hufts-segv.gz +if LESS +ZLESS_PROG = zless +else +ZLESS_PROG = +endif + built_programs = \ gzip \ gunzip \ @@ -57,7 +63,7 @@ built_programs = \ zfgrep \ zforce \ zgrep \ - zless \ + $(ZLESS_PROG) \ zmore \ znew -- 2.32.0