.\" @(#)man/man8/mkuuwho.an	1.3 8/2/92 03:32:44
.de pP
.if n .sp 1
.if t .sp .4
..
.de tP
.pP
.ta \\n(pDu
.ti -\\n(pDu
..
.TH MKUUWHO X_MAN8_EXT_X "31 January 1988" "Local"
.SH NAME
mkuuwho \- make a database suitable for the uuwho command
.SH SYNOPSIS
.na
.B X_UTIL_BIN_DIR_X/mkuuwho
.RB [ \-v ]
.RB [ \-x ]
.RB [ \-e ]
.RB [ \-n ]
[
.B \-t
.I trace
[
.B \-u
.I uuwho_database
] [
.I path_config
]
.ad
.SH DESCRIPTION
.I Mkuuwho
is a modified version of the
.IR mkpath (X_MAN8_EXT_X)
utility, used for creating a database for use by the
.IR uuwho (X_MAN1_EXT_X)
command.  It reads a
.IR mkpath (X_MAN8_EXT_X)
configuration file and builds a DBM database named
.I uuwho_database
(by default a database named
.IR "X_LIB_DIR_X/uuwho" ).
This database is used by the
.I uuwho
command to determine where maps for specific sites or domains can be
found.  The configuration file is used to determine from which files,
and in which order, map data should be used to create this DBM
database.  This command is currently available only on machines that
have the
.IR dbm (3X)
library functions.
.PP
If
.I path_config
is
.BR \- ,
then a specification will be taken from the standard input.
If
.I path_config
is omitted, then the default specification
.I X_LIB_DIR_X/maps/mkpath.conf
is used.
.SH "CONFIGURATION FILE FORMAT"
The format of the path configuration file is a set of lines containing
directives.  Blank lines are ignored and the character ``#'' begins a
comment which continues until the end of the line.
The various possible directives are described below.
.PP
In these directive descriptions, an argument of
.I arg
refers to one of the following types of arguments:
.nr pD \w'`\fIshell-command\fP`'u+2n
.TP \n(pDu
\&'\fIliteral\fP'
Literal data specified inline.  (single quotes)
.TP \n(pDu
`\fIshell-command\fP`
Take data from the standard output of this shell command.  (back quotes)
.TP \n(pDu
\fIfilename ...\fP
Take data from the named file or files.  Files may be specified using
shell globbing notation, with
.B "* ?"
and
.BR "[]" .
.PP
The `\fIshell-command\fP` form preserves newlines and whitespace and
is thus not entirely equivalent to usage in
.IR sh (1).
The following lines result in the same input to
.I uuwho:
.pP
.in +.5i
.ta .6i 2i
.nf
map	`cat food`	# ackpft!
map	food	# oop ack!
.fi
.DT
.in -.5i
.pP
For the `\fIshell-command\fP` and '\fIliteral\fP' forms, the filename
used for error messages is
.IR [stdin] .
.TP
\fBmap\fP \fIarg\fP
Specify map data to be given as input to uuwho.  Each file is
preceded by a line containing:
.pP
.in +.5i
file { \fIpathname\fP }
.in -.5i
.pP
where
.I pathname
is the full pathname to the file.  This allows uuwho to know which
from file the data was taken.
.TP
\fBsafemap\fP	\fIarg\fP
This is similar to the
.B map
directive, and can be used when you do not have sufficient control
over what the files contain.  If a map file contains pathalias
.B file
directives, those directives are ignored.
.TP
\fBdelete\fP \fIarg\fP
.PD 0
.TP
\fBadjust\fP \fIarg\fP
.TP
\fBdead\fP \fIarg\fP
.TP
\fBtext\fP \fIarg\fP
.TP
\fBfile\fP \fIfilename\fP
These
.I mkpath
configuration file directives are ignored by
.IR mkuuwho .
.PD
.TP
\fBcd\fP [ \fIdir\fP ]
By default,
the current directory used by
.I mkuuwho
begins in the directory of the configuration file, or in the current
directory if the configuration is read from the standard input.  The
.B cd
command without a
.I dir
argument changes to the directory from which
.I mkuuwho
was invoked.  A
.I dir
arg of
.B \-
changes the directory to the default directory based on the name of
the configuration file.
Otherwise,
.I dir
becomes the current directory for file and shell command references.
.TP
\fBsh\fP \fIcmd\fP
The given shell command is executed.
.TP
\fBpathalias\fP [ \fIflags\fP ]
.PD 0
.TP
\fBpathsort\fP [ \fIflags\fP ]
.PD
These directives end execution blocks (see the next section), but have
no other side effects when processed by
.IR mkuuwho .
.SH "EXECUTION BLOCKS"
Directives are executed in blocks.
A
.BR map ,
.BR safemap ,
.BR delete ,
.BR adjust ,
.BR dead
or
.BR file
directive starts a block.
Successive directives continue it.
A
.B pathalias
or
.B pathsort
directive ends a block.  The end of a file can end a block.
.PP
When the start of a block is seen, all directives up to the end of the
block are collected and fed into the resulting
.IR uuwho (X_MAN8_EXT_X)
command.  Directives such as
.BR cd
or
.B sh
within a block only effect that block.  Therefore, a
.B cd
directive within a block will only change the directory for the
remainder of that block, whereas a
.B cd
directive outside of a block has a global effect.
.PP
Additionally an
.B sh
directive will feed its standard output into the block's
pathalias command when it is inside a block, while an
.B sh
directive outside of a block will send its output direct to the standard
output of the
.I mkuuwho
command.
.SH OPTIONS
The following options are recognized by
.IR mkuuwho :
.TP
.B \-v
The internal
.IR sh (1)
commands are executed with a
.B \-v
option, thus echoing the commands that are piped to the shell prior to
their being processed.
.TP
.B \-x
Pass the
.B \-x
flag to invocations of the shell, causing commands which are about to
execute to be echoed.
.TP
.B \-e
Pass the
.B \-e
flag to invocations of the shell, causing shells to exit whenever a
command returns a non-zero exit status.  In addition, the
.I mkuuwho
program will exit when it encounters a syntax error or unknown
directive.
.TP
.B \-n
Disable the execution of any shell commands that
.I mkuuwho
generates.  This is useful with the
.B \-v
option and disables the
.BR \-x ,
.B \-e
and
.B \-V
options.
.TP
.BI \-t " trace"
Cause the input to pathalias to be copied into the file
.IR trace .
.TP
.BI \-u " uuwho_database"
Cause the named DBM database to be created, rather than using the
default name of
.IR "X_LIB_DIR_X/uuwho" .
.SH "SEE ALSO"
.IR mkpath (X_MAN8_EXT_X),
.IR uuwho (X_MAN1_EXT_X),
.IR dbm (3X)
and
.IR sh (1).
.SH BUGS
The first ``#'' character on a line begins a comment regardless of
whether or not it is within quotes.
.PP
The
.B \-e
option does not stop all execution, only command execution within an
instance of the shell created by
.IR mkuuwho .
.PP
Continuation lines are not currently allowed in the configuration
file.  Each command must be on a single line.
.SH COPYRIGHT
Copyright(C)1987, 1988 Ronald S. Karr and Landon Curt Noll
.br
Copyright(C)1992 Ronald S. Karr
.br
See a file COPYING,
distributed with the source code,
or type
.I "smail \-bc"
for distribution rights and restrictions
associated with this software.
