xref: /freebsd/sbin/rcorder/rcorder.8 (revision c4f6a2a9e1b1879b618c436ab4f56ff75c73a0f5)
1.\"	$NetBSD: rcorder.8,v 1.3 2000/07/17 14:16:22 mrg Exp $
2.\"
3.\" Copyright (c) 1998
4.\" 	Perry E. Metzger.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgment:
16.\"	This product includes software developed for the NetBSD Project
17.\"	by Perry E. Metzger.
18.\" 4. The name of the author may not be used to endorse or promote products
19.\"    derived from this software without specific prior written permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31.\"
32.\" $FreeBSD$
33.\"
34.Dd July 17, 2000
35.Dt RCORDER 8
36.Os
37.Sh NAME
38.Nm rcorder
39.Nd print a dependency ordering of interdependent files
40.Sh SYNOPSIS
41.Nm
42.Op Fl k Ar keep
43.Op Fl s Ar skip
44.Ar
45.Sh DESCRIPTION
46The
47.Nm
48utility is designed to print out a dependency ordering of a set of
49interdependent files. Typically it is used to find an execution
50sequence for a set of shell scripts in which certain files must be
51executed before others.
52.Pp
53Each file passed to
54.Nm
55must be annotated with special lines (which look like comments to the
56shell) which indicate the dependencies the files have upon certain
57points in the sequence, known as
58.Dq conditions ,
59and which indicate, for each file, which
60.Dq conditions
61may be expected to be filled by that file.
62.Pp
63Within each file, a block containing a series of
64.Dq REQUIRE ,
65.Dq PROVIDE ,
66.Dq BEFORE
67and
68.Dq KEYWORD
69lines must appear.
70The format of the lines is rigid. Each line must begin with a single
71.Dq # ,
72followed by a single space, followed by
73.Dq PROVIDE: ,
74.Dq REQUIRE: ,
75.Dq BEFORE: ,
76or
77.Dq KEYWORD: .
78No deviation is permitted.
79Each dependency line is then followed by a series of conditions,
80separated by whitespace. Multiple
81.Dq PROVIDE ,
82.Dq REQUIRE ,
83.Dq BEFORE
84and
85.Dq KEYWORD
86lines may appear, but all such lines must appear in a sequence without
87any intervening lines, as once a line that does not follow the format
88is reached, parsing stops.
89.Pp
90The options are as follows:
91.Bl -tag -width Ds
92.It Fl k
93Add the specified keyword to the
94.Dq keep list .
95If any
96.Fl k
97option is given, only those files containing the matching keyword are listed.
98.It Fl s
99Add the specified keyword to the
100.Dq skip list .
101If any
102.Fl s
103option is given, files containing the matching keyword are not listed.
104.El
105.Pp
106 An example block follows:
107.Bd -literal -offset indent
108# REQUIRE: networking syslog
109# REQUIRE: usr
110# PROVIDE: dns nscd
111.Ed
112.Pp
113This block states that the file in which it appears depends upon the
114.Dq networking ,
115.Dq syslog ,
116and
117.Dq usr
118conditions, and provides the
119.Dq dns
120and
121.Dq nscd
122conditions.
123.Pp
124A file may contain zero
125.Dq PROVIDE
126lines, in which case it provides no conditions, and may contain zero
127.Dq REQUIRE
128lines, in which case it has no dependencies.
129There must be at least one file with no dependencies in the set of
130arguments passed to
131.Nm
132in order for it to find a starting place in the dependency ordering.
133.Sh DIAGNOSTICS
134The
135.Nm
136utility may print one of the following error messages and exit with a non-zero
137status if it encounters an error while processing the file list.
138.Bl -diag
139.It "Requirement %s has no providers, aborting."
140No file has a
141.Dq PROVIDE
142line corresponding to a condition present in a
143.Dq REQUIRE
144line in another file.
145.It "Circular dependency on provision %s, aborting."
146A set of files has a circular dependency which was detected while
147processing the stated condition.
148.It "Circular dependency on file %s, aborting."
149A set of files has a circular dependency which was detected while
150processing the stated file.
151.El
152.Sh SEE ALSO
153.Xr rc 8
154.Sh HISTORY
155The
156.Nm
157utility first appeared in
158.Nx 1.5 .
159.Sh AUTHORS
160Written by Perry E. Metzger (perry@piermont.com) and Matthew R.
161Green (mrg@eterna.com.au).
162