control:
pf_cc= "/usr/bin/gcc"
pf_cc_vers= (
ExecResult(/bin/sh -c "${pf_cc} --version | head -1 | cut -d\
-f3")
)
...used to produce the version number of /usr/bin/gcc, but now running
this command produces "/usr/bin/gcc: no input files".
Running under debug shows:
RecordMacroId(pf_cc_vers)
HandleFunctionObject(ExecResult(/bin/sh -c "${pf_cc} --version | head -1
| cut -d\ -f3"))
IsBuiltinFunction(ExecResult(/bin/sh -c "${pf_cc} --version | head -1 |
cut -d\ -f3"))
IsBuiltinFunction: ExecResult(/bin/sh -c "${pf_cc} --version | head -1 |
cut -d\ -f3")
HandleFunction: ExecResult(/bin/sh -c "${pf_cc} --version | head -1 |
cut -d\ -f3")
FunctionStringToCode(ExecResult)
Appending [/bin/sh -c ${pf_cc} --version | head -1 | cut -d\ -f3]
ExpandVarstring(/bin/sh -c ${pf_cc} --version | head -1 | cut -d\ -f3)
Returning substring value pf_cc
Scanning variable pf_cc
GetMacroValue(main,pf_cc)
Expansion gave (/bin/sh -c /usr/bin/gcc)
ARG[0] /bin/sh -c /usr/bin/gcc --version | head -1 | cut -d\ -f3
cfpopen(/bin/sh -c /usr/bin/gcc --version | head -1 | cut -d\ -f3)
GetExecOutput got: [gcc: no input files]
cfpclose(pp)
The "Expansion gave...." line shows what is actually being executed,
namely gcc with no arguments.
Changing the double quotes to singlequotes in the ExecResult seems to
make cfengine happy, as does rolling back to 2.1.15. In other words,
changing the above snippet to:
control:
pf_cc= "/usr/bin/gcc"
pf_cc_vers= (
ExecResult(/bin/sh -c '${pf_cc} --version | head -1 | cut -d\
-f3')
)
...produces the same results in 2.1.15 as 2.1.16.
Paul Krizak 5900 E. Ben White Blvd. MS 625
Advanced Micro Devies Austin, Tx 78741
CAD Systems Engineering Phone: (512) 602-8775
Paul....@amd.com
> _______________________________________________
> Help-cfengine mailing list
> Help-c...@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-cfengine