diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/cpio/cpio.c | 27 | ||||
-rw-r--r-- | usr/src/cmd/cpio/cpio.h | 3 | ||||
-rw-r--r-- | usr/src/man/man1/cpio.1 | 17 |
3 files changed, 34 insertions, 13 deletions
diff --git a/usr/src/cmd/cpio/cpio.c b/usr/src/cmd/cpio/cpio.c index 4aca72b0c5..d5444134b2 100644 --- a/usr/src/cmd/cpio/cpio.c +++ b/usr/src/cmd/cpio/cpio.c @@ -21,6 +21,7 @@ /* * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2012 Milan Jurik. All rights reserved. + * Copyright (c) 2012 Gary Mills */ /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ @@ -825,8 +826,11 @@ main(int argc, char **argv) if (close(Archive) != 0) msg(EXTN, "close error"); } - Blocks = (u_longlong_t)(Blocks * Bufsize + SBlocks + 0x1FF) >> 9; - msg(EPOST, "%lld blocks", Blocks); + if ((Args & OCq) == 0) { + Blocks = (u_longlong_t)(Blocks * Bufsize + SBlocks + + 0x1FF) >> 9; + msg(EPOST, "%lld blocks", Blocks); + } if (Error_cnt) msg(EPOST, "%d error(s)", Error_cnt); return (EXIT_CODE); @@ -6379,24 +6383,24 @@ setup(int largc, char **largv) #if defined(O_XATTR) #if defined(_PC_SATTR_ENABLED) #ifdef WAITAROUND - char *opts_p = "zabcdfiklmoprstuvABC:DE:H:I:LM:O:PR:SV6@/"; + char *opts_p = "zabcdfiklmopqrstuvABC:DE:H:I:LM:O:PR:SV6@/"; #else - char *opts_p = "abcdfiklmoprstuvABC:DE:H:I:LM:O:PR:SV6@/"; + char *opts_p = "abcdfiklmopqrstuvABC:DE:H:I:LM:O:PR:SV6@/"; #endif /* WAITAROUND */ #else /* _PC_SATTR_ENABLED */ #ifdef WAITAROUND - char *opts_p = "zabcdfiklmoprstuvABC:DE:H:I:LM:O:PR:SV6@"; + char *opts_p = "zabcdfiklmopqrstuvABC:DE:H:I:LM:O:PR:SV6@"; #else - char *opts_p = "abcdfiklmoprstuvABC:DE:H:I:LM:O:PR:SV6@"; + char *opts_p = "abcdfiklmopqrstuvABC:DE:H:I:LM:O:PR:SV6@"; #endif /* WAITAROUND */ #endif /* _PC_SATTR_ENABLED */ #else /* O_XATTR */ #ifdef WAITAROUND - char *opts_p = "zabcdfiklmoprstuvABC:DE:H:I:LM:O:PR:SV6"; + char *opts_p = "zabcdfiklmopqrstuvABC:DE:H:I:LM:O:PR:SV6"; #else - char *opts_p = "abcdfiklmoprstuvABC:DE:H:I:LM:O:PR:SV6"; + char *opts_p = "abcdfiklmopqrstuvABC:DE:H:I:LM:O:PR:SV6"; #endif /* WAITAROUND */ #endif /* O_XATTR */ @@ -6468,6 +6472,9 @@ setup(int largc, char **largv) Max_namesz = APATH; Args |= OCp; break; + case 'q': /* "quiet" */ + Args |= OCq; + break; case 'r': /* rename files interactively */ Args |= OCr; break; @@ -6867,7 +6874,7 @@ usage(void) (void) fflush(stdout); #if defined(O_XATTR) (void) fprintf(stderr, gettext("USAGE:\n" - "\tcpio -i[bcdfkmrstuv@BSV6] [-C size] " + "\tcpio -i[bcdfkmqrstuv@BSV6] [-C size] " "[-E file] [-H hdr] [-I file [-M msg]] " "[-R id] [patterns]\n" "\tcpio -o[acv@ABLV] [-C size] " @@ -6875,7 +6882,7 @@ usage(void) "\tcpio -p[adlmuv@LV] [-R id] directory\n")); #else (void) fprintf(stderr, gettext("USAGE:\n" - "\tcpio -i[bcdfkmrstuvBSV6] [-C size] " + "\tcpio -i[bcdfkmqrstuvBSV6] [-C size] " "[-E file] [-H hdr] [-I file [-M msg]] " "[-R id] [patterns]\n" "\tcpio -o[acvABLV] [-C size] " diff --git a/usr/src/cmd/cpio/cpio.h b/usr/src/cmd/cpio/cpio.h index 40e08c6a2e..dad4b24ced 100644 --- a/usr/src/cmd/cpio/cpio.h +++ b/usr/src/cmd/cpio/cpio.h @@ -19,6 +19,8 @@ * CDDL HEADER END */ /* + * Copyright (c) 2012 Gary Mills + * * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -69,6 +71,7 @@ extern "C" { #define OC6 0x10000000 #define BSM 0x20000000 #define OCP 0x40000000 +#define OCq 0x80000000 /* Sparse file support */ #define C_ISSPARSE 0200000 diff --git a/usr/src/man/man1/cpio.1 b/usr/src/man/man1/cpio.1 index 25506950c1..ec808e6bad 100644 --- a/usr/src/man/man1/cpio.1 +++ b/usr/src/man/man1/cpio.1 @@ -1,6 +1,7 @@ '\" te .\" Copyright 1989 AT&T .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved +.\" Copyright (c) 2012 Gary Mills .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/. .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text @@ -16,19 +17,19 @@ cpio \- copy file archives in and out .SH SYNOPSIS .LP .nf -\fBcpio\fR \fB-i\fR [\fB-bBcdfkmPrsStuvV6@/\fR] [\fB-C\fR \fIbufsize\fR] [\fB-E\fR \fIfile\fR] +\fBcpio\fR \fB-i\fR [\fB-bBcdfkmPqrsStuvV6@/\fR] [\fB-C\fR \fIbufsize\fR] [\fB-E\fR \fIfile\fR] [\fB-H\fR \fIheader\fR] [\fB-I\fR \fI\fR [\fB-M\fR \fImessage\fR]] [\fB-R\fR \fIid\fR] [\fIpattern\fR]... .fi .LP .nf -\fBcpio\fR \fB-o\fR [\fB-aABcLPvV@/\fR] [\fB-C\fR \fIbufsize\fR] [\fB-H\fR \fIheader\fR] +\fBcpio\fR \fB-o\fR [\fB-aABcLPqvV@/\fR] [\fB-C\fR \fIbufsize\fR] [\fB-H\fR \fIheader\fR] [\fB-O\fR \fIfile\fR [\fB-M\fR \fImessage\fR]] .fi .LP .nf -\fBcpio\fR \fB-p\fR [\fB-adlLmPuvV@/\fR] [\fB-R\fR \fIid\fR] \fIdirectory\fR +\fBcpio\fR \fB-p\fR [\fB-adlLmPquvV@/\fR] [\fB-R\fR \fIid\fR] \fIdirectory\fR .fi .SH DESCRIPTION @@ -425,6 +426,16 @@ systems, and hence is not portable. Use \fBASCII\fR headers for portability. .sp .ne 2 .na +\fB\fB-q\fR\fR +.ad +.RS 14n +Quiet. Suppresses the number of blocks message that normally is printed +after the copy is completed. +.RE + +.sp +.ne 2 +.na \fB\fB-r\fR\fR .ad .RS 14n |