[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfengine-help
Subject:    Negating classes -- patch solution
From:       Alan Sparks <asparks () quris ! com>
Date:       2000-11-13 16:22:12
[Download RAW message or body]

I've seen a few discussions about negating classes in cfengine class
definitions.  I've been frustrated about this too, not being able to do
something like:

classes:
	thisclass = ( !thatclass )

without getting the dreaded "Wildcards not allowed here:" message.

It seemed (from the source) that cfengine is quite capable of handling
that, and that a parsing problem is more the issue than anything else. 
So, I modified the src/cflex.l.in file as shown below.  This does not
seem to have caused any parsing or semantic problems with my existing
scripts, but it has allowed cfengine to parse the negated class
references as exemplified above.  And it works just fine.

Any possibility of this getting included in a later release of 1.6? 
Thanks.
-Alan

*** cflex.l.in.orig  Mon Nov 13 09:02:29 2000
--- cflex.l.in     Mon Nov 13 09:18:14 2000
***************
*** 76,82 ****
  qstring   \"[^"\n]*\"
  sqstring  \'[^'\n]*\'
  bqstring  `[^`\n]*`
! item      [+]?[-.,@a-zA-Z0-9_@EIGHTBIT@]+
  id        [.|!,;a-zA-Z0-9_@EIGHTBIT@]+
  classt    [.|!,;a-zA-Z0-9_()@EIGHTBIT@]+::
  path      [-:.,;/a-zA-Z0-9_@EIGHTBIT@]+
--- 76,82 ----
  qstring   \"[^"\n]*\"
  sqstring  \'[^'\n]*\'
  bqstring  `[^`\n]*`
! item      [+]?[-.,!@a-zA-Z0-9_@EIGHTBIT@]+
  id        [.|!,;a-zA-Z0-9_@EIGHTBIT@]+
  classt    [.|!,;a-zA-Z0-9_()@EIGHTBIT@]+::
  path      [-:.,;/a-zA-Z0-9_@EIGHTBIT@]+


-- 
Alan Sparks, Sr. UNIX Administrator	asparks@quris.com
Quris, Inc.				(720) 836-2058


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic