OpenSolaris_b135/tools/pmodes/README.pmodes

#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License").  You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
/*
 * Copyright (c) 1999-2001 by Sun Microsystems, Inc.
 * All rights reserved.
 */

#ident	"%Z%%M%	%I%	%E% SMI"

Pmodes is a program that updates pkgmap files or pkg prototype files.


Usage: pmodes [-somwDeNndvqP] [-r file] directory  .. proto/pkgmap file....



Options that modify what is changed:

	-s 	Strip read and write permissions from setgid/setuid executables.
	-o	Do not change ownership to root
	-m	Do not change file permissions (modes)
	-w 	Do not strip owner write permissions from non-root owned
		binaries
	-e	Do not change 'e' or 'v' (editable or volatile) files
		(they are only affected when owned by bin)
	-D	Limit changes to directories only.
	
Options that modify the output:
	-n	Create a <file>.new file
	-N	Overwrite the original pkgmap/proto file with the new file;
		old pkgmap/proto file saved as file.old
	-d	Produce "diff-style" output
	-P	Ignore pkgmap files in directories.
	-q	Do not produce error messages about directories w/ pkginfo*
		files
	-v	Preceed the output caused by each processed file by a
		shortened version of the filename.

	-r file	Restrict the test to the pathnames listed in "file"


In default mode of operation, pmodes processes each argument.
If an argument is a directory, it will first look for a pkginfo or
pkginfo.tmpl file n order to learn the BASEDIR; it will than process
the directory converting either the pkgmap file or, if the pkgmap file
doesn't exist or the -P option is specified, the prototype_* files
Names that contain .old or .new will be ignored.  If an argument is a file,
the pkginfo* file in the same directory is used to learn the BASEDIR.

Pmodes outputs a line for each change made:

e m 0664 -> 0644 /var/adm/wtmpx
d m 0775 -> 0755 /usr/lib
d o bin -> root /usr/include/sys [755]
f o bin -> root /usr/include/sys/cg6reg.h [0644]
f o bin -> root /usr/include/sys/cg6var.h [0644]

The first field is the "pkgmap" file type; the second field is the type
of modification (m for mode, o for ownership).  This is followed by the
change mode and the pathname.

When ownership is changed, the file permissions are printed in square
brackets.

Multiple lines of output can be produced for a single file.

With the -d option, output looks like:

< d 0775 root sys /usr
> d 0755 root sys /usr
< d 0775 root bin /usr/include
> d 0755 root bin /usr/include
< d 1777 bin bin /var/preserve
> d 1777 root bin /var/preserve
< e 0664 root sys /etc/vfstab
> e 0644 root sys /etc/vfstab

And only one line per file is produced.