[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Bug 1196] New: cfengine has problems with parenthesis.



http://bugs.skolelinux.no/show_bug.cgi?id=1196

           Summary: cfengine has problems with parenthesis.
           Product: Skolelinux
           Version: etch-alpha
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: debian-edu-config
        AssignedTo: debian-edu@lists.debian.org
        ReportedBy: klaus@skolelinux.no


/etc/cfengine/debian-edu/cfengine.conf has this construct:
ltsp_arch               = ( ExecResult(/bin/sh -c "if [ 'amd64' =
$(/usr/bin/dpkg --print-architecture) ] ; then /bin/echo i386 ; else
/usr/bin/dpkg --print-architecture ; fi") )

Running this gives output like this:
cfengine.conf:53: Warning: Redefinition of macro ltsp_arch=] (or perhaps missing
quote)
cfengine.conf:53: Warning: Redefinition of macro ltsp_arch=; (or perhaps missing
quote)
cfengine.conf:53: Warning: Redefinition of macro ltsp_arch=then (or perhaps
missing quote)
cfengine.conf:53: Warning: Redefinition of macro ltsp_arch=/bin/echo (or perhaps
missing quote)
cfengine.conf:53: Warning: Redefinition of macro ltsp_arch=i386 (or perhaps
missing quote)
cfengine.conf:53: Warning: Redefinition of macro ltsp_arch=; (or perhaps missing
quote)
cfengine.conf:53: Warning: Redefinition of macro ltsp_arch=else (or perhaps
missing quote)
cfengine.conf:53: Warning: Redefinition of macro ltsp_arch=/usr/bin/dpkg (or
perhaps missing quote)
cfengine.conf:53: Warning: Redefinition of macro ltsp_arch=--print-architecture
(or perhaps missing quote)
cfengine.conf:53: Warning: Redefinition of macro ltsp_arch=; (or perhaps missing
quote)
cfengine.conf:53: Warning: Redefinition of macro ltsp_arch=fi") (or perhaps
missing quote)

It looks like cfenginge finds ExecResult( and then goes looking for the matching
parenthesis, and there it makes the mistake, chooses the first it finds. I've
tried different approaches, but the only thing that I can come up with is, on
the form:

command =
someresult = 

where command=ark and someresult=ltsp_arch

ark   = ( `/bin/sh -c "if [ 'amd64' = $(/usr/bin/dpkg --print-architecture) ] ;
then /bin/echo i386 ; else /usr/bin/dpkg --print-architecture ; fi"`)
ltsp_arch               = ( ExecResult('${ark}') )

I would like to have used arch instead of ark, but cfengine wouldn't let me. 

This is probably not a real fix, more a workaround



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



Reply to: