Whitespace nits, sort sections, fix Dv usage (doesn't like macro argument).

This commit is contained in:
wiz 2001-10-28 19:03:12 +00:00
parent b45940a186
commit ee03b26cd0
1 changed files with 90 additions and 92 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: pax.1,v 1.26 2001/10/25 08:51:51 lukem Exp $
.\" $NetBSD: pax.1,v 1.27 2001/10/28 19:03:12 wiz Exp $
.\"
.\" Copyright (c) 1992 Keith Muller.
.\" Copyright (c) 1992, 1993
@ -232,7 +232,7 @@ and is written using single line buffering.
.Nm
extracts the members of the archive file read from the
.Dv standard input ,
with pathnames matching the specified
with pathnames matching the specified
.Ar patterns .
The archive format and blocking is automatically determined on input.
When an extracted file is a directory, the entire file hierarchy
@ -245,16 +245,16 @@ option.
.It Fl w
.Em Write .
.Nm
writes an archive containing the
writes an archive containing the
.Ar file
operands to
.Dv standard output
using the specified archive format.
When no
When no
.Ar file
operands are specified, a list of files to copy with one per line is read from
operands are specified, a list of files to copy with one per line is read from
.Dv standard input .
When a
When a
.Ar file
operand is also a directory, the entire file hierarchy rooted
at that directory will be included.
@ -265,7 +265,7 @@ copies the
.Ar file
operands to the destination
.Ar directory .
When no
When no
.Ar file
operands are specified, a list of files to copy with one per line is read from
the
@ -306,7 +306,6 @@ to locate and process the largest number of archive members possible (see the
.Fl E
option for more details on error handling).
.Sh OPERANDS
.Pp
The
.Ar directory
operand specifies a destination directory pathname.
@ -323,10 +322,10 @@ operand is used to select one or more pathnames of archive members.
Archive members are selected using the pattern matching notation described
by
.Xr fnmatch 3 .
When the
When the
.Ar pattern
operand is not supplied, all members of the archive will be selected.
When a
When a
.Ar pattern
matches a directory, the entire file hierarchy rooted at that directory will
be selected.
@ -353,7 +352,6 @@ operand pathnames in a diagnostic message to
.Dv standard error
and then exit with a non-zero exit status.
.Sh OPTIONS
.Pp
The following options are supported:
.Bl -tag -width 4n
.It Fl r
@ -365,11 +363,11 @@ If any intermediate directories are needed in order to extract an archive
member, these directories will be created as if
.Xr mkdir 2
was called with the bitwise inclusive
.Dv OR
.Dv OR
of
.Dv S_IRWXU , S_IRWXG ,
and
.Dv S_IRWXO
.Dv S_IRWXO
as the mode argument.
When the selected archive format supports the specification of linked
files and these files cannot be linked while the archive is being extracted,
@ -396,7 +394,7 @@ If an archive format is not specified with a
.Fl x
option, the format currently being used in the archive will be selected.
Any attempt to append to an archive in a format different from the
format already used in the archive will cause
format already used in the archive will cause
.Nm
to exit immediately
with a non-zero exit status.
@ -434,7 +432,7 @@ can be separated by
to indicate a product.
A specific archive device may impose additional restrictions on the size
of blocking it will support.
When blocking is not specified, the default
When blocking is not specified, the default
.Ar blocksize
is dependent on the specific archive format being used (see the
.Fl x
@ -488,8 +486,8 @@ If this line consists of a single period, the
file or archive member is processed with no modification to its name.
Otherwise, its name is replaced with the contents of the line.
.Nm
will immediately exit with a non-zero exit status if
.Dv Aq EOF
will immediately exit with a non-zero exit status if
.Aq Dv EOF
is encountered when reading a response or if
.Pa /dev/tty
cannot be opened for reading and writing.
@ -512,7 +510,7 @@ No more than one archive member is matched for each
.Ar pattern .
When members of type directory are matched, the file hierarchy rooted at that
directory is also matched (unless
.Fl d
.Fl d
is also specified).
.It Fl o Ar options
Information to modify the algorithm for extracting or writing archive files
@ -535,7 +533,7 @@ and
.Cm p .
Multiple characteristics can be concatenated within the same string
and multiple
.Fl p
.Fl p
options can be specified.
The meaning of the specification characters are as follows:
.Bl -tag -width 2n
@ -550,10 +548,10 @@ This is intended to be used by
.Em root ,
someone with all the appropriate privileges, in order to preserve all
aspects of the files as they are recorded in the archive.
The
The
.Cm e
flag is the sum of the
.Cm o
.Cm o
and
.Cm p
flags.
@ -569,7 +567,7 @@ Preserve the user ID and group ID.
.Sq Preserve
the file mode bits.
This intended to be used by a
.Em user
.Em user
with regular privileges who wants to preserve all aspects of the file other
than the ownership.
The file times are preserved by default, but two other flags are offered to
@ -583,7 +581,7 @@ extracted file, subject to the permissions of the invoking
process.
Otherwise the attribute of the extracted file is determined as
part of the normal file creation action.
If neither the
If neither the
.Cm e
nor the
.Cm o
@ -591,7 +589,7 @@ specification character is specified, or the user ID and group ID are not
preserved for any reason,
.Nm
will not set the
.Dv S_ISUID
.Dv S_ISUID
.Em ( setuid )
and
.Dv S_ISGID
@ -631,7 +629,7 @@ or subexpression matching.
The
.Cm old
string may also contain
.Dv Aq newline
.Aq Dv newline
characters.
Any non-null character can be used as a delimiter (/ is shown here).
Multiple
@ -692,7 +690,7 @@ For pathnames representing a symbolic link, the output has the format:
.Dl Ao "ls -l listing" Ac => Ao "link name" Ac
Where
.Aq "ls -l listing"
is the output format specified by the
is the output format specified by the
.Xr ls 1
utility when used with the
.Fl l
@ -704,11 +702,11 @@ and
pathnames are written and flushed to
.Dv standard error
without a trailing
.Dv Aq newline
.Aq Dv newline
as soon as processing begins on that file or
archive member.
The trailing
.Dv Aq newline ,
.Aq Dv newline ,
is not buffered, and is written only after the file has been read or written.
.It Fl x Ar format
Specify the output archive format, with the default format being
@ -755,7 +753,7 @@ and is repaired.
.It Ar tar
The old
.Bx
tar format as found in
tar format as found in
.Bx 4.3 .
The default blocksize for this format is 10240 bytes.
Pathnames stored by this format must be 100 characters or less in length.
@ -811,7 +809,7 @@ to indicate a product.
.Em Warning :
Only use this option when writing an archive to a device which supports
an end of file read condition based on last (or largest) write offset
(such as a regular file or a tape drive).
(such as a regular file or a tape drive).
The use of this option with a floppy or hard disk is not recommended.
.It Fl D
This option is the same as the
@ -842,11 +840,11 @@ of
will cause
.Nm
to attempt to recover from read errors forever.
The default
The default
.Ar limit
is a small positive number of retries.
.Pp
.Em Warning :
.Em Warning :
Using this option with
.Li NONE
should be used with extreme caution as
@ -860,7 +858,7 @@ name, or when starting with a
a numeric gid.
A '\\' can be used to escape the
.Cm # .
Multiple
Multiple
.Fl G
options may be supplied and checking stops with the first match.
.It Fl H
@ -913,12 +911,12 @@ Do not follow symbolic links, perform a physical file system traversal.
This is the default mode.
.It Fl T Ar [from_date][,to_date][/[c][m]]
Allow files to be selected based on a file modification or inode change
time falling within a specified time range of
time falling within a specified time range of
.Ar from_date
to
.Ar to_date
(the dates are inclusive).
If only a
If only a
.Ar from_date
is supplied, all files with a modification or inode change time
equal to or younger are selected.
@ -926,7 +924,7 @@ If only a
.Ar to_date
is supplied, all files with a modification or inode change time
equal to or older will be selected.
When the
When the
.Ar from_date
is equal to the
.Ar to_date ,
@ -935,7 +933,7 @@ time will be selected.
.Pp
When
.Nm
is in the
is in the
.Em write
or
.Em copy
@ -952,7 +950,7 @@ The
.Ar c
specifies the comparison of inode change time (the time when the file
inode was last changed; e.g. a change of owner, group, mode, etc).
When
When
.Ar c
and
.Ar m
@ -993,7 +991,7 @@ is the seconds (from 00 to 61).
Only the minute field
.Cm mm
is required; the others will default to the current system values.
The
The
.Cm ss
field may be added independently of the other fields.
If the century is not specified, it defaults to 1900 for
@ -1002,7 +1000,7 @@ Time ranges are relative to the current time, so
.Dl Fl T Ar 1234/cm
would select all files with a modification or inode change time
of 12:34 PM today or later.
Multiple
Multiple
.Fl T
time range can be supplied and checking stops with the first match.
.It Fl U Ar user
@ -1013,14 +1011,14 @@ name, or when starting with a
a numeric uid.
A '\\' can be used to escape the
.Cm # .
Multiple
Multiple
.Fl U
options may be supplied and checking stops with the first match.
.It Fl X
When traversing the file hierarchy specified by a pathname,
do not descend into directories that have a different device ID.
See the
.Li st_dev
.Li st_dev
field as described in
.Xr stat 2
for more information about device ID's.
@ -1075,7 +1073,7 @@ Then the
and
.Fl Z
options will be applied based on the final pathname.
Finally the
Finally the
.Fl v
option will write the names resulting from these modifications.
.Pp
@ -1091,13 +1089,13 @@ based only on the user specified pathnames as modified by the
.Fl D ,
.Fl G ,
.Fl T ,
and
and
.Fl U
options (the
.Fl D
option only applies during a copy operation).
Then any
.Fl s
.Fl s
and
.Fl i
options will modify in that order, the names of these selected files.
@ -1122,7 +1120,7 @@ option, a file is not considered selected unless it is newer
than the file to which it is compared.
.Sh EXAMPLES
The command:
.Dl pax -w -f /dev/rst0 .\
.Dl pax -w -f /dev/rst0 \&.
copies the contents of the current directory to the device
.Pa /dev/rst0 .
.Pp
@ -1142,7 +1140,7 @@ directory hierarchy to
.Pp
The command:
.Dl pax -r -s ',^//*usr//*,,' -f a.pax
reads the archive
reads the archive
.Pa a.pax ,
with all files rooted in ``/usr'' into the archive extracted relative to the
current directory.
@ -1170,6 +1168,51 @@ will update (and list) only those files in the destination directory
which are older (less recent inode change or file modification times) than
files with the same name found in the source file tree
.Pa home .
.Sh ERRORS
.Nm
will exit with one of the following values:
.Bl -tag -width 2n
.It 0
All files were processed successfully.
.It 1
An error occurred.
.El
.Pp
Whenever
.Nm
cannot create a file or a link when reading an archive or cannot
find a file when writing an archive, or cannot preserve the user ID,
group ID, or file mode when the
.Fl p
option is specified, a diagnostic message is written to
.Dv standard error
and a non-zero exit status will be returned, but processing will continue.
In the case where pax cannot create a link to a file,
.Nm
will not create a second copy of the file.
.Pp
If the extraction of a file from an archive is prematurely terminated by
a signal or error,
.Nm
may have only partially extracted a file the user wanted.
Additionally, the file modes of extracted files and directories
may have incorrect file bits, and the modification and access times may be
wrong.
.Pp
If the creation of an archive is prematurely terminated by a signal or error,
.Nm
may have only partially created the archive which may violate the specific
archive format specification.
.Pp
If while doing a
.Em copy ,
.Nm
detects a file is about to overwrite itself, the file is not copied,
a diagnostic message is written to
.Dv standard error
and when
.Nm
completes it will exit with a non-zero exit status.
.Sh SEE ALSO
.Xr cpio 1 ,
.Xr tar 1 ,
@ -1211,48 +1254,3 @@ standard.
Keith Muller at the University of California, San Diego.
Luke Mewburn implemented
.Fl M .
.Sh ERRORS
.Nm
will exit with one of the following values:
.Bl -tag -width 2n
.It 0
All files were processed successfully.
.It 1
An error occurred.
.El
.Pp
Whenever
.Nm
cannot create a file or a link when reading an archive or cannot
find a file when writing an archive, or cannot preserve the user ID,
group ID, or file mode when the
.Fl p
option is specified, a diagnostic message is written to
.Dv standard error
and a non-zero exit status will be returned, but processing will continue.
In the case where pax cannot create a link to a file,
.Nm
will not create a second copy of the file.
.Pp
If the extraction of a file from an archive is prematurely terminated by
a signal or error,
.Nm
may have only partially extracted a file the user wanted.
Additionally, the file modes of extracted files and directories
may have incorrect file bits, and the modification and access times may be
wrong.
.Pp
If the creation of an archive is prematurely terminated by a signal or error,
.Nm
may have only partially created the archive which may violate the specific
archive format specification.
.Pp
If while doing a
.Em copy ,
.Nm
detects a file is about to overwrite itself, the file is not copied,
a diagnostic message is written to
.Dv standard error
and when
.Nm
completes it will exit with a non-zero exit status.