Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-1264

"Regular expression error: pcre_compile() 'PCRE does not support ..."

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0
    • Labels:
      None
    • Platform:
      Any

      Description

      Our working policy from 3.3.4 uncovers some error messages in 3.6.0-beta2. I've stripped it down to a stand-alone example.

      Aim: to ensure some lines appear in a ".bashrc" file to end up as below. The problematical one is the "PS1" entry:

      <pre>
      ...
      alias la='ls -la'
      alias h='fc -l'
      PS1="[\u@\h \w]
      $ "
      ...
      </pre>

      (That's a single backslash before each of the letters u, h and w and a double backslash before the dollar.)

      Extracted from our 3.3.4 policy we have:
      <pre>
      body common control
      {
      bundlesequence =>

      { "envir", }

      ;
      }

      bundle agent envir
      {
      files:
      any::
      "/root/.bashrc"
      edit_line => bashrc_edit;
      }

      bundle edit_line bashrc_edit()
      {
      insert_lines:
      "alias la='ls -la'";
      "alias h='fc -l'";
      "PS1=\"[\u@\h \w]\\\\$ \"";
      }
      </pre>

      now producing output:
      <pre>
      2014-03-18T15:58:07+0000 error: /default/envir/files: Apparent body 'bashrc_edit' was undeclared, but used in a promise near line 12 of /tmp/envir.cf (possible unquoted literal value)
      2014-03-18T15:58:07+0000 error: /default/envir/files: Apparent body 'bashrc_edit' was undeclared, but used in a promise near line 12 of /tmp/envir.cf (possible unquoted literal value)
      2014-03-18T15:58:07+0000 error: /default/envir/files: Apparent body 'bashrc_edit' was undeclared, but used in a promise near line 12 of /tmp/envir.cf (possible unquoted literal value)
      2014-03-18T15:58:07+0000 error: /default/envir/files/'/root/.bashrc'/default/bashrc_edit/insert_lines/'PS1="[\u@\h \w]
      $ "'[0]: Regular expression error: pcre_compile() 'PCRE does not support \L, \l, \N

      {name}, \U, or \u' in expression 'PS1="[\u@\h \w]
      $ "' (offset: 7)
      2014-03-18T15:58:07+0000 error: /default/envir/files/'/root/.bashrc'/default/bashrc_edit/insert_lines/'PS1="[\u@\h \w]
      $ "'[0]: Regular expression error: pcre_compile() 'PCRE does not support \L, \l, \N{name}

      , \U, or \u' in expression 'PS1="[\u@\h \w]
      $ "' (offset: 7)
      2014-03-18T15:58:07+0000 error: /default/envir/files/'/root/.bashrc'/default/bashrc_edit/insert_lines/'PS1="[\u@\h \w]
      $ "'[0]: Regular expression error: pcre_compile() 'PCRE does not support \L, \l, \N

      {name}

      , \U, or \u' in expression 'PS1="[\u@\h \w]
      $ "' (offset: 7)
      [... repeated several more times ...]
      2014-03-18T15:58:07+0000 error: /default/envir/files: Apparent body 'bashrc_edit' was undeclared, but used in a promise near line 12 of /tmp/envir.cf (possible unquoted literal value)
      2014-03-18T15:58:07+0000 error: /default/envir/files: Apparent body 'bashrc_edit' was undeclared, but used in a promise near line 12 of /tmp/envir.cf (possible unquoted literal value)
      </pre>

      Two issues:

      1. "@Apparent body ...@": This seems to go away if I change the caller from:
      <pre>
      edit_line => bashrc_edit;
      </pre>
      to:
      <pre>
      edit_line => bashrc_edit();
      </pre>

      But I'm sure that previous versions didn't like the latter syntax (with the empty parentheses), so it would be useful to know the official line on the preferred syntax for compatibility from 3.3.4 to 3.6.0 and into the future.

      2. More important is the "@PCRE does not support...@" issue. It would be nice, for the present, at least, to keep this as an edit rather than a file copy. (Longer term, but after our 3.6.0 migration, we should locally investigate using templated copy.)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              davidlee David Lee
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel