[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: list iteration, appending lists to lists?
From: |
Steve Wray |
Subject: |
Re: list iteration, appending lists to lists? |
Date: |
Thu, 11 Aug 2005 07:58:38 +1200 |
User-agent: |
Mozilla Thunderbird 0.9 (X11/20041103) |
Mark Burgess wrote:
> This is just not the way variable expansion is defined. Iteration occurs
> only at specific locations.
Like in the target of a 'files' action?
Unfortunately, this doesn't work:
list_of_files = ( foo:bar:baz" )
file:
$(list_of_files):anotherfile
<directives>
Doesn't work with quotes either as in:
file:
"$(list_of_files):anotherfile"
Unless there is some way of being able to manipulate lists directly in
cfengine, I guess I'll have to come up with some list-manipulating
modules, if I want to do this sort of thing.
A related question: is cfengine a first or second order language? Is it
computationally general?
The old computer scientist/logicians question: "Is it possible to
express arithmetic in cfengine?"
> On Wed, 2005-08-10 at 15:22 +1200, Steve Wray wrote:
>
>>I had thought that I could use list iteration like this:
>>
>>somelist = ( foo:bar:baz" )
>>
>>anotherlist = ("somefile:$(somelist).conf" )
>>
>>and that this would expand to:
>>
>>"somefile:foo.conf:bar.conf:baz.conf"
>>when I used it in a 'files' action.
>>
>>But it doesn't. It expands into:
>>"somefile:foo:bar:baz.conf"
>>
>>which is less useful to me.
>>
>>I've been trying to figure out how to make it work as I want, but no
>>luck so far.
>>
>>Suggestions would be welcome!
--
"Politics is the art of looking for trouble, finding it, misdiagnosing
it, and then misapplying the wrong remedies." - Groucho Marx
signature.asc
Description: OpenPGP digital signature