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

WIndows recurse copy_from fails when directory contains speciail char

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 3.7.4, 3.10.0b1
    • Fix Version/s: None
    • Component/s: Promise type: files
    • Labels:
      None
    • Environment:
      windows
    • Platform:
      Windows
    • Steps to reproduce:
      Manual steps provided

      Description

      On windows we copy from the server the gvim addon directorties toi:

      • C:\Program Files (x86)\Vim\vimfiles

      The gvim addon directory has the followiing structure

      • doc
      • plugin
      • syntax

      When we use this code:

      bundle agent main
      {
          vars:
              "addons" string => translatepath("$(sys.winprogdir86)\Vim\vimfiles");
             "exclude_dir" list => { "\.svn" };
      
          files:  
              windows::
                 "$(addons)"
                      comment      => "Install the SURFsara vim plugins system wide",
                      copy_from    => remote_cp("<server_dir>/addons", "$(sys.policy_hub)"),
                      depth_search => recurse_ignore("inf", "@(exclude_dir)" );
      }
      

      This one will copy the files but we receive a lot of error messages:

        error: Regular expression error: pcre_compile() 'unknown property name after \P or \p' in expression 'C:\Program Files (x86)\Vim\vimfiles\plugin\cf3.vim' (offset: 4)
      

      When we copy per directory the error messages disappear:

      bundle agent main
      {
          vars:
              "doc" string => translatepath("$(sys.winprogdir86)\Vim\vimfiles\doc");
             "exclude_dir" list => { "\.svn" };
      
          files:  
              windows::
                 "$(doc)"
                      comment      => "Install the SURFsara vim plugins system wide",
                      copy_from    => remote_cp("<server_dir>/addons/doc", "$(sys.policy_hub)"),
                      depth_search => recurse_ignore("inf", "@(exclude_dir)" );
      }
      

      To be short if we copy file from the poicy hub that has multiple sub directories to a windows directory that has specials chars it produce regex errors.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bas Bas van der Vlies
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel