Subject: misc/33130: rcorder(8) poorly documented
To: None <misc-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Denis Lagno <dlagno@rambler.ru>
List: netbsd-bugs
Date: 03/22/2006 13:25:00
>Number:         33130
>Category:       misc
>Synopsis:       rcorder(8) poorly documented
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 22 13:25:00 +0000 2006
>Originator:     Denis Lagno
>Release:        NetBSD 3.99.15
>Organization:
>Environment:
System: NetBSD chup.gado 3.99.15 NetBSD 3.99.15 (CHUP) #0: Sun Jan 8 15:29:59 MSK 2006 dina@chup.gado:/flam/volatile/worksrc/netbsd-current/src/sys/arch/i386/compile/CHUP_NG i386
Architecture: i386
Machine: i386
>Description:
I tried to understand the exact semantics of PROVIDE, REQUIRE and BEFORE spells.
And I see that rcorder(8) manpage is very obscure about it.

>How-To-Repeat:
Try to understand the exact semantics of PROVIDE, REQUIRE and BEFORE spells
reading rcorder(8) manpage.
>Fix:

--- rcorder.8#1.8       2005-07-12 23:54:11.000000000 +0400
+++ rcorder.8   2006-03-22 16:06:25.000000000 +0300
@@ -52,7 +52,6 @@
 .Nm
 should be annotated with special lines (which look like comments to the
 shell) which indicate the dependencies the files have upon certain
-points in the sequence, known as
 .Dq conditions ,
 and which indicate, for each file, which
 .Dq conditions
@@ -87,6 +86,38 @@
 any intervening lines, as once a line that does not follow the format
 is reached, parsing stops.
 .Pp
+.Nm
+proceeds by constructing the dependency (directed) graph.
+Files and conditions are treated as living in different namespaces.
+For each file subject to be processed
+.Nm
+creates a vertex in the dependency graph.
+For each condition
+.Nm
+creates a pair of vertices in the dependency graph,
+call them primary and secondary.
+For each dependency stating that some file does
+.Dq PROVIDE
+some condition
+.Nm
+adds a pair of directed arrows into the dependency graph,
+one going from primary condition vertex to file vertex,
+second going from file vertex to secondary condition vertex.
+For each dependency stating that some file does
+.Dq REQUIRE
+some condition
+.Nm
+adds a directed arrow into the dependency graph,
+going from secondary condition vertex to file vertex.
+For each dependency stating that some file goes
+.Dq BEFORE
+some condition
+.Nm
+adds a directed arrow into the dependency graph,
+going from file vertex to primary condition vertex.
+Then dependency graph is topologically sorted,
+thus yielding required ordering of files.
+.Pp
 The options are as follows:
 .Bl -tag -width Ds
 .It Fl k