Aleksey/Seva-

So you want to recreate "make" in CFEngine? :-)

ifvarclass() says "if the named class exists, do something"

fileexists() says "if the named file exists, make the class expression 'true'" 
and that is used to create a named class.

The two are incompatible (because the latter is only used in class promises).  
Your example isn't clear, as it appears to use the target as both a directory 
and a file.  What you probably want to do is use a transformer attribute.  But 
maybe not :-)

-Dan
  
On Jun 23, 2011, at 6:52 PM, Aleksey Tsalolikhin wrote:

> On Fri, Apr 23, 2010 at 3:38 AM, Сева Глущенко
> <seva.glusche...@gmail.com> wrote:
>> Hello folks,
>> 
>> I'm trying to make a promise which creates files when their
>> counterparts not exist yet. But when I'm writing something like
>> 
>>    compile::
>>       "$(base)/(.*)/.compile"
>>               create          => "true",
>>               ifvarclass      => !canonify(fileexists("$(dst)/$(match.1)")),
>>               comment         => "force compiler execution";
>> 
>> The Cfengine reports syntax error on that. Am I missed something? Is
>> there a way to accomplish this task at all?
> 
> Hi.
> 
> I've just requested an ifnotvarclass attribute, which would resolve
> this cleanly, without requiring a separate promise to invert the class.
> 
> https://cfengine.com/bugtracker/view.php?id=123
> 
> I've put it in as a note on Seva's ticket, rather than a separate
> feature request ticket.
> 
> Please consider it?
> 
> Cheers,
> Aleksey
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to