info-cvs
[Top][All Lists]
Advanced

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

Re: Problems with Trigger Scripts and CVS Pre-Commit Hooks


From: Yaron Yogev
Subject: Re: Problems with Trigger Scripts and CVS Pre-Commit Hooks
Date: Mon, 26 Jul 2010 00:31:38 -0700 (PDT)
User-agent: G2/1.0

Hi,

Could you post the relevant line from the commitinfo file in CVSROOT
directory your repository ?

I have a similar case, and the commitinfo line looks like this:
ALL /usr/local/bin/cvs_commit_verify  %r %p %m %{s}

- ALL: means the script is called for any commit
- /usr/local/bin/cvs_commit_verify: the name of the script to run
(the rest of the explanations I just copied from the commitinfo
header)
- %r = repository (path portion of $CVSROOT)
- %p = path relative to repository
- %m = log message
- %{s} = file name, file name, ...

Yaron

On Jul 24, 12:50 pm, Traiano Welcome
<address@hidden> wrote:
> Hi List
>
> I use cvs to manage BIND9 DNS zone files, and would like to create a
> pre-commit hook that will run a syntax checker on the zone file before it's
> committed. To do this, I have a shell wrapper that takes the name of the
> zone file as an argument and formats a command for the syntax checker. The
> shell wrapper is called from the commitinfo file as follows:
>
> ---
> named.data/ZONES/* /usr/local/bin/checkzone %s
> ---
>
> And "%s" is supposed to be expanded to the name of the zone file when any
> file under " named.data/ZONES/" is committed. The checkzone script is as
> follows:
>
> ---
> #!/bin/sh -x
> ZONE=`echo $1 | cut -d "." -f  2,3,4,5,6`
> ZONE_FILE=DB.$ZONE
> named-checkzone $ZONE $ZONE_FILE
> ---
>
> However, when I run the commit, the debug information shows the "%s"
> variable is not being expanded to the name of the file, consequently the
> shell script does not get the correct argument and the commit fails:
>
> ---
> address@hidden ~/named.data/ZONES]$ cvs commit  DB.evasive.co.za
>
> + cut -d . -f 2,3,4,5,6
> + echo %s
> + ZONE=%s
> + ZONE_FILE=DB.%s
> + named-checkzone %s DB.%s
>
> zone %s/IN: loading from master file DB.%s failed: file not found
>
> cvs commit: Pre-commit check failed
> cvs [commit aborted]: correct above errors first!
>
> ---
>
> Please could someone help me shed some light on this for me? I suspect it's
> somehow related to the environment the script is being run in, but the
> details escape me, and why "%s" is not being expanded is also beyond me at
> the moment :-P
>
> Thanks in Advance,
> Traiano Welcome
>
> NOTE: This e-mail message and all attachments thereto contain confidential 
> information intended for a specific addressee and purpose. If you are not the 
> addressee (a) you may not disclose, copy, distribute or take any action based 
> on the contents hereof; (b) kindly inform the sender immediately and destroy 
> all copies hereof. Any copying, publication or disclosure of this message, or 
> part hereof, in any form whatsoever, without the sender's express written 
> consent, is prohibited. No opinion expressed or implied by the sender 
> necessarily constitutes the opinion of MTN. This message does not constitute 
> a guarantee or proof of the facts mentioned herein. No Employee or 
> intermediary is authorised to conclude a binding agreement on behalf of MTN 
> Group Limited, or any of its subsidiary companies, by e-mail without the 
> express written confirmation by a duly authorised representative of MTN Group 
> Limited.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]