On 03/21/2012 09:08 AM, no-re...@cfengine.com wrote:
Forum: CFEngine Help
Subject: exclude git directories
Author: tuibelgium
Link to topic: https://cfengine.com/forum/read.php?3,25335,25335#msg-25335

I want to copy a directory which is a git repository whithout the .git 
directory.
The example below copies the git directory. Is there something wrong with the regex 
".*\.git.*" ?
I already tried different combinations, every time the git directory is copied.


files:
         "/tmp/dir"
         copy_from =>  my_cp("${source}"),
         depth_search =>  recurse("inf"),
         file_select =>  exclude_git;
}
############################################################
body file_select exclude_git
{
leaf_name =>  { ".*\.git.*" };
file_result =>  "!leaf_name";
}



file_select is only for file you have to use depth_search:
{{{
     vars:
        any::
            "exclude_dir"               slist => {  ".svn", "jobs" };
            "exclude_file"              slist => { "config", "mom.lock" };

    files:

        any::
            "$(torque.mom_priv_dir)"
                comment => "Sync the mom_priv directory",
                perms => mog("0755", "root", "root"),
                depth_search => recurse_ignore("1", "@(exclude_dir)" ),
}}}



--
********************************************************************
*  Bas van der Vlies                    e-mail: b...@sara.nl       *
*  SARA - Academic Computing Services   Amsterdam, The Netherlands *
********************************************************************

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to