This snippet of code, in 2.1.15, resulted in no_smf_output only being defined if my ${clearingsmfoutput} file did not exist. Under 2.1.16, it is *always* true.

groups:
   has_smf_output=    ( FileExists(${clearingsmfoutput}) )
   no_smf_output=    ( any -has_smf_output )


The file does exist on the system:

$ ls -l /var/opt/clearingd/log/smf-update.last
-rw-r--r-- 1 root other 817 Oct 17 08:51 /var/opt/clearingd/log/smf-update.last

The relevant d2 output under 2.1.16:

HandleFunctionObject(FileExists(${clearingsmfoutput}))
IsBuiltinFunction(FileExists(${clearingsmfoutput}))
IsBuiltinFunction: FileExists(${clearingsmfoutput})
HandleFunction: FileExists(${clearingsmfoutput})
FunctionStringToCode(FileExists)
Appending [${clearingsmfoutput}]
ExpandVarstring(${clearingsmfoutput})
Returning substring value clearingsmfoutput
Scanning variable clearingsmfoutput
GetMacroValue(main,clearingsmfoutput)
Expansion gave (/var/opt/clearingd/log/smf-update.last)
ARG[0] /var/opt/clearingd/log/smf-update.last
ExpandVarstring(XX_CF_opposite_any_XX)
[No match of class XX_CF_opposite_any_XX]

ExpandVarstring(any)
AddClassToHeap(no_smf_output)
Appending [no_smf_output]
ExpandVarstring(has_smf_output)

...and it then goes on to evaluate later lines of the file (omitted for brevity's sake).

I am using the un-version-numbered patched version of 2.1.16 that mark released (fix for variable expansion inside special functions).

The same config's output under 2.1.15:

HandleFunctionObject(FileExists(${clearingsmfoutput}))
IsBuiltinFunction(FileExists(${clearingsmfoutput}))
IsBuiltinFunction: FileExists(${clearingsmfoutput})
ExpandVarstring(${clearingsmfoutput})
Returning substring value clearingsmfoutput
Scanning variable clearingsmfoutput
GetMacroValue(main,clearingsmfoutput)
Expansion gave (/var/opt/clearingd/log/smf-update.last)
HandleFunction: FileExists(/var/opt/clearingd/log/smf-update.last)
FunctionStringToCode(FileExists)
ExpandVarstring(any)
AddClassToHeap(has_smf_output)
Appending [has_smf_output]
ExpandVarstring(any)
AddClassToHeap(no_smf_output)
Appending [no_smf_output]
ExpandVarstring(has_smf_output)
Deleted item no_smf_output


Note that the 'Deleted item' is not appearing in 2.1.16 output.  :(

I looked at diffs in the source, but I couldn't find anything that jumped out at me.





_______________________________________________
Help-cfengine mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-cfengine

Reply via email to