From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 01:22:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E53AB8A3; Thu, 23 Oct 2014 01:22:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5A56F86; Thu, 23 Oct 2014 01:22:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9N1MV6j099026; Thu, 23 Oct 2014 01:22:31 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9N1MUX4099021; Thu, 23 Oct 2014 01:22:30 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410230122.s9N1MUX4099021@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 23 Oct 2014 01:22:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273507 - head/usr.bin/gzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2014 01:22:32 -0000 Author: delphij Date: Thu Oct 23 01:22:29 2014 New Revision: 273507 URL: https://svnweb.freebsd.org/changeset/base/273507 Log: Sync with NetBSD. MFC after: 2 weeks Modified: head/usr.bin/gzip/Makefile head/usr.bin/gzip/gzip.1 head/usr.bin/gzip/gzip.c head/usr.bin/gzip/zmore head/usr.bin/gzip/zmore.1 Modified: head/usr.bin/gzip/Makefile ============================================================================== --- head/usr.bin/gzip/Makefile Thu Oct 23 01:09:01 2014 (r273506) +++ head/usr.bin/gzip/Makefile Thu Oct 23 01:22:29 2014 (r273507) @@ -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 @@ -21,7 +21,8 @@ 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 \ Modified: head/usr.bin/gzip/gzip.1 ============================================================================== --- head/usr.bin/gzip/gzip.1 Thu Oct 23 01:09:01 2014 (r273506) +++ head/usr.bin/gzip/gzip.1 Thu Oct 23 01:22:29 2014 (r273507) @@ -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. Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Thu Oct 23 01:09:01 2014 (r273506) +++ head/usr.bin/gzip/gzip.c Thu Oct 23 01:22:29 2014 (r273507) @@ -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); } Modified: head/usr.bin/gzip/zmore ============================================================================== --- head/usr.bin/gzip/zmore Thu Oct 23 01:09:01 2014 (r273506) +++ head/usr.bin/gzip/zmore Thu Oct 23 01:22:29 2014 (r273507) @@ -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 @@ -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 Modified: head/usr.bin/gzip/zmore.1 ============================================================================== --- head/usr.bin/gzip/zmore.1 Thu Oct 23 01:09:01 2014 (r273506) +++ head/usr.bin/gzip/zmore.1 Thu Oct 23 01:22:29 2014 (r273507) @@ -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 .\" @@ -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 use .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 suff 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 ,