Re: sys/conf/DEFAULT[S]

From: Adam C. Migus (adam_at_migus.org)
Date: 10/08/03

  • Next message: Bruce Evans: "Re: sys/conf/DEFAULT[S]"
    Date: Wed, 8 Oct 2003 10:12:12 -0400 (EDT)
    To: "Bruce Evans" <bde@zeta.org.au>
    
    

    Bruce Evans said:
    > On Thu, 2 Oct 2003, Adam C. Migus wrote:
    >
    >> > On Fri, 26 Sep 2003, Adam C. Migus wrote:
    >>
    >> This patch works for me, please let me know if there's any
    >> problems
    >> with it or you'd like a PR.
    >
    > % ====
    > //depot/user/amigus/freebsd-amigus/src/usr.sbin/config/config.y#1 -
    > /src/p4/user/amigus/perforce.freebsd.org/freebsd-amigus/usr.sbin/config/config.y
    > ====
    > % @@ -118,6 +118,8 @@
    > % |
    > % Config_spec SEMICOLON
    > % |
    > % + Include
    > % + |
    > % SEMICOLON
    > % |
    > % error SEMICOLON
    > % @@ -164,9 +166,7 @@
    > % = {
    > % hints = $2;
    > % hintmode = 1;
    > % - } |
    > % - INCLUDE ID
    > % - = { include($2, 0); };
    > % + };
    > %
    > % System_spec:
    > % CONFIG System_id System_parameter_list
    > % @@ -265,6 +265,11 @@
    > % rmdev($2);
    > % } ;
    > %
    > % +Include:
    > % + INCLUDE ID
    > % + = { include($2, 0); };
    > % +
    > % +
    > % %%
    > %
    > % void
    >
    > I found 1 problem with this: it doesn't require SEMICOLON after
    > "INCLUDE ID", so parsing resumes after "ID" when the input stream
    > is switched back to the includer. You can say things like
    >
    > include FOO device foo
    >
    > and then the "device foo" directive actually works. This can be
    > considered a feature, but the following is not:
    >
    > include GENERIC.local
    >
    > at the end of GENERIC should be a syntax error, but it actually
    > matches ID = GENERIC and includes GENERIC recursively, which gives
    > a confusing error message. There would be a syntax error on
    > switching
    > back but config aborts before then. (Filenames other than single
    > identifiers must be quoted to avoid problems like this. This is not
    > very obvious since config was changed to not require quotes in most
    > contexts.)
    >
    > Stefan's version requires SEMICOLON:
    >
    > % Index: src/usr.sbin/config/config.y
    > %
    > ===================================================================
    > % RCS file: /usr/home/ncvs/src/usr.sbin/config/config.y,v
    > % retrieving revision 1.61
    > % diff -u -r1.61 config.y
    > % --- src/usr.sbin/config/config.y 6 Jul 2003 02:00:52 -0000 1.61
    > % +++ src/usr.sbin/config/config.y 27 Sep 2003 10:39:13 -0000
    > % @@ -118,6 +118,9 @@
    > % |
    > % Config_spec SEMICOLON
    > % |
    > % + INCLUDE ID SEMICOLON
    > % + = { include($2, 0); };
    > % + |
    > % SEMICOLON
    > % |
    > % error SEMICOLON
    > % @@ -164,9 +167,7 @@
    > % = {
    > % hints = $2;
    > % hintmode = 1;
    > % - } |
    > % - INCLUDE ID
    > % - = { include($2, 0); };
    > % + }
    > %
    > % System_spec:
    > % CONFIG System_id System_parameter_list
    >
    > I lost your examples showing that this doesn't quite work. What is
    > the
    > problem with it?
    >
    > Another old bug is that using "include" defeats the point of the
    > INCLUDE_CONFIG_FILE option (since included files aren't expanded).
    >
    > Bruce
    >

    Bruce,
    I was half aware of this issue but viewed the bug/feature as a
    'necessary evil' given the complications in dealing with it. Your
    point about defeating the INCLUDE_CONFIG_FILE option, which I admit
    I like but no longer use, furthers this point -- the 'include'
    option is messy, period.

    WRT Stefan's solution, simply nest two includes on the first line,
    like so:

    head -1 KERNEL
    include SUB1

    head -1 SUB1
    include SUB2

    This will cause config to fail in the same manner it did before,
    with his patch.

    If you'd like, I can work on a more elegant solution that addresses
    the bugs you've outlined as well as (possibly, maybe) making
    INCLUDE_CONFIG_FILE useful again, with 'include.'

    Based on what I am reading I think people like 'include,' it's been
    there for a while and I don't think it's going away, so, if I'm
    correct fixing it right is the way to go.

    Let me know if you guys are interested, if so I'll happily make
    fixing /usr/sbin/config a side project. Otherwise I guess you'd be
    left with pick the broken you like best, document it and leave it
    that way or pull the include option entirely.

    --
    Adam - (http://people.migus.org/~amigus/)
    Migus Dot Org - (http://www.migus.org/)
    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
    

  • Next message: Bruce Evans: "Re: sys/conf/DEFAULT[S]"

    Relevant Pages

    • Re: Special Deployment required
      ... I take your point about hosting the application at our site. ... modify the config assuming that it was one of these two. ... On Jan 17, 12:37 am, bruce barker ... if you want turn key installation, you should look at hosting the ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: Unable to Access Com Port
      ... Bruce, Steve and Malke, thanks...looks like I'll need to ... get a patch or new program. ... > If the application's manufacturer will not (or ... >> compatibility to Win 98, ...
      (microsoft.public.windowsxp.general)
    • Re: sys/conf/DEFAULT[S]
      ... Bruce Evans said: ... Stefan's patch moved ... the SEMICOLON and nesting issues and in addition fix the problem you ...
      (freebsd-arch)
    • Re: [PATCH] Re: IP_MAX_MEMBERSHIPS story.
      ... Bruce M Simpson wrote: ... the patch will probably also apply ... to HEAD with little or no fuzz. ... Because of the nature of this patch, it will break the ABI with regards ...
      (freebsd-net)
    • Re: sys/conf/DEFAULT[S]
      ... Bruce Evans said: ... > back but config aborts before then. ... > Stefan's version requires SEMICOLON: ... not applying the patch but rather reading and carelessly assuming ...
      (freebsd-arch)

  • Quantcast