On Sun, 2005-03-13 at 13:01 -0700, Edward F. Brown wrote: > > Hey all, > > > > I was trying to find a way to check the syntax if our cfengine files > > before we commit them in cvs. So far, it appears that --parse-only only > > works on files that are in /var/cfengine. Is there a way to override > > this and specific a location on the fly? I tried looking through the > > docs, but I just didn't see anything talking about it. > > > '-f' allows you to specify a file name. You need to be explicit about the > path to the file, or it defaults to inputs, as you noted. I.e., > './filename', rather than just 'filename'. > > Here's a script I run on cvs commit of files in the inputs directory: > > -------------------------------------------------------------------- > #!/bin/sh > > # cfsyn_check: called by cvs commitinfo trigger (/var/CVS/CVSROOT/commitinfo) > # return code determines whether commit is allowed > # only run on files ending in '.cf' > > for i in "$@" > do > if echo "$i" |grep -q "\.cf" > then > sudo /usr/sbin/cfagent -pf ./$i > if [ $? -ne 0 ] > then > exit 1 > fi > fi > done > ------------------------------------------------------------------ > > This is the commitinfo trigger (.../CVSROOT/commitinfo): > > # Check cfengine syntax before allowing commit > inputs /usr/local/sbin/cfsyn_check %s > > hope this helps, > Ed
Thanks! Thats exactly what I was looking for. The only thing I noticed is that I need to set CFINPUTS to the directory where these files are at otherwise it wants to check the HOME directory. Cheers! -- Lance Albertson <[EMAIL PROTECTED]> Gentoo Infrastructure | Operations Manager --- GPG Public Key: <http://www.ramereth.net/lance.asc> Key fingerprint: 0423 92F3 544A 1282 5AB1 4D07 416F A15D 27F4 B742 ramereth/irc.freenode.net
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Help-cfengine mailing list Help-cfengine@gnu.org http://lists.gnu.org/mailman/listinfo/help-cfengine