summaryrefslogtreecommitdiff
path: root/usr.bin/gzip
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2014-11-19 01:07:58 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2014-11-19 01:07:58 +0000
commit9268022b74279434ed6300244e3f977e56a8ceb5 (patch)
tree377ac0ac449528621eb192cd245adadb5fd53668 /usr.bin/gzip
parent29c34e9d2781cf25403647fb5af7d7ddb23be7e1 (diff)
parent8c3d6a4ab2a4a95d864d9a32d0157d7de90498a4 (diff)
downloadsrc-test-9268022b74279434ed6300244e3f977e56a8ceb5.tar.gz
src-test-9268022b74279434ed6300244e3f977e56a8ceb5.zip
Merge from head@274682
Notes
Notes: svn path=/projects/bmake/; revision=274683
Diffstat (limited to 'usr.bin/gzip')
-rw-r--r--usr.bin/gzip/Makefile9
-rw-r--r--usr.bin/gzip/gzip.12
-rw-r--r--usr.bin/gzip/gzip.c8
-rw-r--r--usr.bin/gzip/tests/Makefile12
-rw-r--r--usr.bin/gzip/zmore15
-rw-r--r--usr.bin/gzip/zmore.128
6 files changed, 57 insertions, 17 deletions
diff --git a/usr.bin/gzip/Makefile b/usr.bin/gzip/Makefile
index 73724358a560b..24e250681cb88 100644
--- a/usr.bin/gzip/Makefile
+++ b/usr.bin/gzip/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.16 2011/06/21 13:25:45 joerg Exp $
+# $NetBSD: Makefile,v 1.18 2013/11/13 11:12:24 pettai Exp $
# $FreeBSD$
.include <src.opts.mk>
@@ -21,11 +21,16 @@ SCRIPTS= gzexe zdiff zforce zmore znew
MLINKS+= gzip.1 gunzip.1 \
gzip.1 gzcat.1 \
gzip.1 zcat.1 \
- zdiff.1 zcmp.1
+ zdiff.1 zcmp.1 \
+ zmore.1 zless.1
LINKS+= ${BINDIR}/gzip ${BINDIR}/gunzip \
${BINDIR}/gzip ${BINDIR}/gzcat \
${BINDIR}/gzip ${BINDIR}/zcat \
${BINDIR}/zdiff ${BINDIR}/zcmp
+.if ${MK_TESTS} != "no"
+SUBDIR+= tests
+.endif
+
.include <bsd.prog.mk>
diff --git a/usr.bin/gzip/gzip.1 b/usr.bin/gzip/gzip.1
index ba78bd060b30d..5abf1aef38f5f 100644
--- a/usr.bin/gzip/gzip.1
+++ b/usr.bin/gzip/gzip.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: gzip.1,v 1.21 2011/06/19 02:22:36 christos Exp $
+.\" $NetBSD: gzip.1,v 1.23 2014/03/18 18:20:45 riastradh Exp $
.\"
.\" Copyright (c) 1997, 2003, 2004 Matthew R. Green
.\" All rights reserved.
diff --git a/usr.bin/gzip/gzip.c b/usr.bin/gzip/gzip.c
index d7477dd4164a9..9f92b6af8108f 100644
--- a/usr.bin/gzip/gzip.c
+++ b/usr.bin/gzip/gzip.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gzip.c,v 1.105 2011/08/30 23:06:00 joerg Exp $ */
+/* $NetBSD: gzip.c,v 1.106 2014/10/18 08:33:30 snj Exp $ */
/*-
* Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green
@@ -158,7 +158,7 @@ static suffixes_t suffixes[] = {
#define NUM_SUFFIXES (sizeof suffixes / sizeof suffixes[0])
#define SUFFIX_MAXLEN 30
-static const char gzip_version[] = "FreeBSD gzip 20111009";
+static const char gzip_version[] = "FreeBSD gzip 20141022";
#ifndef SMALL
static const char gzip_copyright[] = \
@@ -1769,7 +1769,7 @@ handle_stdout(void)
return;
}
#endif
- /* If stdin is a file use it's mtime, otherwise use current time */
+ /* If stdin is a file use its mtime, otherwise use current time */
ret = fstat(STDIN_FILENO, &sb);
#ifndef SMALL
@@ -2110,7 +2110,7 @@ static void
display_license(void)
{
- fprintf(stderr, "%s (based on NetBSD gzip 20111009)\n", gzip_version);
+ fprintf(stderr, "%s (based on NetBSD gzip 20141018)\n", gzip_version);
fprintf(stderr, "%s\n", gzip_copyright);
exit(0);
}
diff --git a/usr.bin/gzip/tests/Makefile b/usr.bin/gzip/tests/Makefile
new file mode 100644
index 0000000000000..155d739f17bd5
--- /dev/null
+++ b/usr.bin/gzip/tests/Makefile
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+TESTSRC= ${.CURDIR}/../../../contrib/netbsd-tests/usr.bin/gzip
+.PATH: ${TESTSRC}
+
+.include <bsd.own.mk>
+
+TESTSDIR= ${TESTSBASE}/usr.bin/gzip
+ATF_TESTS_SH= gzip_test
+ATF_TESTS_SH_SRC_gzip_test= t_gzip.sh
+
+.include <bsd.test.mk>
diff --git a/usr.bin/gzip/zmore b/usr.bin/gzip/zmore
index 46a4eb482bda6..f5be0f4e55286 100644
--- a/usr.bin/gzip/zmore
+++ b/usr.bin/gzip/zmore
@@ -1,7 +1,8 @@
#!/bin/sh -
#
-# $NetBSD: zmore,v 1.3 2004/03/29 09:59:42 wiz Exp $
-# $OpenBSD: zmore,v 1.4 2003/07/29 07:42:45 otto Exp $
+# $NetBSD: zmore,v 1.5 2013/12/06 13:33:15 pettai Exp $
+#
+# $OpenBSD: zmore,v 1.6 2008/08/20 09:22:02 mpf Exp $
#
#-
# Copyright (c) 2003 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -42,15 +43,21 @@ while test $# -ne 0; do
esac
done
+if [ `basename $0` = "zless" ] ; then
+ pager=${PAGER-less}
+else
+ pager=${PAGER-more}
+fi
+
# No files means read from stdin
if [ $# -eq 0 ]; then
- gzip -cdfq 2>&1 | ${PAGER-more} $flags
+ gzip -cdfq 2>&1 | $pager $flags
exit 0
fi
oterm=`stty -g 2>/dev/null`
while test $# -ne 0; do
- gzip -cdfq "$1" 2>&1 | ${PAGER-more} $flags
+ gzip -cdfq "$1" 2>&1 | $pager $flags
prev="$1"
shift
if tty -s && test -n "$oterm" -a $# -gt 0; then
diff --git a/usr.bin/gzip/zmore.1 b/usr.bin/gzip/zmore.1
index b1f389c98c2a1..f8be1acbae7f2 100644
--- a/usr.bin/gzip/zmore.1
+++ b/usr.bin/gzip/zmore.1
@@ -1,5 +1,5 @@
-.\" $NetBSD: zmore.1,v 1.3 2003/12/28 12:47:52 wiz Exp $
-.\" $OpenBSD: zmore.1,v 1.3 2003/06/23 21:00:48 deraadt Exp $
+.\" $NetBSD: zmore.1,v 1.4 2013/11/12 21:58:37 pettai Exp $
+.\" $OpenBSD: zmore.1,v 1.10 2009/08/16 09:41:08 sobrado Exp $
.\"
.\" Copyright (c) 2003 Todd C. Miller <Todd.Miller@courtesan.com>
.\"
@@ -20,16 +20,20 @@
.\" Materiel Command, USAF, under agreement number F39502-99-1-0512.
.\"
.\" $FreeBSD$
-.Dd February 6, 2011
+.Dd October 22, 2014
.Dt ZMORE 1
.Os
.Sh NAME
-.Nm zmore
+.Nm zmore ,
+.Nm zless
.Nd view compressed files
.Sh SYNOPSIS
.Nm zmore
.Op Ar flags
-.Op Ar file ...
+.Op Ar
+.Nm zless
+.Op Ar flags
+.Op Ar
.Sh DESCRIPTION
.Nm
is a filter that allows the viewing of files compressed with Lempel-Ziv
@@ -51,6 +55,14 @@ that are specified are passed to the user's preferred
.Pa /usr/bin/more
by default).
.Pp
+.Nm zless
+is equivalent to
+.Nm zmore
+but uses
+.Xr less 1
+as a pager instead of
+.Xr more 1 .
+.Pp
When multiple files are specified,
.Nm
will pause at the end of each file and present the following prompt to the user:
@@ -86,7 +98,11 @@ style compression since there is no suffix on which to make a decision.
Program used to display files.
If unset,
.Pa /usr/bin/more
-is used.
+is used
+.Pq Nm zmore
+or
+.Pa /usr/bin/less
+.Pq Nm zless .
.El
.Sh SEE ALSO
.Xr compress 1 ,