[augeas-devel] Fwd: case-like solution?

Raphaël Pinson raphink at gmail.com
Tue Dec 29 18:07:16 UTC 2009


Sorry, I had answered Tim and forgot to put the list in copy.

---------- Forwarded message ----------
From: Raphaël Pinson <raphink at gmail.com>
Date: 2009/12/29
Subject: Re: [augeas-devel] case-like solution?
To: Tim Stoop <tim.stoop at gmail.com>




On Tue, Dec 29, 2009 at 4:15 PM, Tim Stoop <tim.stoop at gmail.com> wrote:

> Hi all,
>
> I'm trying my hand at writing a lens that would allow me the create
> mod_rewrite rules (including conditions) in a file. I'm having a
> little trouble defining the following:
>
> If the RewriteCond line ends in "[OR]", I need the "chain_as" item to
> have the value "or", but if there's nothing at the end of the line, I
> want the chain_as value to be defined as "and". Any hints on how to do
> this?
>
> It's but a first attempt, but once I have it working more or less,
> I'll post it here, of course. Not sure if anyone else could use such a
> specific lens.
>
>

Something like this (not tested):


   let chain_as = [
           label "chain_as"
              . ( value "or" . del "[OR]" "[OR]" ) | ( value "and" )
       ]

   let line = whatever . chain_as . eol



Raphaël
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20091229/b13216f5/attachment.htm>


More information about the augeas-devel mailing list