1.\" $NetBSD: rcorder.8,v 1.5 2002/10/03 15:41:44 wiz 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.\" 33.Dd July 17, 2000 34.Dt RCORDER 8 35.Os 36.Sh NAME 37.Nm rcorder 38.Nd print a dependency ordering of interdependent files 39.Sh SYNOPSIS 40.Nm 41.Op Fl k Ar keep 42.Op Fl s Ar skip 43.Ar 44.Sh DESCRIPTION 45.Nm 46is designed to print out a dependency ordering of a set of 47interdependent files. 48Typically it is used to find an execution sequence for a set of 49shell scripts in which certain files must be executed before others. 50.Pp 51Each file passed to 52.Nm 53must be annotated with special lines (which look like comments to the 54shell) which indicate the dependencies the files have upon certain 55points in the sequence, known as 56.Dq conditions , 57and which indicate, for each file, which 58.Dq conditions 59may be expected to be filled by that file. 60.Pp 61Within each file, a block containing a series of 62.Dq REQUIRE , 63.Dq PROVIDE , 64.Dq BEFORE 65and 66.Dq KEYWORD 67lines must appear. 68The format of the lines is rigid. 69Each line must begin with a single 70.Dq # , 71followed by a single space, followed by 72.Dq PROVIDE: , 73.Dq REQUIRE: , 74.Dq BEFORE: , 75or 76.Dq KEYWORD: . 77No deviation is permitted. 78Each dependency line is then followed by a series of conditions, 79separated by whitespace. 80Multiple 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 134.Nm 135may print one of the following error messages and exit with a non-zero 136status if it encounters an error while processing the file list. 137.Bl -diag 138.It "Requirement %s has no providers, aborting." 139No file has a 140.Dq PROVIDE 141line corresponding to a condition present in a 142.Dq REQUIRE 143line in another file. 144.It "Circular dependency on provision %s, aborting." 145A set of files has a circular dependency which was detected while 146processing the stated condition. 147.It "Circular dependency on file %s, aborting." 148A set of files has a circular dependency which was detected while 149processing the stated file. 150.El 151.Sh SEE ALSO 152.Xr rc 8 153.Sh HISTORY 154The 155.Nm 156program first appeared in 157.Nx 1.5 . 158.Sh AUTHORS 159Written by Perry E. Metzger (perry@piermont.com) and 160Matthew R. Green (mrg@eterna.com.au). 161