help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Negating classes -- patch solution


From: Alan Sparks
Subject: Negating classes -- patch solution
Date: Mon, 13 Nov 2000 09:22:12 -0700

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]