Subject: Re: Posible virc(8) implementation
To: NetBSD-current Discussion List <current-users@netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: current-users
Date: 05/05/2000 12:01:40
[ On Thursday, May 4, 2000 at 08:45:34 (-0700), Greywolf wrote: ]
> Subject: Re: Posible virc(8) implementation
>
> Man, you guys just don't get it.

Please don't include me in that list.  I'm not actually arguing for
rc.conf.d -- just pointing out fallacies in the arguments against it.

You say in your next post that it's effectively a solution looking for a
problem.  Unfortunately that's not quite true.

HOWEVER, if the syntax of rc.conf (i.e. the single file) were restricted
to be just variable assignments, then perhaps the real problem which
some of you folks are avoiding/ignoring wouldn't be so intimidating.  To
borrow heavily from rfc822 (done off the top of my head and not tested):


     /etc/rc.conf =  *(field/comment)

     field       =  field-name "=" [ field-body ] (comment / LF)

     field-body  =  word

     field-name  =  1*<any ALPHA, NUMERIC, or US>

     comment     =  "#" *<any CHAR except CTLs> LF

     word        =  atom / quoted-string

     atom        =  1*<any CHAR except specials, SPACE and CTLs>

     quoted-string = <"> *(qtext / quoted-pair) <">

     qtext       =  <any CHAR except <">, "\", and CTLs,
                     but including linear-white-space>

     quoted-pair =  "\" CHAR                     ; may quote any CHAR
                                                 ; mabye not CTLs though

     linear-white-space =  1*([LF] LWSP-char)

     LWSP-char   =  SPACE / HTAB

     CHAR        =  <any ASCII character>        ; (   0 - 254 )

     ALPHA       =  <any of "a-z" or "A-Z">      ; isalpha(3)
                                                 ; with LC_CTYPE="C" only

     NUMERIC     =  "0" / "1" / "2" / "3" / "4"  ; isdigit(3)
                 /  "5" / "6" / "7" / "8" / "9"  ; with LC_CTYPE="C" only

     CR          =  <ASCII CR, carriage return>  ; (        15 )

     CTL         =  <any ASCII control           ; (   0 -  31 )
                     character and DEL>          ; (       127 )

     US          =  "_"                          ; ASCII underscore

     specials    =  "(" / ")" / "<" / ">" / "&"  ; Must be in quoted-
                 /  "|" / ";" / "=" / "\" / <">  ;   string, to use
                 /  "*" / "[" / "]" / "?" / "~"  ;   within a word.
                 /  "{" / "}"

NOTE:  I have purposfully not introduced any "macro" features, such as
variable substitution -- you want that then use m4, cpp, sed, whatever
to generate this file.

Now with some way to map which set of variables are used for which
startup scripts, and to dynamically change this mapping with pkg_* and
perhaps other tools, the rest is fairly easy (just a S.M.O.P. :-).

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>