1.\" $NetBSD: rcorder.8,v 1.2 2000/07/05 15:45:30 msaitoh 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. Typically it is used to find an execution 48sequence for a set of shell scripts in which certain files must be 49executed 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. Each line must begin with a single 69.Dq # , 70followed by a single space, followed by 71.Dq PROVIDE: , 72.Dq REQUIRE: , 73.Dq BEFORE: , 74or 75.Dq KEYWORD: . 76No deviation is permitted. 77Each dependency line is then followed by a series of conditions, 78separated by whitespace. Multiple 79.Dq PROVIDE , 80.Dq REQUIRE , 81.Dq BEFORE 82and 83.Dq KEYWORD 84lines may appear, but all such lines must appear in a sequence without 85any intervening lines, as once a line that does not follow the format 86is reached, parsing stops. 87.Pp 88The options are as follows: 89.Bl -tag -width Ds 90.It Fl k 91Add the specified keyword to the 92.Dq keep list . 93If any 94.Fl k 95option is given, only those files containing the matching keyword are listed. 96.It Fl s 97Add the specified keyword to the 98.Dq skip list . 99If any 100.Fl s 101option is given, files containing the matching keyword are not listed. 102.El 103.Pp 104 An example block follows: 105.Bd -literal -offset indent 106# REQUIRE: networking syslog 107# REQUIRE: usr 108# PROVIDE: dns nscd 109.Ed 110.Pp 111This block states that the file in which it appears depends upon the 112.Dq networking , 113.Dq syslog , 114and 115.Dq usr 116conditions, and provides the 117.Dq dns 118and 119.Dq nscd 120conditions. 121.Pp 122A file may contain zero 123.Dq PROVIDE 124lines, in which case it provides no conditions, and may contain zero 125.Dq REQUIRE 126lines, in which case it has no dependencies. 127There must be at least one file with no dependencies in the set of 128arguments passed to 129.Nm 130in order for it to find a starting place in the dependency ordering. 131.Sh DIAGNOSTICS 132.Nm 133may print one of the following error messages and exit with a non-zero 134status if it encounters an error while processing the file list. 135.Bl -diag 136.It "Requirement %s has no providers, aborting." 137No file has a 138.Dq PROVIDE 139line corresponding to a condition present in a 140.Dq REQUIRE 141line in another file. 142.It "Circular dependency on provision %s, aborting." 143A set of files has a circular dependency which was detected while 144processing the stated condition. 145.It "Circular dependency on file %s, aborting." 146A set of files has a circular dependency which was detected while 147processing the stated file. 148.El 149.Sh SEE ALSO 150.Xr rc 8 151.Sh HISTORY 152The 153.Nm 154program first appeared in 155.Nx 1.5 . 156.Sh AUTHORS 157Written by Perry E. Metzger (perry@piermont.com) and Matthew R. 158Green (mrg@eterna.com.au). 159